| name | ikb42603-cloud-computing-security-essentials |
| description | Educational AWS cloud security labs covering IAM, encryption, network security, monitoring, and incident detection |
| triggers | ["how do I set up AWS IAM security labs","configure cloud security exercises with AWS","implement AWS encryption and key management practices","set up AWS CloudTrail and CloudWatch monitoring","create secure AWS VPC and network isolation","practice AWS security best practices in labs","configure AWS multi-tenancy security","implement AWS access control and security groups"] |
IKB42603 Cloud Computing Security Essentials
Skill by ara.so — Security Skills collection.
Overview
This is an educational repository containing hands-on AWS cloud security laboratory exercises. The labs cover five core areas of cloud security: account security and IAM, secure isolation and multitenancy, encryption and key management, access control and network security, and monitoring/logging/incident detection.
Each lab provides practical exercises to implement AWS security controls, understand security configurations, and develop secure cloud architectures.
Repository Structure
The repository follows a weekly lab structure:
IKB42603-CLOUD-COMPUTING-SECURITY-ESSENTIALS/
├── README.md
├── Lab0_Environment_Setup.md
├── Lab1_Account_Security_and_IAM.md
├── Lab2_Secure_Isolation_and_Multitenancy.md
├── Lab3_Encryption_and_Key_Management.md
├── Lab4_Access_Control_and_Network_Security.md
└── Lab5_Monitoring_Logging_and_Incident_Detection.md
Initial Setup
Clone the Repository
git clone https://github.com/<username>/IKB42603-CLOUD-COMPUTING-SECURITY-ESSENTIALS.git
cd IKB42603-CLOUD-COMPUTING-SECURITY-ESSENTIALS
Prerequisites
- AWS Account (Free Tier eligible)
- AWS CLI installed and configured
- Git for version control
- Basic understanding of cloud computing concepts
Configure AWS CLI
aws configure
Lab 1: Account Security and IAM
Key Concepts
- AWS Identity and Access Management (IAM)
- Multi-Factor Authentication (MFA)
- Least Privilege Principle
- IAM Users, Groups, and Roles
- IAM Policies
Creating IAM Users
aws iam create-user --user-name lab-user-1
aws iam create-access-key --user-name lab-user-1
aws iam attach-user-policy \
--user-name lab-user-1 \
--policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess
Creating IAM Groups
aws iam create-group --group-name Developers
aws iam add-user-to-group \
--user-name lab-user-1 \
--group-name Developers
aws iam attach-group-policy \
--group-name Developers \
--policy-arn arn:aws:iam::aws:policy/PowerUserAccess
Creating Custom IAM Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::lab-bucket-name",
"arn:aws:s3:::lab-bucket-name/*"
]
}
]
}
aws iam create-policy \
--policy-name S3ReadOnlyLabPolicy \
--policy-document file://s3-readonly-policy.json
Enabling MFA (Console-based)
MFA must be configured through the AWS Console for the root account and IAM users. Document the steps with screenshots.
Lab 2: Secure Isolation and Multitenancy
Creating a VPC
aws ec2 create-vpc \
--cidr-block 10.0.0.0/16 \
--tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=LabVPC}]'
aws ec2 create-subnet \
--vpc-id vpc-xxxxxxxxx \
--cidr-block 10.0.1.0/24 \
--availability-zone us-east-1a \
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=PublicSubnet}]'
aws ec2 create-subnet \
--vpc-id vpc-xxxxxxxxx \
--cidr-block 10.0.2.0/24 \
--availability-zone us-east-1a \
--tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=PrivateSubnet}]'
Creating Internet Gateway
aws ec2 create-internet-gateway \
--tag-specifications 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=LabIGW}]'
aws ec2 attach-internet-gateway \
--internet-gateway-id igw-xxxxxxxxx \
--vpc-id vpc-xxxxxxxxx
Configuring Route Tables
aws ec2 create-route-table \
--vpc-id vpc-xxxxxxxxx \
--tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=PublicRouteTable}]'
aws ec2 create-route \
--route-table-id rtb-xxxxxxxxx \
--destination-cidr-block 0.0.0.0/0 \
--gateway-id igw-xxxxxxxxx
aws ec2 associate-route-table \
--route-table-id rtb-xxxxxxxxx \
--subnet-id subnet-xxxxxxxxx
Lab 3: Encryption and Key Management
Creating KMS Keys
aws kms create-key \
--description "Lab encryption key" \
--key-usage ENCRYPT_DECRYPT \
--origin AWS_KMS
aws kms create-alias \
--alias-name alias/lab-key \
--target-key-id <key-id>
aws kms list-keys
Encrypting Data with KMS
echo "Sensitive lab data" > plaintext.txt
aws kms encrypt \
--key-id alias/lab-key \
--plaintext fileb://plaintext.txt \
--output text \
--query CiphertextBlob | base64 --decode > encrypted.bin
aws kms decrypt \
--ciphertext-blob fileb://encrypted.bin \
--output text \
--query Plaintext | base64 --decode > decrypted.txt
S3 Bucket Encryption
aws s3api create-bucket \
--bucket lab-encrypted-bucket-$(date +%s) \
--region us-east-1
aws s3api put-bucket-encryption \
--bucket lab-encrypted-bucket-$(date +%s) \
--server-side-encryption-configuration '{
"Rules": [{
"ApplyServerSideEncryptionByDefault": {
"SSEAlgorithm": "aws:kms",
"KMSMasterKeyID": "alias/lab-key"
}
}]
}'
EBS Volume Encryption
aws ec2 create-volume \
--availability-zone us-east-1a \
--size 10 \
--volume-type gp3 \
--encrypted \
--kms-key-id alias/lab-key \
--tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=EncryptedVolume}]'
Lab 4: Access Control and Network Security
Creating Security Groups
aws ec2 create-security-group \
--group-name WebServerSG \
--description "Security group for web servers" \
--vpc-id vpc-xxxxxxxxx
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxxxxxx \
--protocol tcp \
--port 80 \
--cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxxxxxx \
--protocol tcp \
--port 443 \
--cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress \
--group-id sg-xxxxxxxxx \
--protocol tcp \
--port 22 \
--cidr ${YOUR_IP}/32
Network ACLs
aws ec2 create-network-acl \
--vpc-id vpc-xxxxxxxxx \
--tag-specifications 'ResourceType=network-acl,Tags=[{Key=Name,Value=LabNACL}]'
aws ec2 create-network-acl-entry \
--network-acl-id acl-xxxxxxxxx \
--ingress \
--rule-number 100 \
--protocol tcp \
--port-range From=80,To=80 \
--cidr-block 0.0.0.0/0 \
--rule-action allow
aws ec2 create-network-acl-entry \
--network-acl-id acl-xxxxxxxxx \
--egress \
--rule-number 100 \
--protocol -1 \
--cidr-block 0.0.0.0/0 \
--rule-action allow
Launching EC2 Instance with Security
aws ec2 run-instances \
--image-id ami-xxxxxxxxx \
--instance-type t2.micro \
--key-name lab-key-pair \
--security-group-ids sg-xxxxxxxxx \
--subnet-id subnet-xxxxxxxxx \
--associate-public-ip-address \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=LabWebServer}]'
Lab 5: Monitoring, Logging, and Incident Detection
Enabling CloudTrail
aws s3api create-bucket \
--bucket cloudtrail-logs-$(date +%s) \
--region us-east-1
aws cloudtrail create-trail \
--name lab-trail \
--s3-bucket-name cloudtrail-logs-$(date +%s)
aws cloudtrail start-logging --name lab-trail
aws cloudtrail get-trail-status --name lab-trail
CloudWatch Alarms
aws cloudwatch put-metric-alarm \
--alarm-name high-cpu-usage \
--alarm-description "Alarm when CPU exceeds 80%" \
--metric-name CPUUtilization \
--namespace AWS/EC2 \
--statistic Average \
--period 300 \
--threshold 80 \
--comparison-operator GreaterThanThreshold \
--evaluation-periods 2 \
--dimensions Name=InstanceId,Value=i-xxxxxxxxx
CloudWatch Logs
aws logs create-log-group --log-group-name /aws/lab/application
aws logs create-log-stream \
--log-group-name /aws/lab/application \
--log-stream-name instance-logs
aws logs filter-log-events \
--log-group-name /aws/lab/application \
--filter-pattern "ERROR" \
--start-time $(date -d '1 hour ago' +%s)000
AWS Config for Compliance
aws configservice put-configuration-recorder \
--configuration-recorder name=lab-config,roleARN=arn:aws:iam::ACCOUNT-ID:role/config-role
aws configservice start-configuration-recorder \
--configuration-recorder-name lab-config
aws configservice put-delivery-channel \
--delivery-channel name=lab-delivery,s3BucketName=config-bucket-name
Common Patterns
Lab Documentation Template
Each lab should include:
## Lab X: [Title]
### Objective
[What you will learn]
### Prerequisites
- AWS Account configured
- AWS CLI installed
- [Other requirements]
### Step-by-Step Implementation
#### Step 1: [Task Name]
[Explanation]
```bash
# Commands here
Step 2: [Task Name]
[Explanation]
Screenshots

Challenges Encountered
- [Issue 1 and resolution]
- [Issue 2 and resolution]
Lessons Learned
- [Key takeaway 1]
- [Key takeaway 2]
References
- [AWS Documentation links]
### Git Workflow
```bash
# Check status
git status
# Add changes
git add .
# Commit with meaningful message
git commit -m "Complete Lab X: [Description]"
# Push to repository
git push origin main
Troubleshooting
AWS CLI Access Denied
aws sts get-caller-identity
cat ~/.aws/credentials
aws configure
Security Group Not Working
aws ec2 describe-security-groups --group-ids sg-xxxxxxxxx
CloudTrail Not Logging
aws cloudtrail get-trail-status --name lab-trail
aws s3api get-bucket-policy --bucket cloudtrail-logs-bucket-name
aws cloudtrail start-logging --name lab-trail
KMS Encryption Failures
aws kms get-key-policy \
--key-id alias/lab-key \
--policy-name default
aws kms describe-key --key-id alias/lab-key
Best Practices
- Always use IAM roles instead of embedding credentials
- Enable MFA on root and privileged accounts
- Apply least privilege principle to all IAM policies
- Enable encryption at rest for all data stores
- Use Security Groups as firewalls with default deny
- Enable CloudTrail logging in all regions
- Set up CloudWatch alarms for security events
- Regular security audits using AWS Config
- Tag all resources for better organization and cost tracking
- Document everything with screenshots and explanations
Environment Variables
Reference AWS credentials through environment variables:
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
Never hardcode credentials in scripts or code.
Additional Resources