MCPInstall

cloud-security

Use when assessing cloud infrastructure for security misconfigurations, IAM privilege escalation paths, S3 public exposure, open security group rules, or IaC security gaps. Covers AWS, Azure, and GCP posture assessment with MITRE ATT&CK mapping.

Installs
645
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/alirezarezvani/claude-skills --skill cloud-security
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads cloud-security automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Cloud Security

Cloud security posture assessment skill for detecting IAM privilege escalation, public storage exposure, network configuration risks, and infrastructure-as-code misconfigurations. This is NOT incident response for active cloud compromise (see incident-response) or application vulnerability scanning (see security-pen-testing) — this is about systematic cloud configuration analysis to prevent exploitation.


Table of Contents


Overview

What This Skill Does

This skill provides the methodology and tooling for cloud security posture management (CSPM) — systematically checking cloud configurations for misconfigurations that create exploitable attack surface. It covers IAM privilege escalation paths, storage public exposure, network over-permissioning, and infrastructure code security.

Distinction from Other Security Skills

SkillFocusApproach
cloud-security (this)Cloud configuration riskPreventive — assess before exploitation
incident-responseActive cloud incidentsReactive — triage confirmed cloud compromise
threat-detectionBehavioral anomaliesProactive — hunt for attacker activity in cloud logs
security-pen-testingApplication vulnerabilitiesOffensive — actively exploit found weaknesses

Prerequisites

Read access to IAM policy documents, S3 bucket configurations, and security group rules in JSON format. For continuous monitoring, integrate with cloud provider APIs (AWS Config, Azure Policy, GCP Security Command Center).


Cloud Posture Check Tool

The cloud_posture_check.py tool runs three types of checks: iam (privilege escalation), s3 (public access), and sg (network exposure). It auto-detects the check type from the config file structure or accepts explicit --check flags.

# Analyze an IAM policy for privilege escalation paths
python3 scripts/cloud_posture_check.py policy.json --check iam --json

# Assess S3 bucket configuration for public access
python3 scripts/cloud_posture_check.py bucket_config.json --check s3 --json

# Check security group rules for open admin ports
python3 scripts/cloud_posture_check.py sg.json --check sg --json

# Run all checks with internet-facing severity bump
python3 scripts/cloud_posture_check.py config.json --check all \
  --provider aws --severity-modifier internet-facing --json

# Regulated data context (bumps severity by one level for all findings)
python3 scripts/cloud_posture_check.py config.json --check all \
  --severity-modifier regulated-data --json

# Pipe IAM policy from AWS CLI
aws iam get-policy-version --policy-arn arn:aws:iam::123456789012:policy/MyPolicy \
  --version-id v1 | jq '.PolicyVersion.Document' | \
  python3 scripts/cloud_posture_check.py - --check iam --json

Exit Codes

CodeMeaningRequired Action
0No high/critical findingsNo action required
1High-severity findingsRemediate within 24 hours
2Critical findingsRemediate immediately — escalate to incident-response if active

IAM Policy Analysis

IAM analysis detects privilege escalation paths, overprivileged grants, public principal exposure, and data exfiltration risk.

Privilege Escalation Patterns

PatternSeverityKey Action CombinationMITRE
Lambda PassRole escalationCriticaliam:PassRole + lambda:CreateFunctionT1078.004
EC2 instance profile abuseCriticaliam:PassRole + ec2:RunInstancesT1078.004
CloudFormation PassRoleCriticaliam:PassRole + cloudformation:CreateStackT1078.004
Self-attach policy escalationCriticaliam:AttachUserPolicy + sts:GetCallerIdentityT1484.001
Inline policy self-escalationCriticaliam:PutUserPolicy + sts:GetCallerIdentityT1484.001
Policy version backdoorCriticaliam:CreatePolicyVersion + iam:ListPoliciesT1484.001
Credential harvestingHighiam:CreateAccessKey + iam:ListUsersT1098.001
Group membership escalationHighiam:AddUserToGroup + iam:ListGroupsT1098
Password reset attackHighiam:UpdateLoginProfile + iam:ListUsersT1098
Service-level wildcardHighiam:* or s3:* or ec2:*T1078.004

IAM Finding Severity Guide

Finding TypeConditionSeverity
Full admin wildcardAction=* Resource=*Critical
Public principalPrincipal: '*'Critical
Dangerous action comboTwo-action escalation pathCritical
Individual priv-esc actionsOn wildcard resourceHigh
Data exfiltration actionss3:GetObject, secretsmanager:GetSecretValue on *High
Service wildcardservice:* actionHigh
Data actions on named resourceAppropriate scopeLow/Clean

Least Privilege Recommendations

For every critical or high finding, the tool outputs a least_privilege_suggestion field with specific remediation guidance:

  • Replace Action: * with a named list of required actions
  • Replace Resource: * with specific ARN patterns
  • Use AWS Access Analyzer to identify actually-used permissions
  • Separate dangerous action combinations into different roles with distinct trust policies

S3 Exposure Assessment

S3 assessment checks four dimensions: public access block configuration, bucket ACL, bucket policy principal exposure, and default encryption.

S3 Configuration Check Matrix

CheckFinding ConditionSeverity
Public access blockAny of four flags missing/falseHigh
Bucket ACLpublic-read-writeCritical
Bucket ACLpublic-read or authenticated-readHigh
Bucket policy Principal"Principal": "*" with AllowCritical
Default encryptionNo ServerSideEncryptionConfigurationHigh
Default encryptionNon-standard SSEAlgorithmMedium
No PublicAccessBlockConfigurationStatus unknownMedium

Recommended S3 Baseline Configuration

{
  "PublicAccessBlockConfiguration": {
    "BlockPublicAcls": true,
    "BlockPublicPolicy": true,
    "IgnorePublicAcls": true,
    "RestrictPublicBuckets": true
  },
  "ServerSideEncryptionConfiguration": {
    "Rules": [{
      "ApplyServerSideEncryptionByDefault": {
        "SSEAlgorithm": "aws:kms",
        "KMSMasterKeyID": "arn:aws:kms:region:account:key/key-id"
      },
      "BucketKeyEnabled": true
    }]
  },
  "ACL": "private"
}

All four public access block settings must be enabled at both the bucket level and the AWS account level. Account-level settings can be overridden by bucket-level settings if not both enforced.


Security Group Analysis

Security group analysis flags inbound rules that expose admin ports, database ports, or all traffic to internet CIDRs (0.0.0.0/0, ::/0).

Critical Port Exposure Rules

PortServiceFinding SeverityRemediation
22SSHCriticalRestrict to VPN CIDR or use AWS Systems Manager Session Manager
3389RDPCriticalRestrict to VPN CIDR or use AWS Fleet Manager
0–65535 (all)All trafficCriticalRemove rule; add specific required ports only

High-Risk Database Port Rules

PortServiceFinding SeverityRemediation
1433MSSQLHighAllow from application tier SG only — move to private subnet
3306MySQLHighAllow from application tier SG only — move to private subnet
5432PostgreSQLHighAllow from application tier SG only — move to private subnet
27017MongoDBHighAllow from application tier SG only — move to private subnet
6379RedisHighAllow from application tier SG only — move to private subnet
9200ElasticsearchHighAllow from application tier SG only — move to private subnet

Severity Modifiers

Use --severity-modifier internet-facing when the assessed resource is directly internet-accessible (load balancer, API gateway, public EC2). Use --severity-modifier regulated-data when the resource handles PCI, HIPAA, or GDPR-regulated data. Both modifiers bump each finding's severity by one level.


IaC Security Review

Infrastructure-as-code review catches configuration issues at definition time, before deployment.

IaC Check Matrix

ToolCheck TypesWhen to Run
TerraformResource-level checks (aws_s3_bucket_acl, aws_security_group, aws_iam_policy_document)Pre-plan, pre-apply, PR gate
CloudFormationTemplate property validation (PublicAccessBlockConfiguration, SecurityGroupIngress)Template lint, deploy gate
Kubernetes manifestsContainer privileges, network policies, secret exposurePR gate, admission controller
Helm chartsSame as KubernetesPR gate

Terraform IAM Policy Example — Finding vs. Clean

# BAD: Will generate critical findings
resource "aws_iam_policy" "bad_policy" {
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Action   = "*"
      Resource = "*"
    }]
  })
}

# GOOD: Least privilege
resource "aws_iam_policy" "good_policy" {
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Action   = ["s3:GetObject", "s3:PutObject"]
      Resource = "arn:aws:s3:::my-specific-bucket/*"
    }]
  })
}

Full CSPM check reference: references/cspm-checks.md


Cloud Provider Coverage Matrix

Check TypeAWSAzureGCP
IAM privilege escalationFull (IAM policies, trust policies, ESCALATION_COMBOS)Partial (RBAC assignments, service principal risks)Partial (IAM bindings, workload identity)
Storage public accessFull (S3 bucket policies, ACLs, public access block)Partial (Blob SAS tokens, container access levels)Partial (GCS bucket IAM, uniform bucket-level access)
Network exposureFull (Security Groups, NACLs, port-level analysis)Partial (NSG rules, inbound port analysis)Partial (Firewall rules, VPC firewall)
IaC scanningFull (Terraform, CloudFormation)Partial (ARM templates, Bicep)Partial (Deployment Manager)

Workflows

Workflow 1: Quick Posture Check (20 Minutes)

For a newly provisioned resource or pre-deployment review:

# 1. Export IAM policy document
aws iam get-policy-version --policy-arn ARN --version-id v1 | \
  jq '.PolicyVersion.Document' > policy.json
python3 scripts/cloud_posture_check.py policy.json --check iam --json

# 2. Check S3 bucket configuration
aws s3api get-bucket-acl --bucket my-bucket > acl.json
aws s3api get-public-access-block --bucket my-bucket >> bucket.json
python3 scripts/cloud_posture_check.py bucket.json --check s3 --json

# 3. Review security groups for open admin ports
aws ec2 describe-security-groups --group-ids sg-123456 | \
  jq '.SecurityGroups[0]' > sg.json
python3 scripts/cloud_posture_check.py sg.json --check sg --json

Decision: Exit code 2 = block deployment and remediate. Exit code 1 = schedule remediation within 24 hours.

Workflow 2: Full Cloud Security Assessment (Multi-Day)

Day 1 — IAM and Identity:

  1. Export all IAM policies attached to production roles
  2. Run cloud_posture_check.py --check iam on each policy
  3. Map all privilege escalation paths found
  4. Identify overprivileged service accounts and roles
  5. Review cross-account trust policies

Day 2 — Storage and Network:

  1. Enumerate all S3 buckets and export configurations
  2. Run cloud_posture_check.py --check s3 --severity-modifier regulated-data for data buckets
  3. Export security group configurations for all VPCs
  4. Run cloud_posture_check.py --check sg for internet-facing resources
  5. Review NACL rules for network segmentation gaps

Day 3 — IaC and Continuous Integration:

  1. Review Terraform/CloudFormation templates in version control
  2. Check CI/CD pipeline for IaC security gates
  3. Validate findings against references/cspm-checks.md
  4. Produce remediation plan with priority ordering (Critical → High → Medium)

Workflow 3: CI/CD Security Gate

Integrate posture checks into deployment pipelines to prevent misconfigured resources reaching production:

# Validate IaC before terraform apply
terraform show -json plan.json | \
  jq '[.resource_changes[].change.after | select(. != null)]' > resources.json
python3 scripts/cloud_posture_check.py resources.json --check all --json
if [ $? -eq 2 ]; then
  echo "Critical cloud security findings — blocking deployment"
  exit 1
fi

# Validate existing S3 bucket before modifying
aws s3api get-bucket-policy --bucket "${BUCKET}" | jq '.Policy | fromjson' | \
  python3 scripts/cloud_posture_check.py - --check s3 \
  --severity-modifier regulated-data --json

Anti-Patterns

  1. Running IAM analysis without checking escalation combos — Individual high-risk actions in isolation may appear low-risk. The danger is in combinations: iam:PassRole alone is not critical, but iam:PassRole + lambda:CreateFunction is a confirmed privilege escalation path. Always analyze the full statement, not individual actions.
  2. Enabling only bucket-level public access block — AWS S3 has both account-level and bucket-level public access block settings. A bucket-level setting can override an account-level setting. Both must be configured. Account-level block alone is insufficient if any bucket has explicit overrides.
  3. Treating --severity-modifier internet-facing as optional for public resources — Internet-facing resources have significantly higher exposure than internal resources. High findings on internet-facing infrastructure should be treated as critical. Always apply --severity-modifier internet-facing for DMZ, load balancer, and API gateway configurations.
  4. Checking only administrator policies — Privilege escalation paths frequently originate from non-administrator policies that combine innocuous-looking permissions. All policies attached to production identities must be checked, not just policies with obvious elevated access.
  5. Remediating findings without root cause analysis — Removing a dangerous permission without understanding why it was granted will result in re-addition. Document the business justification for every high-risk permission before removing it, to prevent silent re-introduction.
  6. Ignoring service account over-permissioning — Service accounts are often over-provisioned during development and never trimmed for production. Every service account in production must be audited against AWS Access Analyzer or equivalent to identify and remove unused permissions.
  7. Not applying severity modifiers for regulated data workloads — A high finding in a general-purpose S3 bucket is different from the same finding in a bucket containing PHI or cardholder data. Always use --severity-modifier regulated-data when assessing resources in regulated data environments.

Cross-References

SkillRelationship
incident-responseCritical findings (public S3, privilege escalation confirmed active) may trigger incident classification
threat-detectionCloud posture findings create hunting targets — over-permissioned roles are likely lateral movement destinations
red-teamRed team exercises specifically test exploitability of cloud misconfigurations found in posture assessment
security-pen-testingCloud posture findings feed into the infrastructure security section of pen test assessments

FAQ

What does the cloud-security skill do?

Use when assessing cloud infrastructure for security misconfigurations, IAM privilege escalation paths, S3 public exposure, open security group rules, or IaC security gaps. Covers AWS, Azure, and GCP posture assessment with MITRE ATT&CK mapping.

How do I install cloud-security?

Run npx skills add https://github.com/alirezarezvani/claude-skills --skill cloud-security in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cloud-security/ (personal) or .claude/skills/cloud-security/ (project).

Which AI agents can use cloud-security?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is cloud-security safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains cloud-security?

It is published by alirezarezvani in alirezarezvani/claude-skills. It has 645 recorded installs.

More from alirezarezvani/claude-skills

View all →

engineering-skills

alirezarezvani/claude-skills

Index of the engineering-team skills bundle for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw, and 6 more tools. Architecture, frontend, backend, QA, DevOps, security, AI/ML, data engineering, Playwright, Stripe, AWS, MS365 (stdlib-only Python tools). Use when browsing or choosing among engineering-team role skills — load only the one specialist SKILL.md you need, never bulk-load the bundle.

Backend & APIs2.4K installs

finance-skills

alirezarezvani/claude-skills

Router/index for the finance skills bundled in this plugin: financial-analyst (ratio analysis, DCF valuation, budget variance, rolling forecasts), saas-metrics-coach (ARR/MRR, churn, CAC/LTV, NRR, quick ratio) and month-end-close (close calendar, reconciliations, flux review). Use when a finance request doesn't obviously match one skill and you need to pick the right one (e.g., 'analyze these financials', 'how healthy are my SaaS metrics').

Business & Finance2.3K installs

marketing-skills

alirezarezvani/claude-skills

Directory and router for the marketing skills library. Use when you need to find the right marketing skill for a task, see what marketing capabilities exist, or get oriented in this plugin. 44 specialist skills across 8 pods (content, SEO + AEO, CRO, channels, growth, intelligence, sales enablement, ops), 59 stdlib Python tools. Routes to one skill — it does not execute marketing work itself.

Marketing & SEO2.3K installs

business-growth-skills

alirezarezvani/claude-skills

Router/index for the 4 business & growth skills bundled in this plugin: customer-success-manager (health scoring, churn risk, expansion), sales-engineer (RFP analysis, competitive matrices, PoC planning), revenue-operations (pipeline, forecast accuracy, GTM efficiency), and contract-and-proposal-writer. Use when a growth/revenue request doesn't obviously match one skill and you need to pick the right one (e.g., 'which accounts are at risk', 'should we bid on this RFP').

Business & Finance2.2K installs

engineering-advanced-skills

alirezarezvani/claude-skills

Index of 37 advanced engineering agent skills for Claude Code, Codex, Gemini CLI, Cursor, OpenClaw. Use when browsing or choosing among the POWERFUL-tier engineering skills: agent design, RAG, MCP servers, CI/CD, database design, observability, security auditing, changelog/release automation, reliability (SLO/chaos/flags/operators), platform ops.

AI & Agents2K installs

product-skills

alirezarezvani/claude-skills

Use when coordinating product work across the 12 bundled product sub-skills (RICE, OKRs, UX research, design tokens, competitive teardown, analytics, experiments, discovery, roadmaps, spec-to-repo, landing pages, SaaS scaffolding) or the 4 standalone product-team plugins (user stories, Apple HIG, code-to-PRD, research summarizer). Triggers on 'help me prioritize', 'plan a product experiment', 'we ship features nobody uses', 'run the discovery loop', 'is our OST sound'. Forks context to route to one sub-skill via a deterministic signal router and returns a digest; can also drive a continuous-discovery loop (Torres cadence tracker + OST linter as machine gates) or a full goal→plan→execute→verify→close run through the repo-wide agent-harness. Distinct from project-management (how to deliver vs what to build), marketing/landing (from-scratch pages), and engineering/agent-harness (the generic loop engine this orchestrator plugs into).

Popular security skills

View category →

azure-compliance

microsoft/azure-skills

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

OfficialSecurity567K installs

minimal-run-and-audit

lllllllama/rigorpilot-skills

Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.

Security477.4K installs

seo-audit

coreyhaines31/marketingskills

When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.

Security238.7K installs

firebase-security-rules-auditor

firebase/agent-skills

Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.

OfficialSecurity139.1K installs

audit

pbakaus/impeccable

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

Security81.9K installs

competitors

coreyhaines31/marketingskills

When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.

Security79.3K installs