This project demonstrates how to build a secure AWS environment for deploying a simple web application using an EC2 instance. Key AWS security services are integrated to protect resources, monitor threats, and ensure compliance.
By the end of this project, you will have:
- A VPC with public and private subnets protected by NACLs.
- An EC2 instance running a web server with an attached IAM role and Security Group.
- Monitoring via CloudWatch with alarms for CPU and logs.
- Threat detection using GuardDuty.
- Security posture management using Security Hub.
- Investigations enabled with AWS Detective.
- DDoS protection via AWS Shield.
- An active AWS Free Tier account.
- Basic familiarity with AWS Management Console.
- (Optional) AWS CLI installed for verification.
- Create a new repository:
aws-cloud-security-project. - Clone locally:
git clone https://github.com/yourusername/aws-cloud-security-project.git
- Inside the repo, create a
screenshots/folder for images. - Document your steps in this README using screenshots:

- Commit and push changes:
git add . git commit -m "Initial project setup" git push
Estimated Time: 2-3 hours
Cost: Minimal (Free Tier eligible; monitor via AWS Cost Explorer)
Cleanup: Delete all resources after the project to avoid charges.
Create a custom IAM role for EC2 with least-privilege access (e.g., AmazonS3ReadOnlyAccess for logs).
Screenshot:

- Create a VPC named
SecureWeb-VPCwith CIDR10.0.0.0/16. - Create public and private subnets (
10.0.1.0/24and10.0.2.0/24). - Configure NACLs:
- Allow HTTP (80) and all traffic inbound from
0.0.0.0/0. - Allow ephemeral ports outbound (1024–65535).
- Allow HTTP (80) and all traffic inbound from
Screenshot:

- Launch an EC2 instance (
t3.micro) in the public subnet. - Attach
EC2-WebApp-Role. - Security Group (WebServer-SG):
- Inbound: SSH (22) from your IP, HTTP (80) from anywhere.
- Outbound: all traffic.
- Install Apache web server:
sudo yum update -y sudo yum install -y httpd sudo systemctl start httpd sudo systemctl enable httpd - Test locally:
curl localhost
Screenshot:

- Create a log group
/aws/ec2/SecureWebServer. - Enable detailed monitoring for the EC2 instance.
- Create an alarm for CPU >= 80%.
Screenshot:

- Enable GuardDuty for threat detection (recon, crypto-mining, etc.).
- Optionally export findings to S3.
Screenshot:

- Enable Security Hub and select AWS Foundational Security Best Practices.
- View compliance score and control list.
Screenshot:

- Enable Detective to investigate findings from GuardDuty and Security Hub.
- View entity relationship graphs.
Screenshot:

- Standard protection is automatic.
- For Advanced (optional):
- Protect your EC2 instance.
- Enable proactive engagement if subscribed.
Screenshot:

- Delete EC2, VPC, subnets, Security Groups, IAM role, CloudWatch alarms/logs, GuardDuty, Security Hub, Detective, and Shield (if Advanced enabled) to avoid charges.