agentleFS
jaskaranhundaljaskaranhundal/usap-skills/cloud-infra/CLAUDE.md

usap-skills / cloud-infra

CLAUDE.md4 starsChanged 2 months agoApache-2.0View on GitHub

This file is the authoritative domain guide for the cloud-infra/ skill directory in the USAP skills repository. It documents all skills in this domain, their tooling, coverage scope, inter-skill workflows, domain best practices, and MITRE ATT&CK cloud matrix coverage. The cloud-infra/ domain addresses security across five interconnected coverage areas: All five skills are read_only for discovery and analysis. Configuration changes, remediation actions, and OT network changes are mutating and require explicit human approval. OT environment changes additionally require safety review…

The file

We split this CLAUDE.md into the rules it gives an agent

12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All five skills are read_only for discovery and analysis.

    line 17
  2. Very specific:

    All tools accept --help for full usage and --output json for machine-readable output.

    line 45
  3. Distinctive:

    Not applicable: Tool is out of scope for that environment type

    line 68
  4. Very specific:

    Link cloud posture findings to IaC policies: When the cloud-security-posture skill detects a misconfiguration that originates from a …

    line 137
  5. Very specific:

    Document remediation commands; never auto-execute them: All CLI remediation commands (AWS CLI, Azure CLI, gsutil, kubectl) are included in …

    line 139
  6. Distinctive:

    When adding a new skill to this domain:

    line 356
  7. Very specific:

    Place the skill directory under cloud-infra/<slug>/.

    line 358
  8. Distinctive:

    Update this CLAUDE.md Skills Catalog table and Cloud Provider Coverage Matrix.

    line 360
  9. Very specific:

    Update the root README.md Domain Index table entry for Cloud & Infra.

    line 361
  10. Very specific:

    Update domains/cloud-infra.md with the new skill slug and level.

    line 362
  11. Distinctive:

    Ensure all MITRE ATT&CK technique mappings relevant to the new skill are added to the coverage section above.

    line 363
  12. Distinctive:

    Add cascade rules to the Cascade and Integration Map.

    line 364

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Cloud Infrastructure Security Domain — CLAUDE.md

This file is the authoritative domain guide for the cloud-infra/ skill directory in the USAP skills repository. It documents all skills in this domain, their tooling, coverage scope, inter-skill workflows, domain best practices, and MITRE ATT&CK cloud matrix coverage.


Purpose

The cloud-infra/ domain addresses security across five interconnected coverage areas:

  • Cloud Security Posture (CSPM): Continuous evaluation of cloud resource configurations against CIS Benchmarks across AWS, Azure, and GCP. Detects misconfigurations, drift from known-good baselines, and maps findings to compliance frameworks (SOC 2, PCI DSS, HIPAA, NIST 800-53).
  • Infrastructure-as-Code (IaC) Security: Static analysis of Terraform, CloudFormation, Pulumi, and Helm charts before deployment. Enforces security gates in CI/CD pipelines so misconfigurations are caught in code review, not in production.
  • Endpoint and OS Security: Hardening assessment and EDR coverage evaluation for Windows, Linux, macOS, and containerized endpoints. Operates against CIS OS Benchmarks and DISA STIG standards.
  • OT/IoT Device Security: Security posture assessment for operational technology, industrial control systems (ICS/SCADA), and IoT devices. Applies NIST SP 800-82, IEC 62443, NERC CIP, and the Purdue Enterprise Reference Architecture. Availability and safety take priority over confidentiality in this domain.
  • Cloud Workload Protection (CWPP): Runtime security for containers and serverless functions. Detects container escape indicators, anomalous process behavior in pods, serverless permission sprawl, and CWPP tool coverage gaps. Complements cloud-security-posture with a runtime focus.

All five skills are read_only for discovery and analysis. Configuration changes, remediation actions, and OT network changes are mutating and require explicit human approval. OT environment changes additionally require safety review and operations director co-approval.


Skills Catalog

SkillSlugPrimary ToolCoverage
Cloud Security Posturecloud-infra/cloud-security-posturecloud-security-posture_tool.pyCIS Benchmarks (AWS/Azure/GCP), CSPM, drift detection, compliance mapping
IaC Securitycloud-infra/iac-securityiac-security_tool.pyTerraform/CloudFormation misconfigs, Kubernetes RBAC, Helm hardening, CI/CD gate policy
Container Image Scancloud-infra/container-image-scancontainer-image-scan_tool.pyTrivy/Grype/Snyk finding classification, base-image vs. app-dependency vs. implanted-layer triage, CI/CD block/fix/track/accept gate
Endpoint & OS Securitycloud-infra/endpoint-os-securityendpoint-os-security_tool.pyCIS OS Benchmarks, DISA STIG, EDR coverage, Windows/Linux/macOS hardening
OT/IoT Device Securitycloud-infra/ot-iot-device-securityot-iot-device-security_tool.pyICS/SCADA, NIST SP 800-82, IEC 62443, NERC CIP, Purdue Model, IoT baseline
Cloud Workload Protectioncloud-infra/cloud-workload-protectioncloud-workload-protection_tool.pyCWPP, container runtime security, serverless permission sprawl, escape detection

Python Tools Reference

ToolLocationKey FlagsOutput
cloud-security-posture_tool.pycloud-security-posture/scripts/--provider aws|azure|gcp, --account-id, --output json|tableCSPM findings with CIS check IDs, severity, compliance mapping, drift flag
iac-security_tool.pyiac-security/scripts/--target terraform|cloudformation|kubernetes|helm, --dir, --output jsonMisconfiguration findings with block_pr flag, compliance score
container-image-scan_tool.pycontainer-image-scan/scripts/--image, --scanner trivy|grype|snyk, --output json|table11-field contract payload with per-finding component classification (base-image OS package / application dependency / unexpected layer) and block-deploy/fix-by-sla-window/track/accept action
endpoint-os-security_tool.pyendpoint-os-security/scripts/--os windows|linux|macos, --host, --output jsonHardening score, EDR coverage status, CIS drift, patch priority matrix
ot-iot-device-security_tool.pyot-iot-device-security/scripts/--zone 0-5, --env ot|iot|mixed, --output jsonPurdue zone risk assessment, segmentation gaps, compensating controls
cloud-workload-protection_tool.pycloud-workload-protection/scripts/--target containers|serverless, --cluster, --output jsonCWPP coverage gaps, runtime anomalies, escape indicators

All tools accept --help for full usage and --output json for machine-readable output.

# Quick invocation pattern for any tool in this domain
python <skill>/scripts/<skill>_tool.py --help
python <skill>/scripts/<skill>_tool.py --output json

Cloud Provider Coverage Matrix

ToolAWSAzureGCPOn-Prem
cloud-security-posture_tool.pyFull (20+ CIS checks)Full (10+ CIS checks)Full (10+ CIS checks)Not applicable
iac-security_tool.pyFull (Terraform AWS provider, CloudFormation)Partial (Terraform AzureRM)Partial (Terraform Google)On-prem Kubernetes
endpoint-os-security_tool.pyEC2 / ECS task (agent-based)Azure VM / AKS nodeGCE instance / GKE nodePhysical and VM endpoints
ot-iot-device-security_tool.pyNot applicableNot applicableNot applicableFull (all Purdue zones)
cloud-workload-protection_tool.pyEKS, Lambda, ECS FargateAKS, Azure FunctionsGKE, Cloud RunSelf-hosted Kubernetes

Coverage levels:

  • Full: All provider-specific checks implemented with benchmark IDs
  • Partial: Core checks implemented; provider-specific hardening extensions in progress
  • Not applicable: Tool is out of scope for that environment type

IaC Security Scanning

Supported IaC Formats

FormatToolchainScanner BackendNotes
Terraform (HCL)All providersCheckov, tfsecModules analyzed recursively
CloudFormation (JSON/YAML)AWSCheckov, cfn-nagSAM templates included
PulumiAWS, Azure, GCPCheckov (Pulumi mode)Python and TypeScript supported
Kubernetes manifestsAllTrivy config, kube-benchIncludes Kustomize overlays
Helm chartsAllTrivy configValues file substitution applied before scan

Check Categories

CategoryDescriptionSeverity RangeCI/CD Gate
Public exposureResources publicly accessible without authenticationCriticalBlock PR
IAM wildcardAction: * with Resource: * in any policyCriticalBlock PR
Encryption at restMissing encryption configuration on storage, database, secretsHighBlock PR
Secret in IaCHardcoded credentials, API keys, certificates in HCL/YAMLCriticalBlock PR
Network segmentationSSH/RDP open to 0.0.0.0/0, unrestricted security groupsCritical–HighBlock PR
Kubernetes pod securityprivileged: true, hostPID, allowPrivilegeEscalationCritical–HighBlock PR
Kubernetes RBACService accounts bound to cluster-adminHighBlock PR
Audit loggingCloudTrail, Azure Monitor, GCP Audit Logs disabledHighWarn
Backup and versioningVersioning disabled on object storageMediumWarn
Least privilegeOverly permissive RBAC, inline IAM policiesMediumWarn

Automated Scanner Commands

# Checkov — Terraform and CloudFormation
checkov -d ./terraform --framework terraform --output json
checkov -d ./cloudformation --framework cloudformation --output json

# Trivy — Kubernetes manifests and Helm charts
trivy config ./kubernetes/ --format json --severity HIGH,CRITICAL
trivy config ./helm-chart/ --format json --severity HIGH,CRITICAL

# tfsec — Terraform focused
tfsec . --format json

# kube-bench — CIS Kubernetes Benchmark (run on cluster node)
kube-bench run --targets node,master --json

Domain Best Practices

  1. Never scope a posture scan to a single region or account. Cloud footprints span multiple regions, accounts, subscriptions, and projects. Cross-account S3 replication targets, VPC peering partners, and shared service accounts are all in scope. Single-region scans produce false confidence.
  2. Use configuration data no older than 24 hours for active posture assessments. Stale scan data masks drift. Drift events (unauthorized configuration changes) are themselves a High finding and must be reported separately from the configuration state.
  3. Apply severity modifiers consistently. Base severity from CIS Benchmarks is a starting point, not a final verdict. Internet-facing resources, production environment, and regulated data stores each warrant a severity upgrade. Verified compensating controls are the only valid basis for a severity downgrade.
  4. Shift IaC security left — block at PR, not at deployment. The iac-security skill is most effective as a CI/CD gate. A Critical IaC finding that reaches production is five to ten times more expensive to remediate than one caught in a PR comment.
  5. Treat unauthorized drift as an independent finding. A configuration change that has no associated change management ticket is a process violation regardless of whether the resulting configuration is secure. Log it, alert on it, and require a retrospective ticket.
  6. Maintain separate OT and IT security procedures. Standard IT patching and hardening timelines do not apply to OT environments. In ICS/SCADA zones, availability and safety take priority over confidentiality. All recommendations for OT environments must include a compensating control path for cases where patching is not operationally feasible.
  7. Require co-approval for all OT environment changes. Any mutating action in an OT environment requires three approvals: security engineer (originator), CISO, and operations director. Safety-critical systems additionally require a safety review before any change window opens. This is enforced in the ot-iot-device-security runtime contract.
  8. Measure CWPP coverage as a percentage. A CWPP coverage gap — workloads running without a runtime protection agent — is a High finding when below 80% and a Critical finding when below 50% in production. Coverage percentage should be tracked as a domain KPI and reported in security-posture-score.
  9. Link cloud posture findings to IaC policies. When the cloud-security-posture skill detects a misconfiguration that originates from a Terraform or CloudFormation resource, it cascades to the iac-security skill for policy-as-code rule creation. This prevents the same misconfiguration from reappearing after the next deployment.
  10. Document remediation commands; never auto-execute them. All CLI remediation commands (AWS CLI, Azure CLI, gsutil, kubectl) are included in skill output as reference for human engineers. The skills in this domain are read-only analyzers — no skill autonomously modifies cloud resources, OS configurations, or OT systems.

Workflow: Cloud Posture Assessment

This cross-skill workflow represents a complete infrastructure security assessment cycle. Each step may run independently or as part of the full sequence.

iac-security  →  cloud-security-posture  →  cloud-workload-protection  →  endpoint-os-security

Step-by-Step

Step 1 — IaC Security Gate (iac-security) Trigger: PR opened or IaC file changed in CI/CD pipeline. Action: Scan Terraform, CloudFormation, Kubernetes manifests, and Helm charts for misconfigurations. Block the PR if any Critical finding (public S3, IAM wildcard, secret in code, SSH open to 0.0.0.0/0) is present. Cascade passing results with compliance score to findings-tracker.

python cloud-infra/iac-security/scripts/iac-security_tool.py \
  --target terraform --dir ./infrastructure --output json

Step 2 — Cloud Posture Scan (cloud-security-posture) Trigger: Deployment event, daily scheduled scan, or IaC drift detected. Action: Collect current cloud resource configurations for all accounts, subscriptions, and projects. Run all CIS Benchmark checks. Apply severity modifiers. Detect drift against last baseline. Map findings to CIS, NIST 800-53, SOC 2, PCI DSS, HIPAA. Cascade Critical production findings to the USAP orchestrator immediately.

python cloud-infra/cloud-security-posture/scripts/cloud-security-posture_tool.py \
  --provider aws --account-id 123456789012 --output json

Step 3 — Workload Runtime Assessment (cloud-workload-protection) Trigger: Completion of Step 2 or new container workload deployed. Action: Assess CWPP tool coverage across all pods and serverless functions. Detect runtime anomalies and container escape indicators. Evaluate Lambda/Function permission sprawl. Escalate container escape events to incident-commander (SEV1) immediately.

python cloud-infra/cloud-workload-protection/scripts/cloud-workload-protection_tool.py \
  --target containers --cluster prod-eks --output json

Step 4 — Endpoint Hardening Check (endpoint-os-security) Trigger: Completion of Step 3 or new endpoint enrolled. Action: Evaluate hardening baseline compliance (CIS Level 1/2, DISA STIG). Assess EDR coverage and alert on gaps. Identify missing patches by CVSS score and CISA KEV status. Produce patch priority matrix with SLA windows.

python cloud-infra/endpoint-os-security/scripts/endpoint-os-security_tool.py \
  --os linux --host prod-bastion-01 --output json

Step 5 — OT Environment Assessment (ot-iot-device-security) (if in scope) Trigger: Scheduled quarterly OT assessment or OT incident. Action: Map all Purdue model zones. Identify segmentation gaps in the IT/OT DMZ. Assess default credentials on IoT devices. Flag safety-system risks as Critical regardless of other severity modifiers. All recommended actions include compensating controls and require co-approval.

python cloud-infra/ot-iot-device-security/scripts/ot-iot-device-security_tool.py \
  --zone 3 --env ot --output json

Step 6 — Aggregate and Report Downstream: findings-tracker aggregates all findings. compliance-mapping generates framework-specific evidence packages. security-posture-score rolls up the domain posture score for executive reporting via ciso-brief-generator.


MITRE ATT&CK Cloud Matrix Coverage

The skills in this domain map to the MITRE ATT&CK Enterprise and ICS matrices as follows.

Initial Access

TechniqueIDDetecting Skill
Valid Accounts — CloudT1078.004cloud-security-posture (IAM anomaly → cascade to identity-access-risk)
Exploit Public-Facing ApplicationT1190cloud-security-posture (internet-facing resources), cloud-workload-protection, container-image-scan (vulnerable base-image/dependency component reachable from a public-facing image)
Drive-by Compromise (HMI)T1817 (ICS)ot-iot-device-security
Default Credentials (IoT)T1812 (ICS)ot-iot-device-security

Execution

TechniqueIDDetecting Skill
Command and Scripting Interpreter — PowerShellT1059.001endpoint-os-security (PS Script Block logging)
Container Administration CommandT1609cloud-workload-protection
Deploy ContainerT1610cloud-workload-protection, iac-security
Modify Control LogicT0833 (ICS)ot-iot-device-security

Persistence

TechniqueIDDetecting Skill
Valid Accounts — CloudT1078.004cloud-security-posture, cloud-workload-protection
Implant Container ImageT1525cloud-workload-protection (image scanning), container-image-scan (unexpected/implanted layer detection against Dockerfile, CI build log, and SBOM)
Registry Run Keys / Startup FolderT1547.001endpoint-os-security
Scheduled Task/JobT1053.005endpoint-os-security

Privilege Escalation

TechniqueIDDetecting Skill
Abuse Elevation Control MechanismT1548endpoint-os-security
Container EscapeT1611cloud-workload-protection
Escape to HostT1611cloud-workload-protection (privileged container detection)
Exploitation for Privilege EscalationT1068endpoint-os-security (patch priority matrix)

Defense Evasion

TechniqueIDDetecting Skill
Modify Cloud Compute InfrastructureT1578cloud-security-posture (drift detection)
Impair Defenses — Disable Cloud LogsT1562.008cloud-security-posture (CloudTrail / Azure Monitor checks)
Impair Defenses — Disable or Modify ToolsT1562.001endpoint-os-security (EDR agent offline detection)

Credential Access

TechniqueIDDetecting Skill
OS Credential Dumping — LSASST1003.001endpoint-os-security (Credential Guard check)
Steal Application Access TokenT1528cloud-security-posture (IAM key rotation checks)
Forge Web CredentialsT1606cloud-security-posture (IAM policy analysis)

Discovery

TechniqueIDDetecting Skill
Cloud Service DiscoveryT1526cloud-security-posture
Cloud Infrastructure DiscoveryT1580cloud-security-posture
Container and Resource DiscoveryT1613cloud-workload-protection
Network Service Discovery (OT)T0840 (ICS)ot-iot-device-security

Lateral Movement

TechniqueIDDetecting Skill
Use Alternate Authentication MaterialT1550cloud-security-posture, endpoint-os-security
Lateral Tool TransferT1570endpoint-os-security
Remote Services — SSHT1021.004endpoint-os-security, iac-security (SSH open check)
Lateral Movement — OT NetworkT0812 (ICS)ot-iot-device-security

Impact

TechniqueIDDetecting Skill
Data DestructionT1485cloud-security-posture (S3 versioning, backup checks)
DefacementT1491cloud-workload-protection
Endpoint Denial of ServiceT1499endpoint-os-security
Modify Safety SystemT0838 (ICS)ot-iot-device-security (safety system impact flag)
Loss of SafetyT0879 (ICS)ot-iot-device-security

Compliance Framework Coverage

FrameworkSkills with Explicit Mapping
CIS AWS Foundations Benchmarkcloud-security-posture, iac-security
CIS Azure Benchmarkcloud-security-posture, iac-security
CIS Google Cloud Platform Benchmarkcloud-security-posture, iac-security
CIS Kubernetes Benchmarkiac-security, cloud-workload-protection
CIS Windows / Linux / macOS Benchmarksendpoint-os-security
NIST SP 800-53cloud-security-posture, iac-security, endpoint-os-security
NIST SP 800-82ot-iot-device-security
NIST SP 800-213 (IoT)ot-iot-device-security
IEC 62443ot-iot-device-security
NERC CIPot-iot-device-security
DISA STIGendpoint-os-security
PCI DSScloud-security-posture, iac-security, endpoint-os-security
HIPAAcloud-security-posture
SOC 2cloud-security-posture, iac-security

Cascade and Integration Map

                    ┌─────────────────────┐
                    │   iac-security      │ ◄── CI/CD pipeline trigger
                    └────────┬────────────┘
                             │ IaC drift detected
                             ▼
                    ┌─────────────────────┐
                    │ cloud-security-     │ ◄── daily scan / deployment event
                    │ posture             │
                    └─────┬──────┬────────┘
                          │      │ public resource
                          │      └──► attack-surface-management
                          │ workload
                          ▼
                    ┌─────────────────────┐
                    │ cloud-workload-     │
                    │ protection          │ ──► incident-commander (escape)
                    └─────┬───────────────┘
                          │ endpoint in scope
                          ▼
                    ┌─────────────────────┐
                    │ endpoint-os-        │
                    │ security            │ ──► detection-engineering
                    └─────────────────────┘

                    ┌─────────────────────┐
                    │ ot-iot-device-      │ ◄── scheduled OT assessment
                    │ security            │ ──► incident-commander (safety)
                    └─────────────────────┘

All skills ──► findings-tracker, compliance-mapping, security-posture-score

Related Domains

  • appsec-devsecops/: Supplies IaC scan triggers from CI/CD pipeline events (devsecops-pipeline, pipeline-security-scan). The iac-security skill consumes pipeline context and returns findings back to the AppSec domain's sast-dast-coordinator for deduplication.
  • identity-access/: The cloud-security-posture skill cascades IAM anomalies and wildcard policy findings to identity-access-risk. The endpoint-os-security skill cascades local admin proliferation and credential guard gap findings to identity-access-risk and cryptography-key-management.

Authoring Notes

When adding a new skill to this domain:

  1. Place the skill directory under cloud-infra/<slug>/.
  2. Reference the domain's Python tool naming convention: <slug>_tool.py in scripts/.
  3. Update this CLAUDE.md Skills Catalog table and Cloud Provider Coverage Matrix.
  4. Update the root README.md Domain Index table entry for Cloud & Infra.
  5. Update domains/cloud-infra.md with the new skill slug and level.
  6. Ensure all MITRE ATT&CK technique mappings relevant to the new skill are added to the coverage section above.
  7. Add cascade rules to the Cascade and Integration Map.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.