AWS CLI
Purpose
Use this skill for tightly scoped AWS control-plane validation when the engagement includes approved AWS credentials or roles.
Phase Fit
- Primary: Discovery and Reconnaissance, Vulnerability Analysis
- Secondary: Validation and Controlled Impact Demonstration, Retest and Closure
Use When
- Need to confirm identity, account scope, or accessible services.
- Need to validate whether an approved principal can reach sensitive resources.
- Need a low-impact retest after cloud hardening changes.
Avoid When
- AWS scope or credential authorization is unclear.
- Commands would mutate state without explicit approval.
Inputs
- Approved profile or role
- Named account and region scope
- Read-only versus state-changing boundaries
Procedure
- Start by confirming identity and account context.
- Keep service queries narrowly aligned to the current hypothesis.
- Prefer read-only inspection over state-changing actions.
- Record only the permissions or exposures that materially change risk.
- Preserve the exact profile and region scope for retest.
Command Syntax
Replace sample profiles, regions, and resource names with approved in-scope values.
# Verify effective identity and account
aws sts get-caller-identity --profile pentest
# List S3 buckets
aws s3 ls --profile pentest
# List contents of a bucket
aws s3 ls s3://contoso-prod-backup --profile pentest --recursive
# Download a file from S3
aws s3 cp s3://contoso-prod-backup/config.env ./config.env --profile pentest
# List IAM users
aws iam list-users --profile pentest
# Get attached policies for a user
aws iam list-attached-user-policies --user-name developer --profile pentest
# List EC2 instances
aws ec2 describe-instances --profile pentest --region us-east-1 --output table
# Get a Secrets Manager value
aws secretsmanager get-secret-value --secret-id prod/contoso/dbpass --profile pentest
Evidence to Capture
- Effective identity and account scope of the approved principal
- Resource access that materially affects risk
- Exact profile, region, and service context used
Safety Boundaries
- Default to read-only validation.
- Do not create, modify, or delete resources without explicit written approval.