Skip to content

Commit

Permalink
add script
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 2, 2026
1 parent 8bfcebf commit 1b919aa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions local-app/python-tools/cross-organization/assess_check_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import json
import argparse
import re

def main():
parser = argparse.ArgumentParser()
parser.add_argument("--input", required=True, help="The JSON audit file")
parser.add_argument("--central-bucket-regex", required=True, help="Regex for central bucket")
args = parser.parse_args()

with open(args.input, 'r') as f:
data = json.load(f)

print(f"{'Account ID':<15} | {'Region':<15} | {'Match':<6} | {'Bucket Name'}")
print("-" * 70)

for acc in data:
for reg, checks in acc["checks"].items():
bucket = checks.get("s3_bucket", "N/A")
if bucket != "N/A":
match = bool(re.match(args.central_bucket_regex, bucket))
if not match:
print(f"{acc['account_id']:<15} | {reg:<15} | {str(match):<6} | {bucket}")

if __name__ == "__main__":
main()

0 comments on commit 1b919aa

Please sign in to comment.