This repository implements security best practices for a data engineering platform on AWS. Security is a top priority, and this document outlines the measures taken to protect the infrastructure and data.
- No SSH Access: EC2 instances have NO SSH access configured for security
- Restrictive Security Groups: Only necessary ports are opened
- Private Networking: Instances use private IPs where possible
- Firewall Configuration: UFW firewall enabled with deny-by-default policy
- AWS Systems Manager: Secure access via Session Manager instead of SSH
- IAM Roles: Least privilege access with specific S3 permissions
- No Public Keys: No SSH key pairs associated with instances
- Instance Profiles: Secure credential management for AWS services
- EBS Encryption: All storage volumes are encrypted at rest
- S3 Security: Bucket access restricted to specific IAM roles
- CloudWatch Logging: Comprehensive monitoring and logging
- Automatic Updates: Security patches applied automatically
- Local Binding: Airflow web UI only accessible on localhost (127.0.0.1)
- Authentication: Password-based authentication enabled
- Secure Configuration: Hardened airflow.cfg with security settings
- Service Isolation: Airflow runs as dedicated user with limited privileges
- Random Passwords: Admin passwords generated securely
- No Hardcoded Secrets: All sensitive data managed via AWS services
- Environment Isolation: Virtual environments for Python dependencies
- Secure Defaults: Security-first configuration templates
- GitHub Secrets: AWS credentials stored as encrypted repository secrets
- No Credentials in Code: Zero tolerance for hardcoded credentials
- Comprehensive .gitignore: Prevents accidental commit of sensitive files
- Branch Protection: Main branch protected from direct pushes
- Review Requirements: Changes require review before merge
- Automated Scanning: Security vulnerabilities detected automatically
Since SSH is disabled for security, use these methods to access EC2 instances:
# Install AWS CLI and configure credentials
aws configure
# Start secure session
aws ssm start-session --target <INSTANCE_ID>- Go to EC2 β Instances
- Select your instance
- Click "Connect" β "Session Manager"
- Click "Connect"
The Airflow web UI is only accessible locally for security. To access it:
# Forward local port 8080 to instance
aws ssm start-session \
--target <INSTANCE_ID> \
--document-name AWS-StartPortForwardingSession \
--parameters '{"portNumber":["8080"],"localPortNumber":["8080"]}'Then access http://localhost:8080 in your browser.
- Never commit secrets: Use environment variables or AWS services
- Regular updates: Keep dependencies and systems updated
- Least privilege: Request only necessary permissions
- Code review: All changes must be reviewed
- Secure coding: Follow OWASP guidelines
- Monitor access: Review CloudWatch logs regularly
- Rotate credentials: Regular rotation of access keys
- Backup strategy: Secure backup and recovery procedures
- Incident response: Have a plan for security incidents
- Compliance: Follow industry standards and regulations
- Network segmentation: Isolate different environments
- Encryption everywhere: Encrypt data at rest and in transit
- Access logging: Log all access attempts
- Regular audits: Periodic security assessments
- Disaster recovery: Test recovery procedures regularly
If you discover a security vulnerability, please report it responsibly:
- Do NOT create a public GitHub issue
- Contact the repository maintainer directly
- Provide detailed information about the vulnerability
- Allow time for the issue to be addressed before disclosure
Before deploying to production, ensure:
- All secrets are managed via AWS services or GitHub Secrets
- No hardcoded credentials in code
- Security groups follow least privilege principle
- EBS volumes are encrypted
- CloudWatch logging is enabled
- Systems Manager agent is installed and running
- Firewall is configured and enabled
- Automatic security updates are enabled
- IAM roles follow least privilege principle
- No SSH keys are associated with instances
This infrastructure follows:
- AWS Well-Architected Framework - Security Pillar
- NIST Cybersecurity Framework
- CIS Controls for AWS
- OWASP Top 10 for application security
- AWS CloudWatch for monitoring and logging
- AWS Systems Manager for secure access
- UFW firewall for network protection
- Automatic security updates
- AWS GuardDuty for threat detection
- AWS Config for compliance monitoring
- AWS Security Hub for centralized security findings
- AWS Inspector for vulnerability assessments
-
Immediate Response
- Isolate affected systems
- Preserve evidence
- Document the incident
-
Investigation
- Review CloudWatch logs
- Check access patterns
- Identify scope of impact
-
Recovery
- Apply security patches
- Rotate compromised credentials
- Update security configurations
-
Post-Incident
- Conduct lessons learned
- Update security procedures
- Implement additional controls
For security-related questions or concerns:
- Repository Maintainer: Amado Roque
- LinkedIn: Amado Roque
Remember: Security is everyone's responsibility. When in doubt, choose the more secure option.