This project involves setting up a cloud homelab using AWS as the host and Terraform to provision the infrastructure. The lab includes three machines: Kali Linux, Ubuntu Security Tools, and Windows Server 2022, enabling a practical environment for cloud and cybersecurity exploration.
This project involves setting up a cloud-based homelab using AWS as the host and Terraform for infrastructure automation. The environment includes three virtual machines:
- Kali Linux
- Ubuntu
- Windows Server 2022
The project utilizes Ubuntu through WSL for configuration.
- Go to IAM Dashboard > Users > Add User.
- Assign a name to the user and attach the following policies:
VPCFullAccess
(to create the VPC).EC2FullAccess
(to create and manage EC2 instances).
- After creating the user:
- Navigate to Security Credentials and create an access key.
- Copy both the Access Key and Secret Access Key. The Secret Access Key is displayed only once—store it securely.
Run the following commands in the WSL Ubuntu terminal:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
-
Ensure the AWS configuration files (
.aws/credentials
and.aws/config
) are in place. -
Ensure that your credentials file has your access keys from the IAM user.
-
Clone the homelab repository:
git clone https://github.com/caol777/Cloud-Homelab.git cd Cloud-Homelab
-
Generate an RSA key pair in AWS (ensure the format is
.pem
) and store it in the.ssh
directory.
- Initialize Terraform:
terraform init
- Plan the infrastructure:
terraform plan
- Apply the configuration:
terraform apply -var="aws-RSA-key"
- Replace
"aws-RSA-key"
with the name of the RSA key pair. - Ensure the region is set to
us-east-2
.
- Replace
- If using marketplace images (e.g., Kali, Ubuntu), accept their terms before deployment.
Follow provided setup instructions to access the machine.
-
Change the password of the machine, enable xrdp and check that its running
-
Now you can connect to the kali machine using rdp on your windows client with the credentials kali:kali
- Use the instance's IP address (from Terraform output) in a browser.
- Log in using the EC2 instance ID.
- Change the VNC password if needed.
- Go to the EC2 Dashboard, right-click the Windows instance, and select Connect.
- Under RDP Client, retrieve the password:
- Upload the private key stored in
.ssh
. - Use the default username
Administrator
. - Copy the password
- Upload the private key stored in
- Use an RDP client to connect to the machine.
- Make sure to disable the firewall and windows defender to make sure our splunk configuration will work.
- Download and install Splunk Enterprise:
sudo dpkg -i splunk-deb cd /opt/splunk/bin sudo ./splunk start
- Log in using admin credentials.
- Navigate to Settings > Forwarding and Receiving > Configure Receiving:
- Add a new port (e.g.,
9997
).
- Add a new port (e.g.,
-
Download and install the Universal Forwarder.
-
During installation, customize options as required.
-
For this step make sure to grab the IP address from the Ubuntu security box using ip a in the terminal and use the default port 9997.
-
On the Ubuntu Splunk instance:
- Create a new index: Settings > Indexes > New Index (e.g.,
win-security
).
- Create a new index: Settings > Indexes > New Index (e.g.,
-
On the Windows instance:
- Navigate to
C:\Program Files\SplunkUniversalForwarder\etc\system\local
. - Copy
outputs.conf
and rename it toinputs.conf
. - Edit
inputs.conf
to include:[WinEventLog://Security] index = win-security disabled = 0
- Navigate to
-
Restart Splunk:
cd C:\Program Files\SplunkUniversalforwarder\bin splunk.exe restart
-
Verify data in Splunk by searching for
index="win-security"
.
- Install Nessus:
dpkg -i "Nessus-[version number]-debian6_amd64.deb" sudo systemctl start nessusd.service
- Save the activation code during installation.
- Ensure SSH keys and AWS credentials are securely stored.
- Address any deployment issues by reviewing Terraform logs or AWS Marketplace terms.