runbooks 0.7.9__py3-none-any.whl → 0.9.1__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.
Files changed (122) hide show
  1. runbooks/__init__.py +1 -1
  2. runbooks/cfat/README.md +12 -1
  3. runbooks/cfat/__init__.py +1 -1
  4. runbooks/cfat/assessment/compliance.py +4 -1
  5. runbooks/cfat/assessment/runner.py +42 -34
  6. runbooks/cfat/models.py +1 -1
  7. runbooks/cloudops/__init__.py +123 -0
  8. runbooks/cloudops/base.py +385 -0
  9. runbooks/cloudops/cost_optimizer.py +811 -0
  10. runbooks/cloudops/infrastructure_optimizer.py +29 -0
  11. runbooks/cloudops/interfaces.py +828 -0
  12. runbooks/cloudops/lifecycle_manager.py +29 -0
  13. runbooks/cloudops/mcp_cost_validation.py +678 -0
  14. runbooks/cloudops/models.py +251 -0
  15. runbooks/cloudops/monitoring_automation.py +29 -0
  16. runbooks/cloudops/notebook_framework.py +676 -0
  17. runbooks/cloudops/security_enforcer.py +449 -0
  18. runbooks/common/__init__.py +152 -0
  19. runbooks/common/accuracy_validator.py +1039 -0
  20. runbooks/common/context_logger.py +440 -0
  21. runbooks/common/cross_module_integration.py +594 -0
  22. runbooks/common/enhanced_exception_handler.py +1108 -0
  23. runbooks/common/enterprise_audit_integration.py +634 -0
  24. runbooks/common/mcp_cost_explorer_integration.py +900 -0
  25. runbooks/common/mcp_integration.py +548 -0
  26. runbooks/common/performance_monitor.py +387 -0
  27. runbooks/common/profile_utils.py +216 -0
  28. runbooks/common/rich_utils.py +172 -1
  29. runbooks/feedback/user_feedback_collector.py +440 -0
  30. runbooks/finops/README.md +377 -458
  31. runbooks/finops/__init__.py +4 -21
  32. runbooks/finops/account_resolver.py +279 -0
  33. runbooks/finops/accuracy_cross_validator.py +638 -0
  34. runbooks/finops/aws_client.py +721 -36
  35. runbooks/finops/budget_integration.py +313 -0
  36. runbooks/finops/cli.py +59 -5
  37. runbooks/finops/cost_optimizer.py +1340 -0
  38. runbooks/finops/cost_processor.py +211 -37
  39. runbooks/finops/dashboard_router.py +900 -0
  40. runbooks/finops/dashboard_runner.py +990 -232
  41. runbooks/finops/embedded_mcp_validator.py +288 -0
  42. runbooks/finops/enhanced_dashboard_runner.py +8 -7
  43. runbooks/finops/enhanced_progress.py +327 -0
  44. runbooks/finops/enhanced_trend_visualization.py +423 -0
  45. runbooks/finops/finops_dashboard.py +184 -1829
  46. runbooks/finops/helpers.py +509 -196
  47. runbooks/finops/iam_guidance.py +400 -0
  48. runbooks/finops/markdown_exporter.py +466 -0
  49. runbooks/finops/multi_dashboard.py +1502 -0
  50. runbooks/finops/optimizer.py +15 -15
  51. runbooks/finops/profile_processor.py +2 -2
  52. runbooks/finops/runbooks.inventory.organizations_discovery.log +0 -0
  53. runbooks/finops/runbooks.security.report_generator.log +0 -0
  54. runbooks/finops/runbooks.security.run_script.log +0 -0
  55. runbooks/finops/runbooks.security.security_export.log +0 -0
  56. runbooks/finops/schemas.py +589 -0
  57. runbooks/finops/service_mapping.py +195 -0
  58. runbooks/finops/single_dashboard.py +710 -0
  59. runbooks/finops/tests/test_reference_images_validation.py +1 -1
  60. runbooks/inventory/README.md +12 -1
  61. runbooks/inventory/core/collector.py +157 -29
  62. runbooks/inventory/list_ec2_instances.py +9 -6
  63. runbooks/inventory/list_ssm_parameters.py +10 -10
  64. runbooks/inventory/organizations_discovery.py +210 -164
  65. runbooks/inventory/rich_inventory_display.py +74 -107
  66. runbooks/inventory/run_on_multi_accounts.py +13 -13
  67. runbooks/inventory/runbooks.inventory.organizations_discovery.log +0 -0
  68. runbooks/inventory/runbooks.security.security_export.log +0 -0
  69. runbooks/main.py +1371 -240
  70. runbooks/metrics/dora_metrics_engine.py +711 -17
  71. runbooks/monitoring/performance_monitor.py +433 -0
  72. runbooks/operate/README.md +394 -0
  73. runbooks/operate/base.py +215 -47
  74. runbooks/operate/ec2_operations.py +435 -5
  75. runbooks/operate/iam_operations.py +598 -3
  76. runbooks/operate/privatelink_operations.py +1 -1
  77. runbooks/operate/rds_operations.py +508 -0
  78. runbooks/operate/s3_operations.py +508 -0
  79. runbooks/operate/vpc_endpoints.py +1 -1
  80. runbooks/remediation/README.md +489 -13
  81. runbooks/remediation/base.py +5 -3
  82. runbooks/remediation/commons.py +8 -4
  83. runbooks/security/ENTERPRISE_SECURITY_FRAMEWORK.md +506 -0
  84. runbooks/security/README.md +12 -1
  85. runbooks/security/__init__.py +265 -33
  86. runbooks/security/cloudops_automation_security_validator.py +1164 -0
  87. runbooks/security/compliance_automation.py +12 -10
  88. runbooks/security/compliance_automation_engine.py +1021 -0
  89. runbooks/security/enterprise_security_framework.py +930 -0
  90. runbooks/security/enterprise_security_policies.json +293 -0
  91. runbooks/security/executive_security_dashboard.py +1247 -0
  92. runbooks/security/integration_test_enterprise_security.py +879 -0
  93. runbooks/security/module_security_integrator.py +641 -0
  94. runbooks/security/multi_account_security_controls.py +2254 -0
  95. runbooks/security/real_time_security_monitor.py +1196 -0
  96. runbooks/security/report_generator.py +1 -1
  97. runbooks/security/run_script.py +4 -8
  98. runbooks/security/security_baseline_tester.py +39 -52
  99. runbooks/security/security_export.py +99 -120
  100. runbooks/sre/README.md +472 -0
  101. runbooks/sre/__init__.py +33 -0
  102. runbooks/sre/mcp_reliability_engine.py +1049 -0
  103. runbooks/sre/performance_optimization_engine.py +1032 -0
  104. runbooks/sre/production_monitoring_framework.py +584 -0
  105. runbooks/sre/reliability_monitoring_framework.py +1011 -0
  106. runbooks/validation/__init__.py +2 -2
  107. runbooks/validation/benchmark.py +154 -149
  108. runbooks/validation/cli.py +159 -147
  109. runbooks/validation/mcp_validator.py +291 -248
  110. runbooks/vpc/README.md +478 -0
  111. runbooks/vpc/__init__.py +2 -2
  112. runbooks/vpc/manager_interface.py +366 -351
  113. runbooks/vpc/networking_wrapper.py +68 -36
  114. runbooks/vpc/rich_formatters.py +22 -8
  115. runbooks-0.9.1.dist-info/METADATA +308 -0
  116. {runbooks-0.7.9.dist-info → runbooks-0.9.1.dist-info}/RECORD +120 -59
  117. {runbooks-0.7.9.dist-info → runbooks-0.9.1.dist-info}/entry_points.txt +1 -1
  118. runbooks/finops/cross_validation.py +0 -375
  119. runbooks-0.7.9.dist-info/METADATA +0 -636
  120. {runbooks-0.7.9.dist-info → runbooks-0.9.1.dist-info}/WHEEL +0 -0
  121. {runbooks-0.7.9.dist-info → runbooks-0.9.1.dist-info}/licenses/LICENSE +0 -0
  122. {runbooks-0.7.9.dist-info → runbooks-0.9.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,195 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ AWS Service Name Mapping and Standardization
4
+ Provides comprehensive mapping of AWS service names to standardized abbreviations
5
+ for space-efficient display in FinOps dashboards and reports.
6
+ """
7
+
8
+ from typing import Dict
9
+
10
+ # Comprehensive AWS Service Name Mapping Dictionary
11
+ # Maps full AWS service names to standardized short names for display
12
+ AWS_SERVICE_MAPPING: Dict[str, str] = {
13
+ # Compute Services
14
+ "Amazon Elastic Compute Cloud - Compute": "EC2",
15
+ "EC2 - Other": "EC2-Other",
16
+ "AWS Lambda": "Lambda",
17
+ "Amazon Elastic Container Service": "ECS",
18
+ "Amazon Elastic Kubernetes Service": "EKS",
19
+ "AWS Batch": "Batch",
20
+ "AWS Fargate": "Fargate",
21
+ # Storage Services
22
+ "Amazon Simple Storage Service": "S3",
23
+ "Amazon Elastic Block Store": "EBS",
24
+ "Amazon Elastic File System": "EFS",
25
+ "AWS Storage Gateway": "Storage-GW",
26
+ "Amazon FSx": "FSx",
27
+ # Database Services
28
+ "Amazon Relational Database Service": "RDS",
29
+ "Amazon DynamoDB": "DynamoDB",
30
+ "Amazon Redshift": "Redshift",
31
+ "Amazon ElastiCache": "ElastiCache",
32
+ "Amazon DocumentDB": "DocumentDB",
33
+ "Amazon Neptune": "Neptune",
34
+ "Amazon Timestream": "Timestream",
35
+ # Networking Services
36
+ "Amazon Virtual Private Cloud": "VPC",
37
+ "Amazon CloudFront": "CloudFront",
38
+ "Amazon Route 53": "Route53",
39
+ "AWS Direct Connect": "DirectConnect",
40
+ "Elastic Load Balancing": "ELB",
41
+ "Amazon API Gateway": "API-Gateway",
42
+ "AWS Transit Gateway": "Transit-GW",
43
+ # Monitoring & Management
44
+ "AmazonCloudWatch": "CloudWatch",
45
+ "AWS CloudTrail": "CloudTrail",
46
+ "AWS Config": "Config",
47
+ "AWS Systems Manager": "SSM",
48
+ "AWS X-Ray": "X-Ray",
49
+ "Amazon Inspector": "Inspector",
50
+ # Security Services
51
+ "AWS Identity and Access Management": "IAM",
52
+ "AWS Certificate Manager": "ACM",
53
+ "AWS Key Management Service": "KMS",
54
+ "AWS Secrets Manager": "Secrets-Mgr",
55
+ "Amazon Cognito": "Cognito",
56
+ "AWS Security Hub": "Security-Hub",
57
+ "Amazon GuardDuty": "GuardDuty",
58
+ # Analytics Services
59
+ "AWS Glue": "Glue",
60
+ "Amazon Kinesis": "Kinesis",
61
+ "Amazon EMR": "EMR",
62
+ "Amazon Athena": "Athena",
63
+ "Amazon QuickSight": "QuickSight",
64
+ "AWS Data Pipeline": "Data-Pipeline",
65
+ # Application Integration
66
+ "Amazon Simple Queue Service": "SQS",
67
+ "Amazon Simple Notification Service": "SNS",
68
+ "Amazon EventBridge": "EventBridge",
69
+ "AWS Step Functions": "Step-Functions",
70
+ "Amazon MQ": "MQ",
71
+ # Developer Tools
72
+ "AWS CodeCommit": "CodeCommit",
73
+ "AWS CodeBuild": "CodeBuild",
74
+ "AWS CodeDeploy": "CodeDeploy",
75
+ "AWS CodePipeline": "CodePipeline",
76
+ "AWS CodeStar": "CodeStar",
77
+ # Business Applications
78
+ "Amazon WorkSpaces": "WorkSpaces",
79
+ "Amazon AppStream 2.0": "AppStream",
80
+ "Amazon Connect": "Connect",
81
+ "Amazon Chime": "Chime",
82
+ # Cost Management
83
+ "AWS Cost Explorer": "Cost-Explorer",
84
+ "AWS Budgets": "Budgets",
85
+ "Savings Plans for AWS Compute usage": "Savings-Plans",
86
+ # Support & Billing
87
+ "AWS Support (Business)": "Support",
88
+ "AWS Support (Enterprise)": "Support-Ent",
89
+ "AWS Payment Cryptography": "Payment-Crypto",
90
+ # Special Cases and Variations
91
+ "Simple Storage Service": "S3",
92
+ "Virtual Private Cloud": "VPC",
93
+ "Elastic Compute Cloud": "EC2",
94
+ "Simple Queue Service": "SQS",
95
+ "Simple Notification Service": "SNS",
96
+ "Key Management Service": "KMS",
97
+ "Identity and Access Management": "IAM",
98
+ # Directory Services
99
+ "AWS Directory Service": "Directory",
100
+ "AWS Managed Microsoft AD": "Managed-AD",
101
+ # Machine Learning
102
+ "Amazon SageMaker": "SageMaker",
103
+ "Amazon Rekognition": "Rekognition",
104
+ "Amazon Comprehend": "Comprehend",
105
+ "Amazon Translate": "Translate",
106
+ # IoT Services
107
+ "AWS IoT Core": "IoT-Core",
108
+ "AWS IoT Device Management": "IoT-Device",
109
+ "AWS IoT Analytics": "IoT-Analytics",
110
+ # Transfer Services
111
+ "AWS Transfer Family": "Transfer",
112
+ "AWS DataSync": "DataSync",
113
+ "AWS Snow Family": "Snow",
114
+ # Contact Center
115
+ "Contact Center Telecommunications": "Contact-Center",
116
+ "Contact Lens for Amazon Connect": "Contact-Lens",
117
+ # WAF & Shield
118
+ "AWS WAF": "WAF",
119
+ "AWS Shield": "Shield",
120
+ # Email
121
+ "Amazon Simple Email Service": "SES",
122
+ # Tax
123
+ "Tax": "Tax", # Usually filtered out, but included for completeness
124
+ }
125
+
126
+
127
+ def get_service_display_name(service_name: str) -> str:
128
+ """
129
+ Get standardized display name for AWS service.
130
+
131
+ Args:
132
+ service_name: Full AWS service name
133
+
134
+ Returns:
135
+ Standardized short name for display
136
+ """
137
+ # Direct mapping lookup
138
+ if service_name in AWS_SERVICE_MAPPING:
139
+ return AWS_SERVICE_MAPPING[service_name]
140
+
141
+ # Fallback: Clean up common patterns
142
+ cleaned = service_name
143
+
144
+ # Remove common AWS prefixes
145
+ cleaned = cleaned.replace("Amazon ", "").replace("AWS ", "")
146
+
147
+ # Remove common suffixes
148
+ cleaned = cleaned.replace(" Service", "").replace(" (Business)", "")
149
+
150
+ # Handle long names by truncating intelligently
151
+ if len(cleaned) > 15:
152
+ # Try to get meaningful abbreviation
153
+ words = cleaned.split()
154
+ if len(words) > 1:
155
+ # Take first letter of each word for abbreviation
156
+ cleaned = "".join(word[0].upper() for word in words if word)
157
+ # If still too long, take first 12 characters
158
+ if len(cleaned) > 12:
159
+ cleaned = cleaned[:12]
160
+ else:
161
+ # Single long word, truncate with ellipsis
162
+ cleaned = cleaned[:12] + ("..." if len(cleaned) > 12 else "")
163
+
164
+ return cleaned
165
+
166
+
167
+ def get_top_services_display(services_dict: Dict[str, float], limit: int = 3) -> str:
168
+ """
169
+ Format top services for display with standardized names.
170
+
171
+ Args:
172
+ services_dict: Dictionary of service names to costs
173
+ limit: Number of top services to display
174
+
175
+ Returns:
176
+ Formatted string for display
177
+ """
178
+ if not services_dict:
179
+ return "[dim]None[/]"
180
+
181
+ # Sort by cost and take top services
182
+ sorted_services = sorted(services_dict.items(), key=lambda x: x[1], reverse=True)
183
+ top_services = sorted_services[:limit]
184
+
185
+ # Format for display
186
+ services_text = []
187
+ for service, cost in top_services:
188
+ display_name = get_service_display_name(service)
189
+ services_text.append(f"{display_name}: ${cost:.0f}")
190
+
191
+ return "\n".join(services_text)
192
+
193
+
194
+ # Export for other modules
195
+ __all__ = ["AWS_SERVICE_MAPPING", "get_service_display_name", "get_top_services_display"]