Skip to content

Commit

Permalink
Add AWS account blacklist (#16)
Browse files Browse the repository at this point in the history
This will ensure aws accounts that are out of scope won't be scanned unnecessarily
  • Loading branch information
bc-jcarlson authored Sep 13, 2024
1 parent ddc311b commit a438840
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lambda_code/scan/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
env_name = os.environ["ENVIRONMENT"]
production_env = os.environ["PRODUCTION_ENVIRONMENT"]

# Brightcove AWS accounts that are out of scope for domain-protect
bc_acct_blacklist = [
"876504563909" # BC-IT-STORAGE
]


def process_vulnerability(domain, account_name, resource_type, vulnerability_type, takeover=""):

Expand Down Expand Up @@ -291,6 +296,10 @@ def lambda_handler(event, context): # pylint:disable=unused-argument
account_id = event["Id"]
account_name = event["Name"]

if account_id in bc_acct_blacklist:
print(f"Account ID {account_id} found in blacklist, skipping...")
return

boto3_session = assume_role(account_id)
route53 = boto3_session.client("route53")

Expand Down

0 comments on commit a438840

Please sign in to comment.