runbooks 0.6.1__py3-none-any.whl → 0.7.5__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 (142) hide show
  1. jupyter-agent/.env +2 -0
  2. jupyter-agent/.gradio/certificate.pem +31 -0
  3. jupyter-agent/__main__.log +8 -0
  4. jupyter-agent/tmp/4ojbs8a02ir/jupyter-agent.ipynb +68 -0
  5. jupyter-agent/tmp/cm5iasgpm3p/jupyter-agent.ipynb +91 -0
  6. jupyter-agent/tmp/crqbsseag5/jupyter-agent.ipynb +91 -0
  7. jupyter-agent/tmp/hohanq1u097/jupyter-agent.ipynb +57 -0
  8. jupyter-agent/tmp/jns1sam29wm/jupyter-agent.ipynb +53 -0
  9. jupyter-agent/tmp/jupyter-agent.ipynb +27 -0
  10. runbooks/__init__.py +87 -37
  11. runbooks/cfat/README.md +300 -49
  12. runbooks/cfat/__init__.py +2 -2
  13. runbooks/finops/README.md +337 -0
  14. runbooks/finops/__init__.py +2 -4
  15. runbooks/finops/cli.py +1 -1
  16. runbooks/inventory/aws_organization.png +0 -0
  17. runbooks/inventory/collectors/__init__.py +8 -0
  18. runbooks/inventory/collectors/aws_management.py +791 -0
  19. runbooks/inventory/collectors/aws_networking.py +3 -3
  20. runbooks/main.py +3416 -590
  21. runbooks/operate/__init__.py +207 -0
  22. runbooks/operate/base.py +311 -0
  23. runbooks/operate/cloudformation_operations.py +619 -0
  24. runbooks/operate/cloudwatch_operations.py +496 -0
  25. runbooks/operate/dynamodb_operations.py +812 -0
  26. runbooks/operate/ec2_operations.py +926 -0
  27. runbooks/operate/iam_operations.py +569 -0
  28. runbooks/operate/s3_operations.py +1211 -0
  29. runbooks/operate/tagging_operations.py +655 -0
  30. runbooks/remediation/CLAUDE.md +100 -0
  31. runbooks/remediation/DOME9.md +218 -0
  32. runbooks/remediation/README.md +26 -0
  33. runbooks/remediation/Tests/update_policy.py +74 -0
  34. runbooks/remediation/__init__.py +95 -0
  35. runbooks/remediation/acm_cert_expired_unused.py +98 -0
  36. runbooks/remediation/acm_remediation.py +875 -0
  37. runbooks/remediation/api_gateway_list.py +167 -0
  38. runbooks/remediation/base.py +643 -0
  39. runbooks/remediation/cloudtrail_remediation.py +908 -0
  40. runbooks/remediation/cloudtrail_s3_modifications.py +296 -0
  41. runbooks/remediation/cognito_active_users.py +78 -0
  42. runbooks/remediation/cognito_remediation.py +856 -0
  43. runbooks/remediation/cognito_user_password_reset.py +163 -0
  44. runbooks/remediation/commons.py +455 -0
  45. runbooks/remediation/dynamodb_optimize.py +155 -0
  46. runbooks/remediation/dynamodb_remediation.py +744 -0
  47. runbooks/remediation/dynamodb_server_side_encryption.py +108 -0
  48. runbooks/remediation/ec2_public_ips.py +134 -0
  49. runbooks/remediation/ec2_remediation.py +892 -0
  50. runbooks/remediation/ec2_subnet_disable_auto_ip_assignment.py +72 -0
  51. runbooks/remediation/ec2_unattached_ebs_volumes.py +448 -0
  52. runbooks/remediation/ec2_unused_security_groups.py +202 -0
  53. runbooks/remediation/kms_enable_key_rotation.py +651 -0
  54. runbooks/remediation/kms_remediation.py +717 -0
  55. runbooks/remediation/lambda_list.py +243 -0
  56. runbooks/remediation/lambda_remediation.py +971 -0
  57. runbooks/remediation/multi_account.py +569 -0
  58. runbooks/remediation/rds_instance_list.py +199 -0
  59. runbooks/remediation/rds_remediation.py +873 -0
  60. runbooks/remediation/rds_snapshot_list.py +192 -0
  61. runbooks/remediation/requirements.txt +118 -0
  62. runbooks/remediation/s3_block_public_access.py +159 -0
  63. runbooks/remediation/s3_bucket_public_access.py +143 -0
  64. runbooks/remediation/s3_disable_static_website_hosting.py +74 -0
  65. runbooks/remediation/s3_downloader.py +215 -0
  66. runbooks/remediation/s3_enable_access_logging.py +562 -0
  67. runbooks/remediation/s3_encryption.py +526 -0
  68. runbooks/remediation/s3_force_ssl_secure_policy.py +143 -0
  69. runbooks/remediation/s3_list.py +141 -0
  70. runbooks/remediation/s3_object_search.py +201 -0
  71. runbooks/remediation/s3_remediation.py +816 -0
  72. runbooks/remediation/scan_for_phrase.py +425 -0
  73. runbooks/remediation/workspaces_list.py +220 -0
  74. runbooks/{security_baseline → security}/README.md +191 -68
  75. runbooks/security/__init__.py +70 -0
  76. runbooks/{security_baseline → security}/security_baseline_tester.py +5 -3
  77. runbooks-0.7.5.dist-info/METADATA +606 -0
  78. {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/RECORD +115 -75
  79. {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/entry_points.txt +0 -1
  80. runbooks/aws/__init__.py +0 -58
  81. runbooks/aws/dynamodb_operations.py +0 -231
  82. runbooks/aws/ec2_copy_image_cross-region.py +0 -195
  83. runbooks/aws/ec2_describe_instances.py +0 -202
  84. runbooks/aws/ec2_ebs_snapshots_delete.py +0 -186
  85. runbooks/aws/ec2_run_instances.py +0 -213
  86. runbooks/aws/ec2_start_stop_instances.py +0 -212
  87. runbooks/aws/ec2_terminate_instances.py +0 -143
  88. runbooks/aws/ec2_unused_eips.py +0 -196
  89. runbooks/aws/ec2_unused_volumes.py +0 -188
  90. runbooks/aws/s3_create_bucket.py +0 -142
  91. runbooks/aws/s3_list_buckets.py +0 -152
  92. runbooks/aws/s3_list_objects.py +0 -156
  93. runbooks/aws/s3_object_operations.py +0 -183
  94. runbooks/aws/tagging_lambda_handler.py +0 -183
  95. runbooks/inventory/cfn_move_stack_instances.py +0 -1526
  96. runbooks/inventory/delete_s3_buckets_objects.py +0 -169
  97. runbooks/inventory/lockdown_cfn_stackset_role.py +0 -224
  98. runbooks/inventory/update_aws_actions.py +0 -173
  99. runbooks/inventory/update_cfn_stacksets.py +0 -1215
  100. runbooks/inventory/update_cloudwatch_logs_retention_policy.py +0 -294
  101. runbooks/inventory/update_iam_roles_cross_accounts.py +0 -478
  102. runbooks/inventory/update_s3_public_access_block.py +0 -539
  103. runbooks/organizations/__init__.py +0 -12
  104. runbooks/organizations/manager.py +0 -374
  105. runbooks/security_baseline/requirements.txt +0 -7
  106. runbooks-0.6.1.dist-info/METADATA +0 -373
  107. /runbooks/{aws → operate}/tags.json +0 -0
  108. /runbooks/{security_baseline → remediation/Tests}/__init__.py +0 -0
  109. /runbooks/{security_baseline → security}/checklist/__init__.py +0 -0
  110. /runbooks/{security_baseline → security}/checklist/account_level_bucket_public_access.py +0 -0
  111. /runbooks/{security_baseline → security}/checklist/alternate_contacts.py +0 -0
  112. /runbooks/{security_baseline → security}/checklist/bucket_public_access.py +0 -0
  113. /runbooks/{security_baseline → security}/checklist/cloudwatch_alarm_configuration.py +0 -0
  114. /runbooks/{security_baseline → security}/checklist/direct_attached_policy.py +0 -0
  115. /runbooks/{security_baseline → security}/checklist/guardduty_enabled.py +0 -0
  116. /runbooks/{security_baseline → security}/checklist/iam_password_policy.py +0 -0
  117. /runbooks/{security_baseline → security}/checklist/iam_user_mfa.py +0 -0
  118. /runbooks/{security_baseline → security}/checklist/multi_region_instance_usage.py +0 -0
  119. /runbooks/{security_baseline → security}/checklist/multi_region_trail.py +0 -0
  120. /runbooks/{security_baseline → security}/checklist/root_access_key.py +0 -0
  121. /runbooks/{security_baseline → security}/checklist/root_mfa.py +0 -0
  122. /runbooks/{security_baseline → security}/checklist/root_usage.py +0 -0
  123. /runbooks/{security_baseline → security}/checklist/trail_enabled.py +0 -0
  124. /runbooks/{security_baseline → security}/checklist/trusted_advisor.py +0 -0
  125. /runbooks/{security_baseline → security}/config-origin.json +0 -0
  126. /runbooks/{security_baseline → security}/config.json +0 -0
  127. /runbooks/{security_baseline → security}/permission.json +0 -0
  128. /runbooks/{security_baseline → security}/report_generator.py +0 -0
  129. /runbooks/{security_baseline → security}/report_template_en.html +0 -0
  130. /runbooks/{security_baseline → security}/report_template_jp.html +0 -0
  131. /runbooks/{security_baseline → security}/report_template_kr.html +0 -0
  132. /runbooks/{security_baseline → security}/report_template_vn.html +0 -0
  133. /runbooks/{security_baseline → security}/run_script.py +0 -0
  134. /runbooks/{security_baseline → security}/utils/__init__.py +0 -0
  135. /runbooks/{security_baseline → security}/utils/common.py +0 -0
  136. /runbooks/{security_baseline → security}/utils/enums.py +0 -0
  137. /runbooks/{security_baseline → security}/utils/language.py +0 -0
  138. /runbooks/{security_baseline → security}/utils/level_const.py +0 -0
  139. /runbooks/{security_baseline → security}/utils/permission_list.py +0 -0
  140. {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/WHEEL +0 -0
  141. {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/licenses/LICENSE +0 -0
  142. {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/top_level.txt +0 -0
@@ -2,25 +2,58 @@
2
2
 
3
3
  ## 📖 Overview
4
4
 
5
- The **CloudOps Runbooks: Security Baseline Assessment** is a comprehensive tool designed to evaluate the security of AWS environments in accordance with basic security advisories. It provides a structured way to assess your account and workload configurations against **AWS security best practices** and the **AWS Startup Security Baseline (SSB)**. This tool supports **Python (via pip or Docker)** and **AWS Lambda** deployments, offering flexibility for local testing, CI/CD integration, and scalable cloud execution.
5
+ The **CloudOps Runbooks: Security Baseline Assessment** is a comprehensive tool designed to evaluate the security of AWS environments in accordance with basic security advisories. It provides a structured way to assess your account and workload configurations against **AWS security best practices** and the **AWS Startup Security Baseline (SSB)**.
6
+
7
+ **Fully integrated with the CloudOps Runbooks CLI**, this tool offers enterprise-grade security assessment capabilities with multilingual reporting, parallel execution, and comprehensive remediation guidance. The tool is designed for DevOps teams, SRE engineers, and security professionals who need automated, actionable security insights.
6
8
 
7
9
  By automating **15+ critical AWS account security and workload security checks**, this solution empowers startups, enterprises, and DevOps teams to validate their cloud security posture, generate actionable reports, and align with AWS Well-Architected principles.
8
10
 
11
+ Key capabilities include:
12
+ - **Enterprise CLI Integration**: Seamlessly integrated with `runbooks security` commands
13
+ - **Multilingual Reports**: Generate reports in English, Japanese, Korean, and Vietnamese
14
+ - **Parallel Execution**: Fast assessment with configurable worker pools
15
+ - **Rich Console Output**: Beautiful terminal output with progress indicators
16
+ - **Multiple Output Formats**: HTML reports with actionable remediation steps
17
+
9
18
  In the **Test Report**, we provide numerous techniques for successfully responding to security threats on AWS with minimal resources. This script is appropriate for usage by early-stage businesses that cannot afford to invest much in security. 
10
19
 
11
20
 
12
21
  ## ✨ Features: Core Capabilities
13
22
 
14
- 1. **Account and Workload Security Checks**:
15
- - Validates IAM configurations, S3 bucket policies, VPC security groups, and CloudTrail settings.
16
- 2. **Report Generation**:
17
- - Generates **multi-language HTML reports** (English, Korean, Japanese).
18
- 3. **Actionable Insights**:
19
- - Provides remediation steps for failed checks, mapped to AWS documentation.
20
- 4. **Flexible Deployment**:
21
- - Usable as a Python library (pip), containerized application (Docker), or AWS Lambda function.
22
- 5. **Read-Only Permissions**:
23
- - Ensures compliance with AWS's **least privilege principle** for non-intrusive diagnostics.
23
+ 1. **🚀 Enterprise CLI Integration**:
24
+ - Seamlessly integrated with `runbooks security` commands for professional workflows
25
+ - Rich console output with progress indicators and beautiful terminal formatting
26
+ - Unified CLI interface with other CloudOps tools (CFAT, inventory, organizations)
27
+
28
+ 2. **🌍 Multilingual Reporting**:
29
+ - Generate reports in **4 languages**: English, Korean, Japanese, Vietnamese
30
+ - Localized error messages and remediation guidance
31
+ - Cultural context for international DevOps teams
32
+
33
+ 3. **⚡ Performance & Scalability**:
34
+ - Parallel execution with configurable worker pools for faster assessments
35
+ - Modern dependency management with UV (Rust-based package manager)
36
+ - Optimized AWS API calls to minimize execution time
37
+
38
+ 4. **📊 Comprehensive Security Coverage**:
39
+ - **15+ critical security checks** covering account, IAM, infrastructure, and operational security
40
+ - Validates IAM configurations, S3 bucket policies, VPC security groups, and CloudTrail settings
41
+ - Aligned with AWS Security Best Practices and Well-Architected Framework
42
+
43
+ 5. **🔧 Multiple Output Formats**:
44
+ - **HTML reports** with interactive elements and remediation links
45
+ - **JSON output** for programmatic processing and CI/CD integration
46
+ - **Console output** for immediate feedback and debugging
47
+
48
+ 6. **🛡️ Enterprise Security Features**:
49
+ - Support for multiple AWS authentication methods (IAM roles, SSO, CloudShell)
50
+ - Read-only permissions ensuring compliance with **least privilege principle**
51
+ - Audit trail and logging for compliance requirements
52
+
53
+ 7. **🔄 CI/CD Integration Ready**:
54
+ - Designed for automated security scanning in pipelines
55
+ - JSON output format for integration with security dashboards
56
+ - Exit codes and structured logging for automation scripts
24
57
 
25
58
  ---
26
59
 
@@ -30,12 +63,14 @@ This modular structure ensures maintainability and supports seamless integration
30
63
 
31
64
  ```plaintext
32
65
  src/runbooks/
33
- ├── security-baseline/
66
+ ├── security/ # Integrated security module
34
67
  │ ├── checklist/ # Security check modules
35
68
  │ │ ├── iam_password_policy.py # Checks IAM password policy
36
69
  │ │ ├── bucket_public_access.py # Validates S3 bucket policies
70
+ │ │ ├── root_mfa.py # Root account MFA validation
71
+ │ │ ├── cloudtrail_enabled.py # CloudTrail configuration checks
37
72
  │ │ └── ... # More checks for IAM, S3, CloudTrail, etc.
38
- │ ├── lib/ # Core utilities and constants
73
+ │ ├── utils/ # Core utilities and constants
39
74
  │ │ ├── common.py # Shared helper functions
40
75
  │ │ ├── enums.py # Enumerations for reporting
41
76
  │ │ ├── language.py # Multi-language support
@@ -43,10 +78,14 @@ src/runbooks/
43
78
  │ ├── config.json # Configurable parameters for checks
44
79
  │ ├── permission.json # IAM policy for execution
45
80
  │ ├── report_generator.py # HTML report generator
46
- │ ├── run_script.py # Main execution script
47
- └── report_template_en.html # Report templates
48
- ├── utils/
49
- │ └── logger.py # Logging utilities
81
+ │ ├── security_baseline_tester.py # Core assessment engine
82
+ ├── run_script.py # Legacy script support
83
+ ├── __init__.py # Module exports and API
84
+ │ └── report_template_*.html # Multilingual report templates
85
+ ├── cfat/ # Cloud Foundations Assessment Tool
86
+ ├── inventory/ # Multi-account resource discovery
87
+ ├── organizations/ # AWS Organizations management
88
+ └── main.py # Central CLI entry point
50
89
  ```
51
90
 
52
91
  ---
@@ -54,59 +93,96 @@ src/runbooks/
54
93
 
55
94
  ## 🚀 Deployment and Usage
56
95
 
57
- The tool offers multiple deployment options tailored for different use cases, such as local testing, CI/CD pipelines, and cloud-native executions.
96
+ The security baseline assessment is fully integrated into the CloudOps Runbooks CLI, providing enterprise-grade security assessment capabilities with a simple, intuitive interface.
58
97
 
59
- > TBD: [Watch Video Guide](https://youtu.be/)
98
+ > **⚡ Quick Start**: `pip install runbooks && runbooks security assess`
60
99
 
61
- ### **Option 1: Run Locally with Python**
100
+ ### **Option 1: Install via PyPI (Recommended)**
62
101
 
63
- 1. **Clone the Repository**:
102
+ 1. **Install the Package**:
103
+ ```bash
104
+ pip install runbooks
105
+ ```
106
+
107
+ 2. **Run Security Assessment**:
64
108
  ```bash
65
- git clone https://github.com/nnthanh101/runbooks.git
66
- ```
67
-
68
- 2. Prerequisites: $ `task -d ~ install`
69
- ```
70
- echo "Verify the development environment: Python Virtual Environment ..."
71
- task -d ~ check-tools
72
- task -d ~ check-aws
73
- echo "Install Dependencies using uv ..."
74
- task -d ~ install
75
- ```
76
-
77
- 2. **Run the Script**:
109
+ # Basic security assessment
110
+ runbooks security assess
111
+
112
+ # Assessment with specific AWS profile and language
113
+ runbooks security assess --profile production --language EN
114
+
115
+ # Generate Korean language report
116
+ runbooks security assess --language KR --output ./security-reports
117
+ ```
118
+
119
+ 3. **List Available Security Checks**:
78
120
  ```bash
79
- python run_script.py --profile PROFILE_NAME --language EN
121
+ runbooks security list-checks
80
122
  ```
81
123
 
82
124
  ---
83
125
 
84
- ### **Option 2: Run with Docker**
126
+ ### **Option 2: Development Installation**
127
+
128
+ 1. **Clone the Repository**:
129
+ ```bash
130
+ git clone https://github.com/1xOps/CloudOps-Runbooks.git
131
+ cd CloudOps-Runbooks
132
+ ```
85
133
 
86
- 1. **Build the Docker Image**:
134
+ 2. **Install Dependencies using UV** (Rust-based package manager):
87
135
  ```bash
88
- docker build -t security-baseline-tester .
136
+ # Install UV if not already installed
137
+ curl -LsSf https://astral.sh/uv/install.sh | sh
138
+
139
+ # Install dependencies and activate environment
140
+ uv sync --all-extras
89
141
  ```
90
142
 
91
- 2. **Run the Container**:
143
+ 3. **Run Security Assessment**:
92
144
  ```bash
93
- docker run --rm -it -v ~/.aws:/root/.aws:ro security-baseline-tester --profile PROFILE_NAME --language EN
145
+ uv run python -m runbooks security assess --profile PROFILE_NAME --language EN
94
146
  ```
95
147
 
96
148
  ---
97
149
 
98
- ### **Option 3: AWS Lambda Deployment**
150
+ ### **Option 3: Using Task Automation**
151
+
152
+ 1. **Prerequisites Check**:
153
+ ```bash
154
+ task -d ~ check-tools
155
+ task -d ~ check-aws
156
+ ```
99
157
 
100
- 1. **Prepare the Lambda Function**:
101
- - Package the `security-baseline` directory into a ZIP file.
102
- - Ensure dependencies are included by using tools like **pipenv** or **venv**.
158
+ 2. **Install and Run**:
159
+ ```bash
160
+ task install
161
+ task security.assess
162
+ ```
103
163
 
104
- 2. **Deploy to AWS Lambda**:
105
- - Create a Lambda function in the AWS Management Console or using AWS CLI.
106
- - Attach the `permission.json` IAM policy to the function's execution role.
164
+ ---
107
165
 
108
- 3. **Invoke the Function**:
109
- - Use AWS CLI or a scheduled event trigger (e.g., CloudWatch Events).
166
+ ### **CLI Command Reference**
167
+
168
+ ```bash
169
+ # Main security commands
170
+ runbooks security --help # Show security help
171
+ runbooks security assess # Run comprehensive assessment
172
+ runbooks security assess --profile prod # Use specific AWS profile
173
+ runbooks security assess --language KR # Generate Korean report
174
+ runbooks security assess --output /reports # Custom output directory
175
+
176
+ # Individual security checks
177
+ runbooks security check root_mfa # Check root MFA
178
+ runbooks security check iam_password_policy # Check IAM password policy
179
+ runbooks security list-checks # List all available checks
180
+
181
+ # Advanced usage
182
+ runbooks security assess --format html # HTML report (default)
183
+ runbooks security assess --format json # JSON output
184
+ runbooks security assess --format console # Console output only
185
+ ```
110
186
 
111
187
  ---
112
188
 
@@ -255,23 +331,49 @@ Let’s work together to make cloud security accessible, effective, and scalable
255
331
 
256
332
  ---
257
333
 
258
- ### **Run the Script**
334
+ ### **Quick Start Examples**
259
335
 
260
- 1. **Run the Script**:
336
+ 1. **Basic Security Assessment**:
261
337
  ```bash
262
- python3 run_script.py
338
+ runbooks security assess
263
339
  ```
264
340
 
265
- 2. **Use Profile or Language Options** *(Optional)*:
266
- - If you configured AWS CLI with a specific profile, run:
267
- ```bash
268
- python3 run_script.py --profile PROFILE_NAME --language EN
269
- ```
341
+ 2. **Assessment with Custom Profile and Language**:
342
+ ```bash
343
+ runbooks security assess --profile production --language EN
344
+ ```
270
345
  - Supported languages: **English (EN)**, **Korean (KR)**, **Japanese (JP)**, **Vietnamese (VN)**.
271
346
 
272
- 3. **View Results**:
273
- - Upon completion, an HTML report will be generated in the `results/` directory.
274
- - If running on AWS CloudShell, download the report locally. [How to download files from AWS CloudShell](https://docs.aws.amazon.com/cloudshell/latest/userguide/getting-started.html#download-file).
347
+ 3. **Generate Reports in Different Languages**:
348
+ ```bash
349
+ # English report
350
+ runbooks security assess --language EN --output ./reports/english
351
+
352
+ # Korean report
353
+ runbooks security assess --language KR --output ./reports/korean
354
+
355
+ # Japanese report
356
+ runbooks security assess --language JP --output ./reports/japanese
357
+
358
+ # Vietnamese report
359
+ runbooks security assess --language VN --output ./reports/vietnamese
360
+ ```
361
+
362
+ 4. **View Results**:
363
+ - Upon completion, an HTML report will be generated in the specified output directory (default: `./results/`)
364
+ - The CLI provides rich console output with immediate feedback on security findings
365
+ - Reports include actionable remediation steps with links to AWS documentation
366
+
367
+ 5. **List Available Security Checks**:
368
+ ```bash
369
+ runbooks security list-checks
370
+ ```
371
+
372
+ 6. **Run Individual Security Checks** *(Coming Soon)*:
373
+ ```bash
374
+ runbooks security check root_mfa
375
+ runbooks security check iam_password_policy
376
+ ```
275
377
 
276
378
  > ![Sample Report](./images/report_sample_en.png)
277
379
 
@@ -306,19 +408,40 @@ To scan additional AWS accounts in the same organization, you must:
306
408
 
307
409
  ---
308
410
 
309
- ### **4. Can I use this script without an IAM Access Key?**
411
+ ### **4. Can I use this tool without an IAM Access Key?**
412
+
413
+ Yes, you can run the security assessment without an IAM Access Key by leveraging IAM roles.
414
+ The integrated `runbooks security` CLI fully supports IAM roles and various AWS authentication methods.
310
415
 
311
- Yes, you can run the script without an IAM Access Key by leveraging IAM roles.
312
- Starting from the **01/Aug/2023**, you can configure and use **IAM Roles** instead of access keys.
416
+ **Supported Authentication Methods**:
417
+ 1. **IAM Roles** (Recommended): Configure and use IAM roles instead of access keys
418
+ 2. **AWS SSO**: Use AWS Single Sign-On for centralized authentication
419
+ 3. **Environment Variables**: Set AWS credentials via environment variables
420
+ 4. **Instance Profiles**: Automatically use instance profiles when running on EC2
421
+ 5. **AWS CloudShell**: Run directly in AWS CloudShell without any setup
313
422
 
314
- Follow these steps:
315
- 1. Refer to [Overview of using IAM roles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html#cli-role-overview) to configure a role profile in the AWS CLI.
316
- 2. Execute the script with the `--profile` option as shown below:
423
+ **Setup Examples**:
424
+
425
+ **Using IAM Roles**:
426
+ 1. Configure a role profile in AWS CLI: [IAM roles guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-role.html#cli-role-overview)
427
+ 2. Run the assessment:
428
+ ```bash
429
+ runbooks security assess --profile ROLE_PROFILE_NAME --language EN
430
+ ```
431
+
432
+ **Using AWS SSO**:
433
+ 1. Configure SSO profile: `aws configure sso`
434
+ 2. Run the assessment:
435
+ ```bash
436
+ runbooks security assess --profile sso-profile --language EN
437
+ ```
317
438
 
439
+ **Using AWS CloudShell**:
318
440
  ```bash
319
- python3 run_script.py --profile PROFILE_NAME --language EN
441
+ pip install runbooks
442
+ runbooks security assess --language EN
320
443
  ```
321
444
 
322
- This approach enhances security by reducing the dependency on long-term access keys.
445
+ This approach enhances security by reducing the dependency on long-term access keys and provides enterprise-grade authentication options.
323
446
 
324
447
  ---
@@ -0,0 +1,70 @@
1
+ """
2
+ AWS Security Baseline Testing Module.
3
+
4
+ This module provides comprehensive AWS security baseline testing capabilities
5
+ with multilingual reporting and enterprise-grade assessment features.
6
+
7
+ The security module evaluates AWS accounts against security best practices
8
+ and generates detailed HTML reports with findings and remediation guidance.
9
+
10
+ Features:
11
+ - Comprehensive security checklist validation
12
+ - Multilingual report generation (EN, JP, KR, VN)
13
+ - Parallel execution for performance
14
+ - Enterprise-ready HTML reporting
15
+ - CLI integration with runbooks
16
+ - AWS Organizations and multi-account support
17
+
18
+ Example:
19
+ ```python
20
+ from runbooks.security import SecurityBaselineTester
21
+
22
+ # Initialize security tester
23
+ tester = SecurityBaselineTester(
24
+ profile="prod",
25
+ lang_code="EN",
26
+ output_dir="./security-reports"
27
+ )
28
+
29
+ # Run security assessment
30
+ tester.run()
31
+ ```
32
+
33
+ CLI Usage:
34
+ ```bash
35
+ # Run security assessment
36
+ runbooks security assess --profile prod --language EN
37
+
38
+ # Generate Korean language report
39
+ runbooks security assess --language KR --output /reports
40
+
41
+ # Run specific security checks
42
+ runbooks security check root-mfa --profile production
43
+ ```
44
+
45
+ Author: CloudOps Runbooks Team
46
+ Version: 1.1.0
47
+ """
48
+
49
+ from .report_generator import ReportGenerator, generate_html_report
50
+ from .run_script import main as run_security_script
51
+ from .run_script import parse_arguments
52
+ from .security_baseline_tester import SecurityBaselineTester
53
+
54
+ # Version info
55
+ __version__ = "0.7.5"
56
+ __author__ = "CloudOps Runbooks Team"
57
+
58
+ # Public API
59
+ __all__ = [
60
+ # Core functionality
61
+ "SecurityBaselineTester",
62
+ "ReportGenerator",
63
+ "generate_html_report",
64
+ # CLI functions
65
+ "run_security_script",
66
+ "parse_arguments",
67
+ # Metadata
68
+ "__version__",
69
+ "__author__",
70
+ ]
@@ -9,8 +9,10 @@ from pathlib import Path
9
9
  import boto3
10
10
  import botocore
11
11
 
12
- from . import report_generator
13
- from .checklist import * # noqa: F403
12
+ from . import (
13
+ checklist, # noqa: F403
14
+ report_generator,
15
+ )
14
16
  from .utils import common, language, level_const
15
17
 
16
18
  # from .utils.language import get_translator
@@ -108,7 +110,7 @@ class SecurityBaselineTester:
108
110
 
109
111
  def _run_check(self, check_name, credential_report):
110
112
  # check_module = __import__(f"checklist.{check_name}", fromlist=[check_name])
111
- check_module = importlib.import_module(f"runbooks.security_baseline.checklist.{check_name}")
113
+ check_module = importlib.import_module(f"runbooks.security.checklist.{check_name}")
112
114
  check_method = getattr(check_module, self.config["checks"][check_name])
113
115
  translator = language.get_translator(check_name, self.language)
114
116