Skip to content

Lab 01 — Build Your Cloud Pentesting Lab

Item Details
Lab ID CPS-LAB-001
Difficulty Beginner
Duration 2–3 Hours
Cloud Provider AWS Free Tier
Tools Required AWS CLI, Kali Linux, Docker, Terraform, VS Code
Estimated Cost Free Tier Eligible (≤ $5 if resources are not cleaned up)

Welcome to your first Cloud Offensive Security lab.

Unlike traditional penetration testing, cloud pentesting requires an environment where you can safely deploy cloud infrastructure, practice reconnaissance, enumerate resources and assess cloud security controls.

By the end of this lab, you will have your own Cloud Pentesting Lab that will be used throughout the remainder of this learning path.

This environment mirrors what professional cloud penetration testers use during internal assessments and client engagements.


After completing this lab, you will be able to:

  • Build a cloud pentesting workstation.
  • Configure AWS CLI securely.
  • Deploy a dedicated AWS penetration testing account.
  • Install essential cloud security tools.
  • Verify access to AWS APIs.
  • Create a repeatable cloud testing environment.
  • Understand the lab architecture used throughout this course.

You have joined CloudNova Technologies as a Junior Cloud Penetration Tester.

Your team performs cloud security assessments against development and staging environments.

Before participating in customer engagements, every consultant must build a standardised cloud penetration testing workstation.

Your task is to prepare your environment.


Internet
┌────────────────────────┐
│ Kali Linux Machine │
│------------------------│
│ AWS CLI │
│ Azure CLI │
│ Google Cloud CLI │
│ Docker │
│ Terraform │
│ kubectl │
│ Git │
│ VS Code │
│ Trivy │
│ ScoutSuite │
└──────────┬────────────┘
Secure AWS Authentication
AWS Free Tier Account
AWS Services Used Later
┌────────────────────────┐
│ IAM │
│ EC2 │
│ S3 │
│ VPC │
│ Lambda │
│ EKS │
└────────────────────────┘

You should have:

  • AWS Free Tier Account
  • MFA enabled
  • Kali Linux (VM or physical machine)
  • Internet connection
  • VS Code installed
  • Git installed

Create a dedicated workspace.

Terminal window
mkdir ~/cloud-pentesting-lab
cd ~/cloud-pentesting-lab

Expected Output

cloud-pentesting-lab/

Verify installation.

Terminal window
aws --version

Expected Output

aws-cli/2.x.x

If AWS CLI is missing, install it.

Ubuntu/Kali

Terminal window
sudo apt update
sudo apt install awscli -y

Run:

Terminal window
aws configure

Enter:

AWS Access Key
AWS Secret Key
Region
Output Format

Example

Region
ap-south-1

Run

Terminal window
aws sts get-caller-identity

Expected Output

{
"Account":"123456789012",
"Arn":"arn:aws:iam::123456789012:user/student"
}

Verify Docker.

Terminal window
docker --version

If missing:

Terminal window
sudo apt install docker.io -y

Enable Docker.

Terminal window
sudo systemctl enable docker
sudo systemctl start docker

Verify installation.

Terminal window
kubectl version --client

Expected Output

Client Version

Verify installation.

Terminal window
terraform version

Expected Output

Terraform v1.x

Terraform will be used throughout upcoming labs.


Verify Git.

Terminal window
git --version

Expected Output

git version 2.x

Verify VS Code launches successfully.

Useful extensions:

  • Terraform
  • Docker
  • Kubernetes
  • YAML
  • GitHub Copilot
  • Markdown All in One

Install Trivy.

Terminal window
sudo apt install wget -y
wget https://github.com/aquasecurity/trivy/releases/latest/download/trivy_0.64.1_Linux-64bit.deb
sudo dpkg -i trivy_*.deb

Verify.

Terminal window
trivy version

Install ScoutSuite.

Terminal window
pip install scoutsuite

Verify.

Terminal window
scout --help

ScoutSuite will later assess AWS security posture.


Run:

Terminal window
aws iam list-users

If successful, AWS connectivity is working.

If Access Denied appears, review IAM permissions before proceeding.


Mission 13 — Create Lab Folder Structure

Section titled “Mission 13 — Create Lab Folder Structure”

Create folders.

Terminal window
mkdir tools
mkdir reports
mkdir screenshots
mkdir terraform
mkdir scripts
mkdir notes

Verify.

Terminal window
tree

Expected Output

cloud-pentesting-lab/
├── notes
├── reports
├── screenshots
├── scripts
├── terraform
└── tools

Run.

Terminal window
aws --version
docker --version
kubectl version --client
terraform version
git --version
trivy version

Everything should execute successfully.


Run.

Terminal window
curl https://aws.amazon.com

Expected Output

<HTML...

Verify:

  • AWS Account created
  • MFA enabled
  • AWS CLI configured
  • Docker installed
  • Terraform installed
  • kubectl installed
  • Git installed
  • VS Code installed
  • Trivy installed
  • ScoutSuite installed
  • Lab folders created
  • AWS authentication successful

Check credentials.

Terminal window
aws configure

Verify:

Terminal window
aws sts get-caller-identity

Run.

Terminal window
sudo usermod -aG docker $USER

Log out and log back in.


Verify PATH.

Terminal window
terraform version

Reinstall kubectl and verify.

Terminal window
kubectl version --client

Without referring to the instructions:

  • Configure AWS CLI from scratch.
  • Verify authentication.
  • Create the lab directory structure.
  • Install Terraform.
  • Install Trivy.
  • Install Docker.
  • Verify every tool.

Document your results.


1. Why should cloud penetration testers use a dedicated AWS account?

Section titled “1. Why should cloud penetration testers use a dedicated AWS account?”

Answer: To safely perform authorised testing without affecting production resources or personal cloud environments.


Answer: It enables interaction with AWS services through authenticated API calls, allowing testers to enumerate resources, validate permissions and automate assessments.


Answer: Terraform allows infrastructure to be deployed, modified and removed consistently using Infrastructure as Code (IaC), making labs repeatable and easier to manage.


Answer: Trivy scans container images, file systems and Infrastructure as Code for known vulnerabilities and misconfigurations.


Answer: ScoutSuite performs automated cloud security posture assessments, identifying insecure configurations and providing recommendations for improvement.


  • A professional cloud pentesting workstation includes cloud CLIs, container tooling, Infrastructure as Code tools and security assessment utilities.
  • AWS CLI authentication is the foundation for interacting with AWS services during assessments.
  • Using a structured lab environment improves consistency and repeatability across penetration testing engagements.
  • Tools such as Terraform, Docker, Trivy and ScoutSuite are commonly used in enterprise cloud security assessments.
  • This lab environment will be reused throughout the AWS, Azure and Google Cloud penetration testing modules.

In the next lab, you will begin Lab 02 — Cloud Reconnaissance, where you will perform passive and active reconnaissance against a controlled cloud environment, discover cloud assets and map the attack surface just as a professional Cloud Penetration Tester would.

➡️ Next Lab: Lab 02 — Cloud Reconnaissance