google.cloud.forseti.scanner.scanners.base_scanner module

Base scanner.

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

Bases: object

This is a base class skeleton for scanners.

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

Output scanner results to DB.

Parameters:violations (list) – A list of violations.
_upload_csv(output_path, now_utc, csv_name)[source]

Upload CSV to Cloud Storage.

Parameters:
  • output_path (str) – The output path for the csv.
  • now_utc (datetime) – The UTC timestamp of “now”.
  • csv_name (str) – The csv_name.
static get_output_filename(now_utc)[source]

Create the output filename.

Parameters:now_utc (datetime) – The datetime now in UTC. Generated at the top level to be consistent across the scan.
Returns:
The output filename for the csv, formatted with the
now_utc timestamp.
Return type:str
run()[source]

Runs the pipeline.