You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Terraform a Secure AWS VPC using containing a App server, DB server, and Kali server to run cyber attack and defense sequences (IAM, CloudWatch, Systems Manager)
A comprehensive AWS-based cybersecurity training environment that simulates real-world attack and defense scenarios using Terraform Infrastructure as Code.
🎯 Overview
This project creates an isolated AWS environment where Red Team members can practice penetration testing while Blue Team members learn to detect, monitor, and respond to security threats. The infrastructure includes intentionally vulnerable applications, comprehensive monitoring, and realistic network segmentation.
📋 Prerequisites
Required Software
AWS CLI v2 - Command line interface for AWS
Terraform >= 1.0 - Infrastructure as Code tool
SSH Key Pair - For secure access (though we'll use Session Manager primarily)
AWS CLI Installation
Windows
# Download and install AWS CLI v2msiexec.exe/i https://awscli.amazonaws.com/AWSCLIV2.msi
macOS
# Using Homebrewbrew install awscli# Or download installercurl"https://awscli.amazonaws.com/AWSCLIV2.pkg" -o"AWSCLIV2.pkg"sudo installer -pkg AWSCLIV2.pkg -target /
# Find your public IP addresscurl ifconfig.me# Add /32 to the end for CIDR format# Example: 203.0.113.45/32
Step 5: Initialize and Deploy
# Initialize Terraformterraform init# Review the deployment planterraform plan# Deploy infrastructure (type 'yes' when prompted)terraform apply# Save outputs to fileterraform output -json> lab_outputs.json
🏗️ AWS Services Used
This lab utilizes the following AWS services:
🌐 VPC - Virtual Private Cloud for network isolation
🔒 EC2 - Virtual machines for Red/Blue team infrastructure
🛡️ Security Groups - Network-level firewall rules
🚪 Internet Gateway - Internet access for public subnet
🔄 NAT Gateway - Outbound internet for private subnets
📊 CloudWatch - Logging, monitoring, and alerting
📧 SNS - Email notifications for security alerts
🔐 IAM - Identity and Access Management for team members
📝 VPC Flow Logs - Network traffic analysis
🖥️ Systems Manager - Secure instance access via Session Manager
🔑 EC2 Key Pairs - SSH key management
🔐 Secure Access with AWS Session Manager
⚠️ IMPORTANT: NO SSH REQUIRED FOR SECURITY
This lab uses AWS Systems Manager Session Manager for secure access to instances. This eliminates the need for SSH connections, bastion hosts, or exposing SSH ports to the internet.
# View all connection informationterraform output connection_info# Get specific instance IDterraform output -raw connection_info| jq'.kali_id'
Session Manager Benefits
✅No SSH keys to manage
✅No bastion hosts required
✅All sessions logged in CloudTrail
✅IAM-based access control
✅No inbound ports needed
👥 Team Credentials
After deployment, team member credentials are generated and can be accessed securely:
# View all team credentials (sensitive output)terraform output team_credentials# Save credentials to JSON fileterraform output -json team_credentials> team_credentials.json
Terraform State:terraform.tfstate (managed by Terraform)
⚠️ Security Notice: This lab contains intentionally vulnerable applications. Use only in isolated environments and never expose to production networks.
🎯 Educational Purpose: Designed for cybersecurity training, incident response practice, and security tool evaluation in a controlled environment.
About
Terraform a Secure AWS VPC using containing a App server, DB server, and Kali server to run cyber attack and defense sequences (IAM, CloudWatch, Systems Manager)