Cloud Security

Use when assessing cloud infrastructure for security misconfigurations, IAM privilege escalation paths, S3 public exposure, open security group rules,

What Is Cloud Security?

Cloud security refers to the set of policies, controls, procedures, and technologies that work together to protect cloud-based systems, data, and infrastructure. As organizations migrate workloads to cloud service providers such as AWS, Azure, and GCP, the importance of systematically assessing and securing these environments grows exponentially. The “Cloud Security” Claude Code skill provides a comprehensive approach to Cloud Security Posture Management (CSPM), focusing on detecting and preventing misconfigurations, privilege escalation paths, public data exposure, and insecure network rules. Rather than responding to active incidents or scanning application code, this skill is designed for preventive analysis of cloud infrastructure, ensuring that best practices are enforced before exploitation can occur.

Why Use Cloud Security?

Misconfigurations in cloud environments are among the most common causes of data breaches and unauthorized access. Cloud platforms offer extensive flexibility, but this can lead to complex configurations that are difficult to audit manually. Key risks include:

  • Excessive IAM privileges, enabling privilege escalation
  • Publicly exposed storage buckets (e.g., S3)
  • Overly permissive network security group rules
  • Infrastructure-as-Code templates that introduce security gaps

By leveraging the Cloud Security skill, organizations can automate the detection of these misconfigurations, map findings to the MITRE ATT&CK framework, and ensure that their cloud posture aligns with industry best practices and compliance requirements.

How to Get Started

To start using the Cloud Security skill, clone the repository from GitHub and integrate it into your cloud assessment workflows. The skill is designed to work with AWS, Azure, and GCP. Typical usage involves:

  1. Collecting Cloud Configuration Data: Export IAM policies, storage bucket settings, security group rules, and IaC templates from your cloud provider.
  2. Running the Analysis: Use the provided scripts or integrate the methodology into your CI/CD pipeline.
  3. Reviewing Findings: Analyze the output, which highlights misconfigurations, privilege escalation opportunities, and public exposures.

For example, to assess AWS IAM privilege escalation, you might use the following script:

import boto3

def list_all_policies():
    iam = boto3.client('iam')
    paginator = iam.get_paginator('list_policies')
    for page in paginator.paginate(Scope='Local'):
        for policy in page['Policies']:
            print(policy['PolicyName'], policy['Arn'])

This script lists all custom IAM policies, which can then be reviewed for dangerous permissions.

Key Features

The Cloud Security skill offers several core capabilities:

Cloud Posture Check Tool

A methodology for systematically evaluating cloud resource configurations for security risks, including:

  • Exposed storage buckets (e.g., S3 buckets with public read/write access)
  • Open network security groups or firewall rules
  • Unused or excessive IAM privileges
  • Misconfigured Infrastructure-as-Code (IaC) templates

IAM Policy Analysis

Detects IAM policies that may permit privilege escalation or excessive access. Example of a risky IAM policy statement:

{
  "Effect": "Allow",
  "Action": "iam:PassRole",
  "Resource": "*"
}

The skill identifies such statements and flags them for review.

S3 Exposure Assessment

Automated logic checks for S3 buckets (or equivalent in Azure/GCP) that are publicly accessible or lack proper encryption settings. Example AWS CLI command to check S3 public access:

aws s3api get-bucket-acl --bucket my-bucket

Security Group Analysis

Identifies security group rules that allow unrestricted inbound access (e.g., 0.0.0.0/0 on port 22 or 3389). Example AWS CLI command:

aws ec2 describe-security-groups --query "SecurityGroups[*].IpPermissions"

IaC Security Review

Reviews Terraform, CloudFormation, or ARM templates for insecure defaults, such as open ports or lack of resource encryption. Example Terraform snippet to flag:

resource "aws_security_group" "bad_example" {
  ingress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

Best Practices

  • Principle of Least Privilege: Always assign users and services the minimum permissions necessary.
  • Regular Reviews: Periodically reassess IAM policies, security groups, and storage access controls.
  • Use Managed Policies Where Possible: Custom policies can introduce complexity and risk.
  • Automate Assessments: Integrate posture checks into CI/CD to catch misconfigurations before deployment.
  • Enable Logging and Monitoring: Use cloud-native logging (e.g., AWS CloudTrail) to monitor for suspicious activity.

Important Notes

  • This skill is not intended for incident response during ongoing attacks or for application vulnerability scanning.
  • Coverage includes AWS, Azure, and GCP, but some checks may require provider-specific adjustments.
  • Always test changes in non-production environments before applying remediations.
  • Refer to the MITRE ATT&CK mapping in the documentation to understand how findings relate to known adversary tactics.
  • For more detailed or provider-specific guidance, consult the official cloud provider security documentation alongside this skill.