mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(allowlist): validate allowlist for any database format (file, dynamo, s3, etc) (#1792)
This commit is contained in:
committed by
GitHub
parent
5537981877
commit
48b9220ffc
@@ -61,13 +61,13 @@ def parse_allowlist_file(audit_info, allowlist_file):
|
||||
else:
|
||||
with open(allowlist_file) as f:
|
||||
allowlist = yaml.safe_load(f)["Allowlist"]
|
||||
try:
|
||||
allowlist_schema.validate(allowlist)
|
||||
except Exception as error:
|
||||
logger.critical(
|
||||
f"{error.__class__.__name__} -- Allowlist YAML is malformed - {error}[{error.__traceback__.tb_lineno}]"
|
||||
)
|
||||
sys.exit()
|
||||
try:
|
||||
allowlist_schema.validate(allowlist)
|
||||
except Exception as error:
|
||||
logger.critical(
|
||||
f"{error.__class__.__name__} -- Allowlist YAML is malformed - {error}[{error.__traceback__.tb_lineno}]"
|
||||
)
|
||||
sys.exit()
|
||||
return allowlist
|
||||
except Exception as error:
|
||||
logger.critical(
|
||||
|
||||
Reference in New Issue
Block a user