feat(shodan_integration): add ec2_elastic_ip_shodan check and config yaml (#1356)

Co-authored-by: sergargar <sergio@verica.io>
This commit is contained in:
Sergio Garcia
2022-10-05 13:48:34 +02:00
committed by GitHub
parent fb176f56d0
commit 107070e6e2
33 changed files with 992 additions and 1766 deletions

View File

@@ -1,6 +1,8 @@
from datetime import datetime, timezone
from os import getcwd
import yaml
timestamp = datetime.today()
timestamp_utc = datetime.now(timezone.utc).replace(tzinfo=timezone.utc)
prowler_version = "3.0-beta-08Aug2022"
@@ -18,3 +20,21 @@ timestamp_iso = timestamp.isoformat()
csv_file_suffix = ".csv"
json_file_suffix = ".json"
json_asff_file_suffix = ".asff.json"
config_yaml = "providers/aws/config.yaml"
def change_config_var(variable, value):
with open(config_yaml) as f:
doc = yaml.safe_load(f)
doc[variable] = value
with open(config_yaml, "w") as f:
yaml.dump(doc, f)
def get_config_var(variable):
with open(config_yaml) as f:
doc = yaml.safe_load(f)
return doc[variable]