google.cloud.forseti.scanner.scanners.bigquery_scanner module

Scanner for the Big Query rules engine.

class BigqueryAccessControlsData(parent_project, bigquery_acl)

Bases: tuple

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

static __new__(_cls, parent_project, bigquery_acl)

Create new instance of BigqueryAccessControlsData(parent_project, bigquery_acl)

__repr__()

Return a nicely formatted representation string

_asdict()

Return a new OrderedDict which maps field names to their values.

_fields = ('parent_project', 'bigquery_acl')
classmethod _make(iterable, new=<built-in method __new__ of type object>, len=<built-in function len>)

Make a new BigqueryAccessControlsData object from a sequence or iterable

_replace(**kwds)

Return a new BigqueryAccessControlsData object replacing specified fields with new values

_source = "from builtins import property as _property, tuple as _tuple\nfrom operator import itemgetter as _itemgetter\nfrom collections import OrderedDict\n\nclass BigqueryAccessControlsData(tuple):\n 'BigqueryAccessControlsData(parent_project, bigquery_acl)'\n\n __slots__ = ()\n\n _fields = ('parent_project', 'bigquery_acl')\n\n def __new__(_cls, parent_project, bigquery_acl):\n 'Create new instance of BigqueryAccessControlsData(parent_project, bigquery_acl)'\n return _tuple.__new__(_cls, (parent_project, bigquery_acl))\n\n @classmethod\n def _make(cls, iterable, new=tuple.__new__, len=len):\n 'Make a new BigqueryAccessControlsData object from a sequence or iterable'\n result = new(cls, iterable)\n if len(result) != 2:\n raise TypeError('Expected 2 arguments, got %d' % len(result))\n return result\n\n def _replace(_self, **kwds):\n 'Return a new BigqueryAccessControlsData object replacing specified fields with new values'\n result = _self._make(map(kwds.pop, ('parent_project', 'bigquery_acl'), _self))\n if kwds:\n raise ValueError('Got unexpected field names: %r' % list(kwds))\n return result\n\n def __repr__(self):\n 'Return a nicely formatted representation string'\n return self.__class__.__name__ + '(parent_project=%r, bigquery_acl=%r)' % self\n\n def _asdict(self):\n 'Return a new OrderedDict which maps field names to their values.'\n return OrderedDict(zip(self._fields, self))\n\n def __getnewargs__(self):\n 'Return self as a plain tuple. Used by copy and pickle.'\n return tuple(self)\n\n parent_project = _property(_itemgetter(0), doc='Alias for field number 0')\n\n bigquery_acl = _property(_itemgetter(1), doc='Alias for field number 1')\n\n"
bigquery_acl
parent_project
class BigqueryScanner(global_configs, scanner_configs, service_config, model_name, snapshot_timestamp, rules)[source]

Bases: google.cloud.forseti.scanner.scanners.base_scanner.BaseScanner

Scanner for BigQuery acls.

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 214
_abc_registry = <_weakrefset.WeakSet object>
_find_violations(bigquery_acl_data)[source]

Find violations in the policies.

Parameters:bigquery_acl_data (list) – Big Query data to find violations in
Returns:A list of BigQuery violations
Return type:list
static _flatten_violations(violations)[source]

Flatten RuleViolations into a dict for each RuleViolation member.

Parameters:violations (list) – The RuleViolations to flatten.
Yields:dict – Iterator of RuleViolations as a dict per member.
_output_results(all_violations)[source]

Output results.

Parameters:all_violations (list) – A list of BigQuery violations.
_retrieve()[source]

Retrieves the data for scanner.

Returns:BigQuery ACL data
Return type:list
Raises:ValueError – if resources have an unexpected type.
run()[source]

Runs the data collection.