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.
- jupyter-agent/.env +2 -0
- jupyter-agent/.gradio/certificate.pem +31 -0
- jupyter-agent/__main__.log +8 -0
- jupyter-agent/tmp/4ojbs8a02ir/jupyter-agent.ipynb +68 -0
- jupyter-agent/tmp/cm5iasgpm3p/jupyter-agent.ipynb +91 -0
- jupyter-agent/tmp/crqbsseag5/jupyter-agent.ipynb +91 -0
- jupyter-agent/tmp/hohanq1u097/jupyter-agent.ipynb +57 -0
- jupyter-agent/tmp/jns1sam29wm/jupyter-agent.ipynb +53 -0
- jupyter-agent/tmp/jupyter-agent.ipynb +27 -0
- runbooks/__init__.py +87 -37
- runbooks/cfat/README.md +300 -49
- runbooks/cfat/__init__.py +2 -2
- runbooks/finops/README.md +337 -0
- runbooks/finops/__init__.py +2 -4
- runbooks/finops/cli.py +1 -1
- runbooks/inventory/aws_organization.png +0 -0
- runbooks/inventory/collectors/__init__.py +8 -0
- runbooks/inventory/collectors/aws_management.py +791 -0
- runbooks/inventory/collectors/aws_networking.py +3 -3
- runbooks/main.py +3416 -590
- runbooks/operate/__init__.py +207 -0
- runbooks/operate/base.py +311 -0
- runbooks/operate/cloudformation_operations.py +619 -0
- runbooks/operate/cloudwatch_operations.py +496 -0
- runbooks/operate/dynamodb_operations.py +812 -0
- runbooks/operate/ec2_operations.py +926 -0
- runbooks/operate/iam_operations.py +569 -0
- runbooks/operate/s3_operations.py +1211 -0
- runbooks/operate/tagging_operations.py +655 -0
- runbooks/remediation/CLAUDE.md +100 -0
- runbooks/remediation/DOME9.md +218 -0
- runbooks/remediation/README.md +26 -0
- runbooks/remediation/Tests/update_policy.py +74 -0
- runbooks/remediation/__init__.py +95 -0
- runbooks/remediation/acm_cert_expired_unused.py +98 -0
- runbooks/remediation/acm_remediation.py +875 -0
- runbooks/remediation/api_gateway_list.py +167 -0
- runbooks/remediation/base.py +643 -0
- runbooks/remediation/cloudtrail_remediation.py +908 -0
- runbooks/remediation/cloudtrail_s3_modifications.py +296 -0
- runbooks/remediation/cognito_active_users.py +78 -0
- runbooks/remediation/cognito_remediation.py +856 -0
- runbooks/remediation/cognito_user_password_reset.py +163 -0
- runbooks/remediation/commons.py +455 -0
- runbooks/remediation/dynamodb_optimize.py +155 -0
- runbooks/remediation/dynamodb_remediation.py +744 -0
- runbooks/remediation/dynamodb_server_side_encryption.py +108 -0
- runbooks/remediation/ec2_public_ips.py +134 -0
- runbooks/remediation/ec2_remediation.py +892 -0
- runbooks/remediation/ec2_subnet_disable_auto_ip_assignment.py +72 -0
- runbooks/remediation/ec2_unattached_ebs_volumes.py +448 -0
- runbooks/remediation/ec2_unused_security_groups.py +202 -0
- runbooks/remediation/kms_enable_key_rotation.py +651 -0
- runbooks/remediation/kms_remediation.py +717 -0
- runbooks/remediation/lambda_list.py +243 -0
- runbooks/remediation/lambda_remediation.py +971 -0
- runbooks/remediation/multi_account.py +569 -0
- runbooks/remediation/rds_instance_list.py +199 -0
- runbooks/remediation/rds_remediation.py +873 -0
- runbooks/remediation/rds_snapshot_list.py +192 -0
- runbooks/remediation/requirements.txt +118 -0
- runbooks/remediation/s3_block_public_access.py +159 -0
- runbooks/remediation/s3_bucket_public_access.py +143 -0
- runbooks/remediation/s3_disable_static_website_hosting.py +74 -0
- runbooks/remediation/s3_downloader.py +215 -0
- runbooks/remediation/s3_enable_access_logging.py +562 -0
- runbooks/remediation/s3_encryption.py +526 -0
- runbooks/remediation/s3_force_ssl_secure_policy.py +143 -0
- runbooks/remediation/s3_list.py +141 -0
- runbooks/remediation/s3_object_search.py +201 -0
- runbooks/remediation/s3_remediation.py +816 -0
- runbooks/remediation/scan_for_phrase.py +425 -0
- runbooks/remediation/workspaces_list.py +220 -0
- runbooks/{security_baseline → security}/README.md +191 -68
- runbooks/security/__init__.py +70 -0
- runbooks/{security_baseline → security}/security_baseline_tester.py +5 -3
- runbooks-0.7.5.dist-info/METADATA +606 -0
- {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/RECORD +115 -75
- {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/entry_points.txt +0 -1
- runbooks/aws/__init__.py +0 -58
- runbooks/aws/dynamodb_operations.py +0 -231
- runbooks/aws/ec2_copy_image_cross-region.py +0 -195
- runbooks/aws/ec2_describe_instances.py +0 -202
- runbooks/aws/ec2_ebs_snapshots_delete.py +0 -186
- runbooks/aws/ec2_run_instances.py +0 -213
- runbooks/aws/ec2_start_stop_instances.py +0 -212
- runbooks/aws/ec2_terminate_instances.py +0 -143
- runbooks/aws/ec2_unused_eips.py +0 -196
- runbooks/aws/ec2_unused_volumes.py +0 -188
- runbooks/aws/s3_create_bucket.py +0 -142
- runbooks/aws/s3_list_buckets.py +0 -152
- runbooks/aws/s3_list_objects.py +0 -156
- runbooks/aws/s3_object_operations.py +0 -183
- runbooks/aws/tagging_lambda_handler.py +0 -183
- runbooks/inventory/cfn_move_stack_instances.py +0 -1526
- runbooks/inventory/delete_s3_buckets_objects.py +0 -169
- runbooks/inventory/lockdown_cfn_stackset_role.py +0 -224
- runbooks/inventory/update_aws_actions.py +0 -173
- runbooks/inventory/update_cfn_stacksets.py +0 -1215
- runbooks/inventory/update_cloudwatch_logs_retention_policy.py +0 -294
- runbooks/inventory/update_iam_roles_cross_accounts.py +0 -478
- runbooks/inventory/update_s3_public_access_block.py +0 -539
- runbooks/organizations/__init__.py +0 -12
- runbooks/organizations/manager.py +0 -374
- runbooks/security_baseline/requirements.txt +0 -7
- runbooks-0.6.1.dist-info/METADATA +0 -373
- /runbooks/{aws → operate}/tags.json +0 -0
- /runbooks/{security_baseline → remediation/Tests}/__init__.py +0 -0
- /runbooks/{security_baseline → security}/checklist/__init__.py +0 -0
- /runbooks/{security_baseline → security}/checklist/account_level_bucket_public_access.py +0 -0
- /runbooks/{security_baseline → security}/checklist/alternate_contacts.py +0 -0
- /runbooks/{security_baseline → security}/checklist/bucket_public_access.py +0 -0
- /runbooks/{security_baseline → security}/checklist/cloudwatch_alarm_configuration.py +0 -0
- /runbooks/{security_baseline → security}/checklist/direct_attached_policy.py +0 -0
- /runbooks/{security_baseline → security}/checklist/guardduty_enabled.py +0 -0
- /runbooks/{security_baseline → security}/checklist/iam_password_policy.py +0 -0
- /runbooks/{security_baseline → security}/checklist/iam_user_mfa.py +0 -0
- /runbooks/{security_baseline → security}/checklist/multi_region_instance_usage.py +0 -0
- /runbooks/{security_baseline → security}/checklist/multi_region_trail.py +0 -0
- /runbooks/{security_baseline → security}/checklist/root_access_key.py +0 -0
- /runbooks/{security_baseline → security}/checklist/root_mfa.py +0 -0
- /runbooks/{security_baseline → security}/checklist/root_usage.py +0 -0
- /runbooks/{security_baseline → security}/checklist/trail_enabled.py +0 -0
- /runbooks/{security_baseline → security}/checklist/trusted_advisor.py +0 -0
- /runbooks/{security_baseline → security}/config-origin.json +0 -0
- /runbooks/{security_baseline → security}/config.json +0 -0
- /runbooks/{security_baseline → security}/permission.json +0 -0
- /runbooks/{security_baseline → security}/report_generator.py +0 -0
- /runbooks/{security_baseline → security}/report_template_en.html +0 -0
- /runbooks/{security_baseline → security}/report_template_jp.html +0 -0
- /runbooks/{security_baseline → security}/report_template_kr.html +0 -0
- /runbooks/{security_baseline → security}/report_template_vn.html +0 -0
- /runbooks/{security_baseline → security}/run_script.py +0 -0
- /runbooks/{security_baseline → security}/utils/__init__.py +0 -0
- /runbooks/{security_baseline → security}/utils/common.py +0 -0
- /runbooks/{security_baseline → security}/utils/enums.py +0 -0
- /runbooks/{security_baseline → security}/utils/language.py +0 -0
- /runbooks/{security_baseline → security}/utils/level_const.py +0 -0
- /runbooks/{security_baseline → security}/utils/permission_list.py +0 -0
- {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/WHEEL +0 -0
- {runbooks-0.6.1.dist-info → runbooks-0.7.5.dist-info}/licenses/LICENSE +0 -0
- {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)**.
|
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.
|
15
|
-
-
|
16
|
-
|
17
|
-
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
|
23
|
-
|
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
|
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
|
-
│ ├──
|
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
|
-
│ ├──
|
47
|
-
│
|
48
|
-
├──
|
49
|
-
│ └──
|
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
|
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
|
-
>
|
98
|
+
> **⚡ Quick Start**: `pip install runbooks && runbooks security assess`
|
60
99
|
|
61
|
-
### **Option 1:
|
100
|
+
### **Option 1: Install via PyPI (Recommended)**
|
62
101
|
|
63
|
-
1. **
|
102
|
+
1. **Install the Package**:
|
103
|
+
```bash
|
104
|
+
pip install runbooks
|
105
|
+
```
|
106
|
+
|
107
|
+
2. **Run Security Assessment**:
|
64
108
|
```bash
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
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
|
-
|
121
|
+
runbooks security list-checks
|
80
122
|
```
|
81
123
|
|
82
124
|
---
|
83
125
|
|
84
|
-
### **Option 2:
|
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
|
-
|
134
|
+
2. **Install Dependencies using UV** (Rust-based package manager):
|
87
135
|
```bash
|
88
|
-
|
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
|
-
|
143
|
+
3. **Run Security Assessment**:
|
92
144
|
```bash
|
93
|
-
|
145
|
+
uv run python -m runbooks security assess --profile PROFILE_NAME --language EN
|
94
146
|
```
|
95
147
|
|
96
148
|
---
|
97
149
|
|
98
|
-
### **Option 3:
|
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
|
-
|
101
|
-
|
102
|
-
|
158
|
+
2. **Install and Run**:
|
159
|
+
```bash
|
160
|
+
task install
|
161
|
+
task security.assess
|
162
|
+
```
|
103
163
|
|
104
|
-
|
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
|
-
|
109
|
-
|
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
|
-
### **
|
334
|
+
### **Quick Start Examples**
|
259
335
|
|
260
|
-
1. **
|
336
|
+
1. **Basic Security Assessment**:
|
261
337
|
```bash
|
262
|
-
|
338
|
+
runbooks security assess
|
263
339
|
```
|
264
340
|
|
265
|
-
2. **
|
266
|
-
|
267
|
-
|
268
|
-
|
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. **
|
273
|
-
|
274
|
-
|
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
|
> 
|
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
|
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
|
-
|
312
|
-
|
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
|
-
|
315
|
-
|
316
|
-
|
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
|
-
|
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
|
13
|
-
|
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.
|
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
|
|