Back to PortfolioSecurity Automation
Automated Cloud Security Auditor
Developed a Python script using Boto3 to automatically scan an AWS account for security misconfigurations in S3 and IAM, generating a compliance report.
2025 10 weeks Security Automation Engineer Python, AWS, Boto3, Lambda
247Issues Identified
97%CIS Compliance
95%Automation Rate
$2.4KMonthly Savings
Project Overview
This project involved developing a comprehensive Python-based security auditing tool that automatically scans AWS accounts for security misconfigurations and compliance violations. The tool focuses on critical services including S3, IAM, EC2, and VPC configurations, generating detailed compliance reports and remediation recommendations.
Technical Stack
- ▸Language: Python 3.9+
- ▸AWS SDK: Boto3 for AWS API interactions
- ▸Reporting: pandas, matplotlib for data analysis and visualization
- ▸Configuration: YAML for rule definitions and settings
- ▸Output Formats: JSON, HTML, PDF reports
- ▸Deployment: Lambda functions for scheduled execution
Security Checks Implemented
1. S3 Bucket Security
- ▸Public Access: Identifies publicly accessible buckets and objects
- ▸Encryption: Validates encryption at rest and in transit
- ▸Versioning: Checks if versioning is enabled for data protection
- ▸Logging: Ensures access logging is configured
- ▸Bucket Policies: Analyzes bucket policies for overly permissive access
- ▸MFA Delete: Verifies MFA delete protection is enabled
2. IAM Configuration
- ▸Root Account: Checks for root account usage and MFA
- ▸Password Policy: Validates password complexity requirements
- ▸Unused Credentials: Identifies dormant users and access keys
- ▸Privilege Escalation: Detects overly permissive policies
- ▸Service Roles: Reviews cross-service trust relationships
- ▸Access Keys: Identifies old or unused access keys
3. EC2 Instance Security
- ▸Security Groups: Analyzes firewall rules for open ports
- ▸Key Pairs: Identifies instances with shared key pairs
- ▸Instance Metadata: Checks IMDSv2 enforcement
- ▸Public IPs: Identifies unnecessarily public instances
- ▸EBS Encryption: Validates volume encryption settings
4. Network Security
- ▸VPC Configuration: Reviews network segmentation
- ▸Flow Logs: Ensures VPC flow logging is enabled
- ▸NACL Rules: Analyzes network ACL configurations
- ▸Route Tables: Reviews routing for security risks
Code Architecture & Design
Modular Design
The auditor is built with a modular architecture allowing easy addition of new security checks:
src/
├── auditor/
│ ├── core/
│ │ ├── aws_client.py # AWS session management
│ │ ├── scanner.py # Main scanning engine
│ │ └── reporter.py # Report generation
│ ├── checks/
│ │ ├── s3_checks.py # S3 security validations
│ │ ├── iam_checks.py # IAM security validations
│ │ ├── ec2_checks.py # EC2 security validations
│ │ └── vpc_checks.py # VPC security validations
│ └── utils/
│ ├── config.py # Configuration management
│ └── helpers.py # Utility functions
├── config/
│ ├── rules.yaml # Security rule definitions
│ └── settings.yaml # Application settings
└── tests/ # Unit testsRule-Based Engine
Security checks are defined in YAML configuration files, making the tool easily customizable:
s3_rules:
public_bucket_check:
enabled: true
severity: "HIGH"
description: "S3 bucket allows public access"
remediation: "Restrict public access"
encryption_check:
enabled: true
severity: "MEDIUM"
description: "S3 bucket encryption not enabled"
remediation: "Enable SSE-S3 or SSE-KMS"Results & Impact
Security Improvements
- ▸Issues Identified: 247 security misconfigurations
- ▸High-Risk Findings: 23 critical vulnerabilities
- ▸Compliance Improvement: 89% → 97% CIS compliance
- ▸Response Time: 2 hours average remediation time
- ▸Cost Optimization: $2,400/month savings identified
- ▸Automation Efficiency: 95% reduction in manual audits
- ▸Coverage: 100% of AWS resources scanned
- ▸False Positives: <5% accuracy rate
Common Findings
- ▸S3 Misconfigurations: 34% of buckets had public read access
- ▸IAM Issues: 67% of users had unused access keys >90 days old
- ▸Network Security: 45% of security groups had overly permissive rules
- ▸Encryption: 23% of EBS volumes lacked encryption
Project Details
Duration10 weeks
RoleSecurity Automation Engineer
TechnologiesPython, AWS, Boto3, Lambda
Focus AreaSecurity Automation
Compliance Frameworks
- CIS AWS Benchmark
- NIST Cybersecurity Framework
- AWS Well-Architected
- SOC 2 Controls
Tool Capabilities
- Automated scanning
- Detailed reporting
- Multi-account support
- Scheduled execution
Security Metrics
Scan Coverage100%
Compliance Score97%
Automation Rate95%