runbooks 0.7.7__py3-none-any.whl → 0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runbooks/__init__.py +1 -1
- runbooks/base.py +2 -2
- runbooks/cfat/README.md +12 -1
- runbooks/cfat/__init__.py +8 -4
- runbooks/cfat/assessment/collectors.py +171 -14
- runbooks/cfat/assessment/compliance.py +546 -522
- runbooks/cfat/assessment/runner.py +129 -10
- runbooks/cfat/models.py +6 -2
- runbooks/common/__init__.py +152 -0
- runbooks/common/accuracy_validator.py +1039 -0
- runbooks/common/context_logger.py +440 -0
- runbooks/common/cross_module_integration.py +594 -0
- runbooks/common/enhanced_exception_handler.py +1108 -0
- runbooks/common/enterprise_audit_integration.py +634 -0
- runbooks/common/logger.py +14 -0
- runbooks/common/mcp_integration.py +539 -0
- runbooks/common/performance_monitor.py +387 -0
- runbooks/common/profile_utils.py +216 -0
- runbooks/common/rich_utils.py +622 -0
- runbooks/enterprise/__init__.py +68 -0
- runbooks/enterprise/error_handling.py +411 -0
- runbooks/enterprise/logging.py +439 -0
- runbooks/enterprise/multi_tenant.py +583 -0
- runbooks/feedback/user_feedback_collector.py +440 -0
- runbooks/finops/README.md +129 -14
- runbooks/finops/__init__.py +22 -3
- runbooks/finops/account_resolver.py +279 -0
- runbooks/finops/accuracy_cross_validator.py +638 -0
- runbooks/finops/aws_client.py +721 -36
- runbooks/finops/budget_integration.py +313 -0
- runbooks/finops/cli.py +90 -33
- runbooks/finops/cost_processor.py +211 -37
- runbooks/finops/dashboard_router.py +900 -0
- runbooks/finops/dashboard_runner.py +1334 -399
- runbooks/finops/embedded_mcp_validator.py +288 -0
- runbooks/finops/enhanced_dashboard_runner.py +526 -0
- runbooks/finops/enhanced_progress.py +327 -0
- runbooks/finops/enhanced_trend_visualization.py +423 -0
- runbooks/finops/finops_dashboard.py +41 -0
- runbooks/finops/helpers.py +639 -323
- runbooks/finops/iam_guidance.py +400 -0
- runbooks/finops/markdown_exporter.py +466 -0
- runbooks/finops/multi_dashboard.py +1502 -0
- runbooks/finops/optimizer.py +396 -395
- runbooks/finops/profile_processor.py +2 -2
- runbooks/finops/runbooks.inventory.organizations_discovery.log +0 -0
- runbooks/finops/runbooks.security.report_generator.log +0 -0
- runbooks/finops/runbooks.security.run_script.log +0 -0
- runbooks/finops/runbooks.security.security_export.log +0 -0
- runbooks/finops/service_mapping.py +195 -0
- runbooks/finops/single_dashboard.py +710 -0
- runbooks/finops/tests/__init__.py +19 -0
- runbooks/finops/tests/results_test_finops_dashboard.xml +1 -0
- runbooks/finops/tests/run_comprehensive_tests.py +421 -0
- runbooks/finops/tests/run_tests.py +305 -0
- runbooks/finops/tests/test_finops_dashboard.py +705 -0
- runbooks/finops/tests/test_integration.py +477 -0
- runbooks/finops/tests/test_performance.py +380 -0
- runbooks/finops/tests/test_performance_benchmarks.py +500 -0
- runbooks/finops/tests/test_reference_images_validation.py +867 -0
- runbooks/finops/tests/test_single_account_features.py +715 -0
- runbooks/finops/tests/validate_test_suite.py +220 -0
- runbooks/finops/types.py +1 -1
- runbooks/hitl/enhanced_workflow_engine.py +725 -0
- runbooks/inventory/README.md +12 -1
- runbooks/inventory/artifacts/scale-optimize-status.txt +12 -0
- runbooks/inventory/collectors/aws_comprehensive.py +192 -185
- runbooks/inventory/collectors/enterprise_scale.py +281 -0
- runbooks/inventory/core/collector.py +299 -12
- runbooks/inventory/list_ec2_instances.py +21 -20
- runbooks/inventory/list_ssm_parameters.py +31 -3
- runbooks/inventory/organizations_discovery.py +1315 -0
- runbooks/inventory/rich_inventory_display.py +360 -0
- runbooks/inventory/run_on_multi_accounts.py +32 -16
- runbooks/inventory/runbooks.security.report_generator.log +0 -0
- runbooks/inventory/runbooks.security.run_script.log +0 -0
- runbooks/inventory/vpc_flow_analyzer.py +1030 -0
- runbooks/main.py +4171 -1615
- runbooks/metrics/dora_metrics_engine.py +1293 -0
- runbooks/monitoring/performance_monitor.py +433 -0
- runbooks/operate/README.md +394 -0
- runbooks/operate/__init__.py +2 -2
- runbooks/operate/base.py +291 -11
- runbooks/operate/deployment_framework.py +1032 -0
- runbooks/operate/deployment_validator.py +853 -0
- runbooks/operate/dynamodb_operations.py +10 -6
- runbooks/operate/ec2_operations.py +321 -11
- runbooks/operate/executive_dashboard.py +779 -0
- runbooks/operate/mcp_integration.py +750 -0
- runbooks/operate/nat_gateway_operations.py +1120 -0
- runbooks/operate/networking_cost_heatmap.py +685 -0
- runbooks/operate/privatelink_operations.py +940 -0
- runbooks/operate/s3_operations.py +10 -6
- runbooks/operate/vpc_endpoints.py +644 -0
- runbooks/operate/vpc_operations.py +1038 -0
- runbooks/remediation/README.md +489 -13
- runbooks/remediation/__init__.py +2 -2
- runbooks/remediation/acm_remediation.py +1 -1
- runbooks/remediation/base.py +1 -1
- runbooks/remediation/cloudtrail_remediation.py +1 -1
- runbooks/remediation/cognito_remediation.py +1 -1
- runbooks/remediation/commons.py +8 -4
- runbooks/remediation/dynamodb_remediation.py +1 -1
- runbooks/remediation/ec2_remediation.py +1 -1
- runbooks/remediation/ec2_unattached_ebs_volumes.py +1 -1
- runbooks/remediation/kms_enable_key_rotation.py +1 -1
- runbooks/remediation/kms_remediation.py +1 -1
- runbooks/remediation/lambda_remediation.py +1 -1
- runbooks/remediation/multi_account.py +1 -1
- runbooks/remediation/rds_remediation.py +1 -1
- runbooks/remediation/s3_block_public_access.py +1 -1
- runbooks/remediation/s3_enable_access_logging.py +1 -1
- runbooks/remediation/s3_encryption.py +1 -1
- runbooks/remediation/s3_remediation.py +1 -1
- runbooks/remediation/vpc_remediation.py +475 -0
- runbooks/security/ENTERPRISE_SECURITY_FRAMEWORK.md +506 -0
- runbooks/security/README.md +12 -1
- runbooks/security/__init__.py +166 -33
- runbooks/security/compliance_automation.py +634 -0
- runbooks/security/compliance_automation_engine.py +1021 -0
- runbooks/security/enterprise_security_framework.py +931 -0
- runbooks/security/enterprise_security_policies.json +293 -0
- runbooks/security/integration_test_enterprise_security.py +879 -0
- runbooks/security/module_security_integrator.py +641 -0
- runbooks/security/report_generator.py +10 -0
- runbooks/security/run_script.py +27 -5
- runbooks/security/security_baseline_tester.py +153 -27
- runbooks/security/security_export.py +456 -0
- runbooks/sre/README.md +472 -0
- runbooks/sre/__init__.py +33 -0
- runbooks/sre/mcp_reliability_engine.py +1049 -0
- runbooks/sre/performance_optimization_engine.py +1032 -0
- runbooks/sre/reliability_monitoring_framework.py +1011 -0
- runbooks/validation/__init__.py +10 -0
- runbooks/validation/benchmark.py +489 -0
- runbooks/validation/cli.py +368 -0
- runbooks/validation/mcp_validator.py +797 -0
- runbooks/vpc/README.md +478 -0
- runbooks/vpc/__init__.py +38 -0
- runbooks/vpc/config.py +212 -0
- runbooks/vpc/cost_engine.py +347 -0
- runbooks/vpc/heatmap_engine.py +605 -0
- runbooks/vpc/manager_interface.py +649 -0
- runbooks/vpc/networking_wrapper.py +1289 -0
- runbooks/vpc/rich_formatters.py +693 -0
- runbooks/vpc/tests/__init__.py +5 -0
- runbooks/vpc/tests/conftest.py +356 -0
- runbooks/vpc/tests/test_cli_integration.py +530 -0
- runbooks/vpc/tests/test_config.py +458 -0
- runbooks/vpc/tests/test_cost_engine.py +479 -0
- runbooks/vpc/tests/test_networking_wrapper.py +512 -0
- {runbooks-0.7.7.dist-info → runbooks-0.9.0.dist-info}/METADATA +175 -65
- {runbooks-0.7.7.dist-info → runbooks-0.9.0.dist-info}/RECORD +157 -60
- {runbooks-0.7.7.dist-info → runbooks-0.9.0.dist-info}/entry_points.txt +1 -1
- {runbooks-0.7.7.dist-info → runbooks-0.9.0.dist-info}/WHEEL +0 -0
- {runbooks-0.7.7.dist-info → runbooks-0.9.0.dist-info}/licenses/LICENSE +0 -0
- {runbooks-0.7.7.dist-info → runbooks-0.9.0.dist-info}/top_level.txt +0 -0
@@ -373,9 +373,17 @@ if __name__ == "__main__":
|
|
373
373
|
logging.getLogger("s3transfer").setLevel(logging.CRITICAL)
|
374
374
|
logging.getLogger("urllib3").setLevel(logging.CRITICAL)
|
375
375
|
|
376
|
-
|
377
|
-
|
378
|
-
|
376
|
+
# Import Rich display utilities for professional output
|
377
|
+
from runbooks.inventory.rich_inventory_display import (
|
378
|
+
create_inventory_progress,
|
379
|
+
display_ec2_inventory_results,
|
380
|
+
display_inventory_header,
|
381
|
+
)
|
382
|
+
|
383
|
+
# Display professional inventory header
|
384
|
+
display_inventory_header(
|
385
|
+
"EC2", pProfiles, AccountNum if "AccountNum" in locals() else 0, RegionNum if "RegionNum" in locals() else 0
|
386
|
+
)
|
379
387
|
|
380
388
|
# Find credentials for all Child Accounts
|
381
389
|
# CredentialList = get_credentials(pProfiles, pRegionList, pSkipProfiles, pSkipAccounts, pRootOnly, pAccounts, pAccessRoles, pTiming)
|
@@ -384,16 +392,15 @@ if __name__ == "__main__":
|
|
384
392
|
)
|
385
393
|
AccountNum = len(set([acct["AccountId"] for acct in CredentialList]))
|
386
394
|
RegionNum = len(set([acct["Region"] for acct in CredentialList]))
|
387
|
-
|
388
|
-
|
395
|
+
|
396
|
+
# Update header with actual counts
|
397
|
+
display_inventory_header("EC2", pProfiles, AccountNum, RegionNum)
|
398
|
+
|
389
399
|
if pTiming:
|
390
|
-
print()
|
391
400
|
milestone_time1 = time()
|
392
|
-
|
393
|
-
|
394
|
-
)
|
395
|
-
print()
|
396
|
-
print(f"Now running through all accounts and regions identified to find resources...")
|
401
|
+
from runbooks.common.rich_utils import print_info
|
402
|
+
|
403
|
+
print_info(f"⏱️ Credential discovery completed in {(milestone_time1 - begin_time):.3f} seconds")
|
397
404
|
# Collect all the instances from the credentials found
|
398
405
|
AllInstances = find_all_instances(CredentialList, pStatus)
|
399
406
|
# Display the information we've found thus far
|
@@ -414,12 +421,6 @@ if __name__ == "__main__":
|
|
414
421
|
)
|
415
422
|
display_results(sorted_all_instances, display_dict, None, pFilename)
|
416
423
|
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
print(ERASE_LINE)
|
421
|
-
|
422
|
-
print(f"Found {len(AllInstances)} instances across {AccountNum} accounts across {RegionNum} regions")
|
423
|
-
print()
|
424
|
-
print("Thank you for using this script")
|
425
|
-
print()
|
424
|
+
# Display results using Rich formatting
|
425
|
+
timing_info = {"total_time": time() - begin_time} if pTiming else None
|
426
|
+
display_ec2_inventory_results(AllInstances, AccountNum, RegionNum, timing_info)
|
@@ -212,8 +212,23 @@ def find_ssm_parameters(f_credentialList):
|
|
212
212
|
- Logs authorization issues for security team follow-up
|
213
213
|
"""
|
214
214
|
parameter_list = []
|
215
|
-
|
216
|
-
|
215
|
+
# Import Rich display utilities for professional output
|
216
|
+
from runbooks.common.rich_utils import console, print_info, print_success
|
217
|
+
from runbooks.inventory.rich_inventory_display import create_inventory_progress, display_inventory_header
|
218
|
+
|
219
|
+
# Calculate operation scope
|
220
|
+
account_count = len(set([cred["AccountId"] for cred in f_credentialList]))
|
221
|
+
region_count = len(set([cred["Region"] for cred in f_credentialList]))
|
222
|
+
|
223
|
+
# Display professional header
|
224
|
+
display_inventory_header("SSM Parameters", "multi-profile", account_count, region_count)
|
225
|
+
|
226
|
+
# Create Rich progress bar
|
227
|
+
progress = create_inventory_progress(len(f_credentialList), "🔑 Discovering SSM Parameters")
|
228
|
+
task = progress.add_task("Processing credentials", total=len(f_credentialList))
|
229
|
+
progress.start()
|
230
|
+
|
231
|
+
for credential in f_credentialList:
|
217
232
|
try:
|
218
233
|
# Call SSM API to discover all parameters in this account/region combination
|
219
234
|
# Note: Parameter stores can contain 10,000+ parameters - this operation may take time
|
@@ -228,6 +243,15 @@ def find_ssm_parameters(f_credentialList):
|
|
228
243
|
logging.error(
|
229
244
|
f"Profile {credential['Profile']}: Authorization Failure for account {credential['AccountNumber']}"
|
230
245
|
)
|
246
|
+
finally:
|
247
|
+
# Update progress
|
248
|
+
progress.update(task, advance=1)
|
249
|
+
|
250
|
+
progress.stop()
|
251
|
+
|
252
|
+
# Display completion summary
|
253
|
+
print_success(f"✅ SSM Parameter discovery completed! Found {len(parameter_list)} parameters total")
|
254
|
+
|
231
255
|
return parameter_list
|
232
256
|
|
233
257
|
|
@@ -271,7 +295,11 @@ if __name__ == "__main__":
|
|
271
295
|
# Define AWS Landing Zone (ALZ) parameter pattern for UUID-based identification
|
272
296
|
# Pattern matches: /UUID/numeric-suffix (e.g., /2ac07efd-153d-4069-b7ad-0d18cc398b11/105)
|
273
297
|
ALZRegex = r"/\w{8,8}-\w{4,4}-\w{4,4}-\w{4,4}-\w{12,12}/\w{3,3}"
|
274
|
-
|
298
|
+
# Import Rich utilities at module level
|
299
|
+
from runbooks.common.rich_utils import console, print_header
|
300
|
+
|
301
|
+
# Display module header
|
302
|
+
print_header("SSM Parameter Store Discovery", "0.7.8")
|
275
303
|
|
276
304
|
# Execute enterprise credential discovery across organizational hierarchy
|
277
305
|
CredentialList = get_all_credentials(
|