AWS, GCP, Azure security auditing, IaC scanning, IAM analysis, network security, compliance mapping. Use when auditing cloud infrastructure for security gaps.
How this skill is triggered — by the user, by Claude, or both
Slash command
/security-compliance-pro:cloud-security-auditorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill audits Infrastructure as Code (IaC) templates (Terraform, CloudFormation, Pulumi) and active cloud configurations (AWS, GCP, Azure) for security vulnerabilities. It analyzes IaC configurations for misconfigurations (e.g., public S3 buckets, open security groups, unencrypted volumes), checks IAM rules for over-privileged roles, unused permissions, and privilege escalation paths, audit...
This skill audits Infrastructure as Code (IaC) templates (Terraform, CloudFormation, Pulumi) and active cloud configurations (AWS, GCP, Azure) for security vulnerabilities. It analyzes IaC configurations for misconfigurations (e.g., public S3 buckets, open security groups, unencrypted volumes), checks IAM rules for over-privileged roles, unused permissions, and privilege escalation paths, audits network security settings (VPC setups, security groups, NACLs), and verifies data protection policies (encryption at rest/transit, KMS key rotation, bucket policies). The objective is to provide a measurable assessment of cloud security alignment using CIS Benchmarks and NIST CSF frameworks.
Core principle: Insecure by default. Anything that is not explicitly authorized is forbidden, particularly in cloud environments.
NO IaC TEMPLATE CAN BE DEPLOYED TO PRODUCTION WITHOUT UNDERGOING SECURITY SCANNING AND BEING AUDITED AGAINST AT LEAST ONE CIS BENCHMARK CONTROL.
Any resource deployed without static configuration scanning is assumed to be insecure.
Use this when:
Use this ESPECIALLY when:
Don't skip when:
BEFORE proceeding:
Collect all IaC configuration files into a target directory. If using remote backends (e.g., S3 tfstate), ensure you have read access to the state files.
# Terraform security scan
cd terraform/
checkov -d . --framework terraform --output cli
# or
tfsec . --no-color --format json > tfsec-report.json
# CloudFormation security scan
cfn_nag_scan --input-path ./cloudformation/
# Checkov findings entry example with CIS mapping
- file: "main.tf:123"
resource: "aws_s3_bucket.assets"
check: "CKV_AWS_53"
severity: "CRITICAL"
# CIS AWS Foundations Benchmark 2.1.1
description: "S3 Bucket allows public ACL settings"
recommendation: "Attach an aws_s3_bucket_public_access_block resource"
status: "FAILED"
BEFORE proceeding:
Ensure the IaC scanning phase is completed and IAM resources (users, groups, roles, and policies) are cataloged.
AdministratorAccess policy.* or wildcard actions.*.iam:PassRole combined with ec2:RunInstances permissions.lambda:CreateFunction paired with iam:PassRole permissions.iam:CreateAccessKey permissions assigned to non-admin identities.# INSECURE IAM policy definition (will be caught during the scan)
resource "aws_iam_policy" "too_broad" {
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = ["s3:*", "ec2:*", "iam:*"] # Overly broad actions
Effect = "Allow"
Resource = "*" # Wildcard resource
}
]
})
}
# SECURE ALTERNATIVE:
# - Implement least privilege principles
# - Restrict resources to specific ARNs
# - Apply conditions (e.g., IP range restrictions)
BEFORE proceeding:
Confirm that VPC configuration files (subnets, security groups, network ACLs) are present in the IaC configuration or active cloud inventory.
0.0.0.0/0 or ::/0) pointing to management interfaces or databases: 22 (SSH), 3389 (RDP), 3306 (MySQL), 5432 (PostgreSQL), 6379 (Redis), 9200 (Elasticsearch).# Querying open security groups via AWS CLI
aws ec2 describe-security-groups \
--query "SecurityGroups[?IpPermissions[?contains(IpRanges[].CidrIp, '0.0.0.0/0')]]" \
--output table | grep -E "(GroupName|FromPort|CidrIp)"
network_findings:
public_port_22:
resource: "aws_security_group.bastion_sg"
port: 22
cidr: "0.0.0.0/0"
severity: "HIGH"
# CIS AWS Foundations Benchmark 4.1
remediation: "Restrict SSH access to specified corporate CIDR ranges only."
rds_public:
resource: "aws_db_instance.production_db"
publicly_accessible: true
severity: "CRITICAL"
remediation: "Set publicly_accessible to false and move RDS to a private subnet."
BEFORE proceeding:
Compile a listing of all active storage resources (buckets, database instances, key management stores, block storage volumes).
force_ssl parameters).Principal: "*" rules.# S3 Bucket encryption audit checklist
s3_buckets_checked = [
{"bucket": "prod-logs", "encryption": "AES256", "public_block": True, "status": "OK"},
{"bucket": "backup-data", "encryption": "NONE", "public_block": True, "status": "FAIL"},
{"bucket": "old-company-data", "encryption": "NONE", "public_block": False, "status": "CRITICAL"},
]
# KMS Key rotation checklist
kms_keys = [
{"key_id": "arn:aws:kms:us-east-1:xxx:key/yyy", "rotation": True, "auto_rotate": True},
{"key_id": "arn:aws:kms:us-east-1:xxx:key/zzz", "rotation": False, "auto_rotate": False},
]
BEFORE proceeding:
Consolidate findings from the IaC scan, IAM audit, network security check, and data protection review.
compliance_mapping:
finding: "S3 Bucket allows public access"
cis_id: "CIS AWS 2.1.1"
nist_csf: "PR.DS-1"
severity: "CRITICAL"
remediation: |
resource "aws_s3_bucket_public_access_block" "this" {
bucket = aws_s3_bucket.this.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
If you catch yourself thinking:
ALL OF THESE MEAN: STOP. Return to the relevant phase.
Watch for these redirections:
iam:PassRole permissions.When you see these: STOP. Return to the relevant phase.
| Excuse | Reality |
|---|---|
| "IaC scans are redundant for dev environments." | Vulnerabilities in dev configurations propagate to production via templates. Scan every stage. |
| "A public bucket is fine for static frontend code." | Open write access allows code injection. Use Origin Access Control (OAC) with a CDN. |
| "We will refactor the wildcard IAM policies later." | Legacy wildcards are rarely audited post-deployment. Enforce least privilege immediately. |
| "CIS rules are too complex for our organization." | Apply the Tier 1 baseline checks first to mitigate common cloud misconfigurations. |
| "The security group is protected because the subnet is private." | Subnet boundaries do not prevent lateral movement if hosts are compromised. Apply ingress filters. |
| "MFA is only necessary for production console logins." | Compromised credentials on any account can lead to data leaks or billing exploits. |
After completing this process:
Provides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub haj1t/senior-dev-squad-skills --plugin security-compliance-pro