google.cloud.forseti.scanner.scanners.retention_scanner module

Scanner for the retention rules engine.

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

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

Scanner for retention.

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

Find violations in the resources with retention policies.

Parameters:resources (list) – Contains all supported resource in retention.
Returns:All 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) – All violations.
_retrieve()[source]

Retrieves the data for scanner.

Returns:
a list of Resources, with a type in
SUPPORTED_RETENTION_RES_TYPES
Return type:list
run()[source]

Run, he entry point for this scanner.