runbooks 0.6.1__py3-none-any.whl → 0.7.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.
Files changed (58) 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 +1 -1
  11. runbooks/finops/README.md +337 -0
  12. runbooks/finops/__init__.py +1 -3
  13. runbooks/inventory/FAILED_SCRIPTS_TROUBLESHOOTING.md +619 -0
  14. runbooks/inventory/PASSED_SCRIPTS_GUIDE.md +738 -0
  15. runbooks/inventory/aws_organization.png +0 -0
  16. runbooks/main.py +230 -11
  17. runbooks/{security_baseline → security}/README.md +191 -68
  18. runbooks/security/__init__.py +71 -0
  19. runbooks/{security_baseline → security}/security_baseline_tester.py +2 -2
  20. {runbooks-0.6.1.dist-info → runbooks-0.7.0.dist-info}/METADATA +5 -3
  21. {runbooks-0.6.1.dist-info → runbooks-0.7.0.dist-info}/RECORD +56 -44
  22. runbooks/security_baseline/__init__.py +0 -0
  23. runbooks/security_baseline/requirements.txt +0 -7
  24. /runbooks/{security_baseline → security}/checklist/__init__.py +0 -0
  25. /runbooks/{security_baseline → security}/checklist/account_level_bucket_public_access.py +0 -0
  26. /runbooks/{security_baseline → security}/checklist/alternate_contacts.py +0 -0
  27. /runbooks/{security_baseline → security}/checklist/bucket_public_access.py +0 -0
  28. /runbooks/{security_baseline → security}/checklist/cloudwatch_alarm_configuration.py +0 -0
  29. /runbooks/{security_baseline → security}/checklist/direct_attached_policy.py +0 -0
  30. /runbooks/{security_baseline → security}/checklist/guardduty_enabled.py +0 -0
  31. /runbooks/{security_baseline → security}/checklist/iam_password_policy.py +0 -0
  32. /runbooks/{security_baseline → security}/checklist/iam_user_mfa.py +0 -0
  33. /runbooks/{security_baseline → security}/checklist/multi_region_instance_usage.py +0 -0
  34. /runbooks/{security_baseline → security}/checklist/multi_region_trail.py +0 -0
  35. /runbooks/{security_baseline → security}/checklist/root_access_key.py +0 -0
  36. /runbooks/{security_baseline → security}/checklist/root_mfa.py +0 -0
  37. /runbooks/{security_baseline → security}/checklist/root_usage.py +0 -0
  38. /runbooks/{security_baseline → security}/checklist/trail_enabled.py +0 -0
  39. /runbooks/{security_baseline → security}/checklist/trusted_advisor.py +0 -0
  40. /runbooks/{security_baseline → security}/config-origin.json +0 -0
  41. /runbooks/{security_baseline → security}/config.json +0 -0
  42. /runbooks/{security_baseline → security}/permission.json +0 -0
  43. /runbooks/{security_baseline → security}/report_generator.py +0 -0
  44. /runbooks/{security_baseline → security}/report_template_en.html +0 -0
  45. /runbooks/{security_baseline → security}/report_template_jp.html +0 -0
  46. /runbooks/{security_baseline → security}/report_template_kr.html +0 -0
  47. /runbooks/{security_baseline → security}/report_template_vn.html +0 -0
  48. /runbooks/{security_baseline → security}/run_script.py +0 -0
  49. /runbooks/{security_baseline → security}/utils/__init__.py +0 -0
  50. /runbooks/{security_baseline → security}/utils/common.py +0 -0
  51. /runbooks/{security_baseline → security}/utils/enums.py +0 -0
  52. /runbooks/{security_baseline → security}/utils/language.py +0 -0
  53. /runbooks/{security_baseline → security}/utils/level_const.py +0 -0
  54. /runbooks/{security_baseline → security}/utils/permission_list.py +0 -0
  55. {runbooks-0.6.1.dist-info → runbooks-0.7.0.dist-info}/WHEEL +0 -0
  56. {runbooks-0.6.1.dist-info → runbooks-0.7.0.dist-info}/entry_points.txt +0 -0
  57. {runbooks-0.6.1.dist-info → runbooks-0.7.0.dist-info}/licenses/LICENSE +0 -0
  58. {runbooks-0.6.1.dist-info → runbooks-0.7.0.dist-info}/top_level.txt +0 -0
Binary file
runbooks/main.py CHANGED
@@ -702,15 +702,15 @@ def display_creation_results(results):
702
702
  @click.option(
703
703
  "--profiles",
704
704
  "-p",
705
- nargs="+",
706
- help="Specific AWS profiles to use (space-separated)",
705
+ multiple=True,
706
+ help="Specific AWS profiles to use (repeat option to pass multiple)",
707
707
  type=str,
708
708
  )
709
709
  @click.option(
710
710
  "--regions",
711
711
  "-r",
712
- nargs="+",
713
- help="AWS regions to check for EC2 instances (space-separated)",
712
+ multiple=True,
713
+ help="AWS regions to check for EC2 instances (repeat option to pass multiple)",
714
714
  type=str,
715
715
  )
716
716
  @click.option("--all", "-a", is_flag=True, help="Use all available AWS profiles")
@@ -730,11 +730,10 @@ def display_creation_results(results):
730
730
  @click.option(
731
731
  "--report-type",
732
732
  "-y",
733
- nargs="+",
734
- choices=["csv", "json", "pdf"],
735
- help="Specify one or more report types: csv and/or json and/or pdf (space-separated)",
736
- type=str,
737
- default=["csv"],
733
+ multiple=True,
734
+ type=click.Choice(["csv", "json", "pdf"]),
735
+ help="Specify one or more report types (repeat option): csv, json, pdf",
736
+ default=("csv",),
738
737
  )
739
738
  @click.option(
740
739
  "--dir",
@@ -751,8 +750,8 @@ def display_creation_results(results):
751
750
  @click.option(
752
751
  "--tag",
753
752
  "-g",
754
- nargs="+",
755
- help="Cost allocation tag to filter resources, e.g., --tag Team=DevOps",
753
+ multiple=True,
754
+ help="Cost allocation tag filter(s), e.g., --tag Team=DevOps (repeat for multiple)",
756
755
  type=str,
757
756
  )
758
757
  @click.option(
@@ -777,6 +776,226 @@ def finops(ctx, **kwargs):
777
776
  run_dashboard(args)
778
777
 
779
778
 
779
+ # ============================================================================
780
+ # Security Commands
781
+ # ============================================================================
782
+
783
+
784
+ @main.group(invoke_without_command=True)
785
+ @click.option(
786
+ "--profile",
787
+ default="default",
788
+ help="AWS IAM profile to use for authentication (default: 'default')"
789
+ )
790
+ @click.option(
791
+ "--language",
792
+ type=click.Choice(["EN", "JP", "KR", "VN"]),
793
+ default="EN",
794
+ help="Language for security reports (default: 'EN')"
795
+ )
796
+ @click.option(
797
+ "--output",
798
+ help="Custom output directory for reports (default: ./results)"
799
+ )
800
+ @click.pass_context
801
+ def security(ctx, profile, language, output):
802
+ """AWS Security Baseline Assessment Tool.
803
+
804
+ Comprehensive security baseline testing with multilingual reporting
805
+ and enterprise-grade assessment features.
806
+
807
+ Examples:
808
+ runbooks security assess --profile prod --language EN
809
+ runbooks security assess --language KR --output /reports
810
+ runbooks security check root-mfa --profile production
811
+ """
812
+ if ctx.invoked_subcommand is None:
813
+ from runbooks.security import run_security_script
814
+
815
+ # Create mock args namespace for backward compatibility
816
+ import argparse
817
+ args = argparse.Namespace(
818
+ profile=profile,
819
+ language=language,
820
+ output=output
821
+ )
822
+
823
+ # Import and run the main security function
824
+ from runbooks.security.security_baseline_tester import SecurityBaselineTester
825
+
826
+ try:
827
+ console.print(f"[blue]🔒 AWS Security Baseline Assessment[/blue]")
828
+ console.print(f"[dim]Profile: {profile} | Language: {language} | Output: {output or './results'}[/dim]")
829
+
830
+ tester = SecurityBaselineTester(profile, language, output)
831
+ tester.run()
832
+
833
+ console.print(f"[green]✅ Security assessment completed successfully![/green]")
834
+
835
+ except Exception as e:
836
+ console.print(f"[red]❌ Error running security assessment: {e}[/red]")
837
+ raise click.ClickException(str(e))
838
+
839
+
840
+ @security.command()
841
+ @click.option(
842
+ "--profile",
843
+ default="default",
844
+ help="AWS IAM profile to use for authentication"
845
+ )
846
+ @click.option(
847
+ "--language",
848
+ type=click.Choice(["EN", "JP", "KR", "VN"]),
849
+ default="EN",
850
+ help="Language for security reports"
851
+ )
852
+ @click.option(
853
+ "--output",
854
+ help="Custom output directory for reports"
855
+ )
856
+ @click.option(
857
+ "--checks",
858
+ multiple=True,
859
+ help="Specific security checks to run (repeat for multiple)"
860
+ )
861
+ @click.option(
862
+ "--format",
863
+ type=click.Choice(["html", "json", "console"]),
864
+ default="html",
865
+ help="Output format for results"
866
+ )
867
+ @click.pass_context
868
+ def assess(ctx, profile, language, output, checks, format):
869
+ """Run comprehensive security baseline assessment.
870
+
871
+ Evaluates AWS account against security best practices and generates
872
+ detailed reports with findings and remediation guidance.
873
+
874
+ Examples:
875
+ runbooks security assess --profile prod
876
+ runbooks security assess --language KR --format json
877
+ runbooks security assess --checks root_mfa --checks iam_password_policy
878
+ """
879
+ try:
880
+ from runbooks.security.security_baseline_tester import SecurityBaselineTester
881
+
882
+ console.print(f"[blue]🔒 Running Security Baseline Assessment[/blue]")
883
+ console.print(f"[dim]Profile: {profile} | Language: {language} | Format: {format}[/dim]")
884
+
885
+ if checks:
886
+ console.print(f"[dim]Specific checks: {', '.join(checks)}[/dim]")
887
+
888
+ # Initialize and run security assessment
889
+ tester = SecurityBaselineTester(profile, language, output)
890
+
891
+ # TODO: Add support for specific checks filtering
892
+ # For now, run all checks
893
+ tester.run()
894
+
895
+ console.print(f"[green]✅ Security assessment completed![/green]")
896
+
897
+ # Display results summary
898
+ console.print(f"\n[bold]📊 Assessment Summary:[/bold]")
899
+ console.print(f"[green]• Report generated in {format.upper()} format[/green]")
900
+ console.print(f"[yellow]• Output directory: {output or './results'}[/yellow]")
901
+ console.print(f"[blue]• Language: {language}[/blue]")
902
+
903
+ except Exception as e:
904
+ console.print(f"[red]❌ Error running security assessment: {e}[/red]")
905
+ raise click.ClickException(str(e))
906
+
907
+
908
+ @security.command()
909
+ @click.argument("check_name")
910
+ @click.option(
911
+ "--profile",
912
+ default="default",
913
+ help="AWS IAM profile to use"
914
+ )
915
+ @click.option(
916
+ "--language",
917
+ type=click.Choice(["EN", "JP", "KR", "VN"]),
918
+ default="EN",
919
+ help="Language for output"
920
+ )
921
+ @click.pass_context
922
+ def check(ctx, check_name, profile, language):
923
+ """Run a specific security check.
924
+
925
+ Available checks:
926
+ root_mfa, root_usage, root_access_key, iam_user_mfa,
927
+ iam_password_policy, direct_attached_policy, alternate_contacts,
928
+ trail_enabled, multi_region_trail, account_level_bucket_public_access,
929
+ bucket_public_access, cloudwatch_alarm_configuration,
930
+ multi_region_instance_usage, guardduty_enabled, trusted_advisor
931
+
932
+ Examples:
933
+ runbooks security check root_mfa --profile prod
934
+ runbooks security check iam_password_policy --language KR
935
+ """
936
+ try:
937
+ console.print(f"[blue]🔍 Running security check: {check_name}[/blue]")
938
+ console.print(f"[dim]Profile: {profile} | Language: {language}[/dim]")
939
+
940
+ # TODO: Implement individual check execution
941
+ # For now, show available checks
942
+ available_checks = [
943
+ "root_mfa", "root_usage", "root_access_key", "iam_user_mfa",
944
+ "iam_password_policy", "direct_attached_policy", "alternate_contacts",
945
+ "trail_enabled", "multi_region_trail", "account_level_bucket_public_access",
946
+ "bucket_public_access", "cloudwatch_alarm_configuration",
947
+ "multi_region_instance_usage", "guardduty_enabled", "trusted_advisor"
948
+ ]
949
+
950
+ if check_name not in available_checks:
951
+ console.print(f"[red]❌ Unknown check: {check_name}[/red]")
952
+ console.print(f"[yellow]Available checks:[/yellow]")
953
+ for check in available_checks:
954
+ console.print(f" • {check}")
955
+ raise click.ClickException(f"Invalid check name: {check_name}")
956
+
957
+ console.print(f"[yellow]⚠️ Individual check execution not yet implemented[/yellow]")
958
+ console.print(f"[blue]💡 Use 'runbooks security assess' to run all checks[/blue]")
959
+
960
+ except Exception as e:
961
+ console.print(f"[red]❌ Error running security check: {e}[/red]")
962
+ raise click.ClickException(str(e))
963
+
964
+
965
+ @security.command()
966
+ @click.pass_context
967
+ def list_checks(ctx):
968
+ """List all available security checks."""
969
+ console.print(f"[blue]📋 Available Security Checks[/blue]")
970
+ console.print(f"[dim]These checks evaluate AWS account security against best practices[/dim]\n")
971
+
972
+ checks = {
973
+ "root_mfa": "Check if MFA is enabled for root account",
974
+ "root_usage": "Check root account usage patterns",
975
+ "root_access_key": "Check for root account access keys",
976
+ "iam_user_mfa": "Check MFA settings for IAM users",
977
+ "iam_password_policy": "Evaluate IAM password policy",
978
+ "direct_attached_policy": "Check for directly attached IAM policies",
979
+ "alternate_contacts": "Verify alternate contact information",
980
+ "trail_enabled": "Check if CloudTrail is enabled",
981
+ "multi_region_trail": "Check for multi-region CloudTrail",
982
+ "account_level_bucket_public_access": "Check S3 account-level public access",
983
+ "bucket_public_access": "Check individual S3 bucket public access",
984
+ "cloudwatch_alarm_configuration": "Verify CloudWatch alarm configuration",
985
+ "multi_region_instance_usage": "Check multi-region EC2 usage",
986
+ "guardduty_enabled": "Check if GuardDuty is enabled",
987
+ "trusted_advisor": "Check Trusted Advisor configuration"
988
+ }
989
+
990
+ for check_name, description in checks.items():
991
+ console.print(f"[cyan]{check_name:35}[/cyan] {description}")
992
+
993
+ console.print(f"\n[yellow]💡 Run individual checks:[/yellow]")
994
+ console.print(f" runbooks security check <check_name>")
995
+ console.print(f"\n[yellow]💡 Run all checks:[/yellow]")
996
+ console.print(f" runbooks security assess")
997
+
998
+
780
999
  # ============================================================================
781
1000
  # Main entry point - KISS principle: everything in one file
782
1001
  # ============================================================================
@@ -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
  ---