diff --git a/local-app/python-tools/cross-organization/assess_check_config.py b/local-app/python-tools/cross-organization/assess_check_config.py index 5c1a9a1c..ccb356ba 100755 --- a/local-app/python-tools/cross-organization/assess_check_config.py +++ b/local-app/python-tools/cross-organization/assess_check_config.py @@ -8,7 +8,7 @@ import glob # --- VERSIONING --- -__version__ = "1.0.6" +__version__ = "1.0.7" def find_latest_file(pattern): """Searches for the most recent file matching the pattern.""" @@ -40,7 +40,8 @@ def main(): print("-" * 140) stats = { - "objects": 0, "size_bytes": 0, "non_central_buckets": set(), + "objects": 0, "size_bytes": 0, + "central_buckets": set(), "non_central_buckets": set(), "total_recorders": 0, "accounts": len(data) } @@ -61,23 +62,25 @@ def main(): stats["objects"] += reg_data.get("object_count", 0) stats["size_bytes"] += reg_data.get("bucket_size_bytes", 0) - if bucket != "N/A" and not re.match(args.central_bucket_regex, bucket): - s3_issues.append(bucket) - stats["non_central_buckets"].add(bucket) + if bucket != "N/A": + if re.match(args.central_bucket_regex, bucket): + stats["central_buckets"].add(bucket) + else: + s3_issues.append(bucket) + stats["non_central_buckets"].add(bucket) s3_status = "NON_COMPLIANT" if s3_issues else "COMPLIANT" print(f"{acc_id:<15} | {ou_path[:30]:<30} | {summary:<12} | {s3_status}") - # RESTORED SUMMARY SECTION + # SUMMARY SECTION size_gb = stats["size_bytes"] / (1024**3) print("-" * 140) print(f"ORGANIZATION FOOTPRINT SUMMARY (CONFIG) | Org ID: {org_id}") print(f" Active Recorders: {stats['total_recorders']}") print(f" Total S3 Objects: {stats['objects']:,}") print(f" Total S3 Storage: {size_gb:.2f} GB") + print(f" Central Buckets: {len(stats['central_buckets'])}") print(f" Non-Central Buckets: {len(stats['non_central_buckets'])}") - for b in sorted(stats["non_central_buckets"]): - print(f" - {b}") print("-" * 140) if __name__ == "__main__":