google.cloud.forseti.scanner.scanners.lien_scanner module

Scanner for the Lien rules engine.

class LienScanner(global_configs, scanner_configs, service_config, model_name, snapshot_timestamp, rules)[source]

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

Scanner for Liens.

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

Find violations in liens.

Parameters:parent_resource_to_liens (Dict[Resource, List[lien]]) – mapping of a resource to the liens it contains.
Returns:A list of all violations.
Return type:List[RuleViolation]
static _flatten_violations(violations)[source]

Flatten violations into a dict.

Parameters:violations (List[RuleViolation]) – The violations to flatten.
Yields:Iterator[dict] – flattened violations for each violation.
_output_results(all_violations)[source]

Output results.

Parameters:all_violations (List[RuleViolation]) – A list of lien violations.
_retrieve()[source]

Retrieves the data for scanner.

Returns:
mapping of a resource to the liens it
contains.
Return type:Dict[Resource, List[lien]]
Raises:ValueError – if resources have an unexpected type.
run()[source]

Runs the data collection.