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 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.

  • 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.
The output filename for the csv, formatted with the
now_utc timestamp.
Return type:str

Runs the pipeline.