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.
The auditor is built with a modular architecture allowing easy addition of new security checks:
src/
├── auditor/
│ ├── __init__.py
│ ├── 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
├── reports/ # Generated reports
└── tests/ # Unit tests
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: "Configure bucket policy to restrict public access"
encryption_check:
enabled: true
severity: "MEDIUM"
description: "S3 bucket encryption not enabled"
remediation: "Enable server-side encryption (SSE-S3 or SSE-KMS)"
The tool supports scanning multiple AWS accounts using cross-account roles:
# Multi-account configuration
accounts = [
{
"name": "production",
"role_arn": "arn:aws:iam::123456789012:role/SecurityAuditorRole",
"regions": ["us-east-1", "us-west-2"]
},
{
"name": "development",
"role_arn": "arn:aws:iam::123456789013:role/SecurityAuditorRole",
"regions": ["us-east-1"]
}
]
The tool generates detailed reports in multiple formats with prioritized findings:
The auditor is packaged as a Lambda function for scheduled execution:
Integrated into development workflows for continuous security validation:
The tool generates comprehensive reports with actionable insights:
Resource: s3://company-data-bucket
Issue: Bucket allows public read access
Risk: Sensitive data exposure
Remediation: Apply bucket policy to restrict access to authorized users only
Duration: 10 weeks
Role: Security Automation Engineer
Technologies: Python, AWS, Boto3, Lambda
Focus Area: Security Automation
Scan Coverage (100%)
Compliance Score (97%)
Automation Rate (95%)