runbooks 0.9.8__py3-none-any.whl → 1.0.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/cfat/cloud_foundations_assessment.py +626 -0
- runbooks/cloudops/cost_optimizer.py +95 -33
- runbooks/common/aws_pricing.py +388 -0
- runbooks/common/aws_pricing_api.py +205 -0
- runbooks/common/aws_utils.py +2 -2
- runbooks/common/comprehensive_cost_explorer_integration.py +979 -0
- runbooks/common/cross_account_manager.py +606 -0
- runbooks/common/enhanced_exception_handler.py +4 -0
- runbooks/common/env_utils.py +96 -0
- runbooks/common/mcp_integration.py +49 -2
- runbooks/common/organizations_client.py +579 -0
- runbooks/common/profile_utils.py +96 -2
- runbooks/common/rich_utils.py +3 -0
- runbooks/finops/cost_optimizer.py +2 -1
- runbooks/finops/elastic_ip_optimizer.py +13 -9
- runbooks/finops/embedded_mcp_validator.py +31 -0
- runbooks/finops/enhanced_trend_visualization.py +3 -2
- runbooks/finops/markdown_exporter.py +441 -0
- runbooks/finops/nat_gateway_optimizer.py +57 -20
- runbooks/finops/optimizer.py +2 -0
- runbooks/finops/single_dashboard.py +2 -2
- runbooks/finops/vpc_cleanup_exporter.py +330 -0
- runbooks/finops/vpc_cleanup_optimizer.py +895 -40
- runbooks/inventory/__init__.py +10 -1
- runbooks/inventory/cloud_foundations_integration.py +409 -0
- runbooks/inventory/core/collector.py +1148 -88
- runbooks/inventory/discovery.md +389 -0
- runbooks/inventory/drift_detection_cli.py +327 -0
- runbooks/inventory/inventory_mcp_cli.py +171 -0
- runbooks/inventory/inventory_modules.py +4 -7
- runbooks/inventory/mcp_inventory_validator.py +2149 -0
- runbooks/inventory/mcp_vpc_validator.py +23 -6
- runbooks/inventory/organizations_discovery.py +91 -1
- runbooks/inventory/rich_inventory_display.py +129 -1
- runbooks/inventory/unified_validation_engine.py +1292 -0
- runbooks/inventory/verify_ec2_security_groups.py +3 -1
- runbooks/inventory/vpc_analyzer.py +825 -7
- runbooks/inventory/vpc_flow_analyzer.py +36 -42
- runbooks/main.py +969 -42
- runbooks/monitoring/performance_monitor.py +11 -7
- runbooks/operate/dynamodb_operations.py +6 -5
- runbooks/operate/ec2_operations.py +3 -2
- runbooks/operate/networking_cost_heatmap.py +4 -3
- runbooks/operate/s3_operations.py +13 -12
- runbooks/operate/vpc_operations.py +50 -2
- runbooks/remediation/base.py +1 -1
- runbooks/remediation/commvault_ec2_analysis.py +6 -1
- runbooks/remediation/ec2_unattached_ebs_volumes.py +6 -3
- runbooks/remediation/rds_snapshot_list.py +5 -3
- runbooks/validation/__init__.py +21 -1
- runbooks/validation/comprehensive_2way_validator.py +1996 -0
- runbooks/validation/mcp_validator.py +904 -94
- runbooks/validation/terraform_citations_validator.py +363 -0
- runbooks/validation/terraform_drift_detector.py +1098 -0
- runbooks/vpc/cleanup_wrapper.py +231 -10
- runbooks/vpc/config.py +310 -62
- runbooks/vpc/cross_account_session.py +308 -0
- runbooks/vpc/heatmap_engine.py +96 -29
- runbooks/vpc/manager_interface.py +9 -9
- runbooks/vpc/mcp_no_eni_validator.py +1551 -0
- runbooks/vpc/networking_wrapper.py +14 -8
- runbooks/vpc/runbooks.inventory.organizations_discovery.log +0 -0
- runbooks/vpc/runbooks.security.report_generator.log +0 -0
- runbooks/vpc/runbooks.security.run_script.log +0 -0
- runbooks/vpc/runbooks.security.security_export.log +0 -0
- runbooks/vpc/tests/test_cost_engine.py +1 -1
- runbooks/vpc/unified_scenarios.py +3269 -0
- runbooks/vpc/vpc_cleanup_integration.py +516 -82
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/METADATA +94 -52
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/RECORD +75 -51
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/WHEEL +0 -0
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/entry_points.txt +0 -0
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {runbooks-0.9.8.dist-info → runbooks-1.0.0.dist-info}/top_level.txt +0 -0
@@ -460,13 +460,14 @@ class VPCFlowAnalyzer(BaseInventory):
|
|
460
460
|
|
461
461
|
def _simulate_flow_log_analysis(self, flow_log: Dict[str, Any], time_range_hours: int) -> Dict[str, Any]:
|
462
462
|
"""Simulate flow log analysis with realistic data patterns."""
|
463
|
-
import random
|
463
|
+
# REMOVED: import random (violates enterprise standards)
|
464
464
|
|
465
465
|
flow_log_id = flow_log["FlowLogId"]
|
466
466
|
resource_id = flow_log.get("ResourceId", "unknown")
|
467
467
|
|
468
|
-
#
|
469
|
-
|
468
|
+
# REMOVED: Random traffic simulation violates enterprise standards
|
469
|
+
# Use real VPC Flow Log data from CloudWatch Logs or S3
|
470
|
+
base_traffic = 5000 * time_range_hours # Deterministic baseline
|
470
471
|
|
471
472
|
analysis = {
|
472
473
|
"flow_log_id": flow_log_id,
|
@@ -474,46 +475,38 @@ class VPCFlowAnalyzer(BaseInventory):
|
|
474
475
|
"destination_type": "cloudwatch-logs",
|
475
476
|
"log_format": flow_log.get("LogFormat", "${version} ${account-id} ${interface-id} ${srcaddr} ${dstaddr}"),
|
476
477
|
"traffic_summary": {
|
477
|
-
|
478
|
-
"
|
479
|
-
"
|
480
|
-
"
|
481
|
-
"
|
478
|
+
# TODO: Parse actual VPC Flow Log data from CloudWatch/S3
|
479
|
+
"total_bytes": 0, # Replace with real flow log parsing
|
480
|
+
"total_packets": 0, # Replace with real flow log parsing
|
481
|
+
"unique_connections": 0, # Replace with real connection analysis
|
482
|
+
"accepted_connections": 0, # Replace with real ACCEPT record count
|
483
|
+
"rejected_connections": 0, # Replace with real REJECT record count
|
482
484
|
},
|
483
485
|
"top_talkers": {
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
"bytes": random.randint(100000, 1000000),
|
489
|
-
"az_pair": f"us-east-1{chr(ord('a') + random.randint(0, 2))}-to-us-east-1{chr(ord('a') + random.randint(0, 2))}",
|
490
|
-
}
|
491
|
-
for _ in range(5)
|
492
|
-
],
|
493
|
-
"by_packets": [],
|
494
|
-
"by_connections": [],
|
486
|
+
# TODO: Parse actual flow log data for top traffic sources/destinations
|
487
|
+
"by_bytes": [], # Replace with real flow log analysis
|
488
|
+
"by_packets": [], # Replace with real packet analysis
|
489
|
+
"by_connections": [], # Replace with real connection analysis
|
495
490
|
},
|
496
491
|
"protocol_distribution": {
|
497
|
-
|
498
|
-
"
|
499
|
-
"
|
500
|
-
"
|
492
|
+
# TODO: Parse actual protocol distribution from flow logs
|
493
|
+
"TCP": 0, # Replace with real TCP traffic percentage
|
494
|
+
"UDP": 0, # Replace with real UDP traffic percentage
|
495
|
+
"ICMP": 0, # Replace with real ICMP traffic percentage
|
496
|
+
"Other": 0, # Replace with real other protocol percentage
|
501
497
|
},
|
502
498
|
"port_analysis": {
|
503
499
|
"top_destination_ports": {
|
504
|
-
|
505
|
-
|
506
|
-
"22": random.randint(5, 15),
|
507
|
-
"3306": random.randint(5, 20),
|
508
|
-
"5432": random.randint(3, 15),
|
500
|
+
# TODO: Parse actual port usage from flow logs
|
501
|
+
# Replace with real port traffic analysis
|
509
502
|
}
|
510
503
|
},
|
511
504
|
"cross_az_traffic": {
|
512
|
-
|
505
|
+
# TODO: Calculate actual cross-AZ traffic from flow logs
|
506
|
+
"total_cross_az_bytes": 0, # Replace with real cross-AZ traffic calculation
|
513
507
|
"az_pairs": {
|
514
|
-
|
515
|
-
|
516
|
-
"us-east-1a-to-us-east-1c": random.randint(50000, 300000),
|
508
|
+
# TODO: Parse actual AZ-to-AZ traffic patterns from flow logs
|
509
|
+
# Replace with real availability zone traffic analysis
|
517
510
|
},
|
518
511
|
},
|
519
512
|
"errors": [],
|
@@ -614,22 +607,23 @@ class VPCFlowAnalyzer(BaseInventory):
|
|
614
607
|
for i, source_az in enumerate(azs):
|
615
608
|
for j, dest_az in enumerate(azs):
|
616
609
|
if i != j: # Cross-AZ traffic
|
617
|
-
#
|
618
|
-
|
619
|
-
|
620
|
-
traffic_bytes =
|
610
|
+
# REMOVED: Random traffic simulation violates enterprise standards
|
611
|
+
# TODO: Calculate actual cross-AZ traffic from VPC Flow Logs
|
612
|
+
|
613
|
+
traffic_bytes = 500000 * time_range_hours # Deterministic baseline
|
621
614
|
az_pair = f"{source_az}-to-{dest_az}"
|
622
615
|
|
623
616
|
cross_az_patterns[az_pair] = {
|
624
617
|
"source_az": source_az,
|
625
618
|
"destination_az": dest_az,
|
626
|
-
"bytes_transferred":
|
627
|
-
"gb_transferred":
|
628
|
-
"connection_count":
|
619
|
+
"bytes_transferred": 0, # Replace with real flow log data
|
620
|
+
"gb_transferred": 0, # Replace with real traffic calculation
|
621
|
+
"connection_count": 0, # Replace with real connection count
|
629
622
|
"top_protocols": {
|
630
|
-
|
631
|
-
"
|
632
|
-
"
|
623
|
+
# TODO: Parse actual protocol distribution from flow logs
|
624
|
+
"TCP": 0, # Replace with real TCP percentage
|
625
|
+
"UDP": 0, # Replace with real UDP percentage
|
626
|
+
"Other": 0, # Replace with real other protocol percentage
|
633
627
|
},
|
634
628
|
}
|
635
629
|
|