cloud-security
Use this skill when securing cloud infrastructure, configuring IAM policies, managing secrets, implementing network policies, or achieving compliance. Triggers on cloud IAM, secrets management, network security groups, VPC security, cloud compliance, SOC 2, HIPAA, zero trust, and any task requiring cloud security architecture or hardening.
engineering cloud-securityiamsecretscompliancezero-trustnetworkingWhat is cloud-security?
Use this skill when securing cloud infrastructure, configuring IAM policies, managing secrets, implementing network policies, or achieving compliance. Triggers on cloud IAM, secrets management, network security groups, VPC security, cloud compliance, SOC 2, HIPAA, zero trust, and any task requiring cloud security architecture or hardening.
cloud-security
cloud-security is a production-ready AI agent skill for claude-code, gemini-cli, openai-codex. Securing cloud infrastructure, configuring IAM policies, managing secrets, implementing network policies, or achieving compliance.
Quick Facts
| Field | Value |
|---|---|
| Category | engineering |
| Version | 0.1.0 |
| Platforms | claude-code, gemini-cli, openai-codex |
| License | MIT |
How to Install
- Make sure you have Node.js installed on your machine.
- Run the following command in your terminal:
npx skills add AbsolutelySkilled/AbsolutelySkilled --skill cloud-security- The cloud-security skill is now available in your AI coding agent (Claude Code, Gemini CLI, OpenAI Codex, etc.).
Overview
A practitioner's framework for securing cloud infrastructure across AWS, GCP, and Azure. This skill covers IAM, secrets management, network security, encryption, audit logging, zero trust, and compliance - with opinionated guidance on when to use each pattern and why it matters. Designed for engineers who own the security posture of a cloud environment, not just a single service.
Tags
cloud-security iam secrets compliance zero-trust networking
Platforms
- claude-code
- gemini-cli
- openai-codex
Related Skills
Pair cloud-security with these complementary skills:
Frequently Asked Questions
What is cloud-security?
Use this skill when securing cloud infrastructure, configuring IAM policies, managing secrets, implementing network policies, or achieving compliance. Triggers on cloud IAM, secrets management, network security groups, VPC security, cloud compliance, SOC 2, HIPAA, zero trust, and any task requiring cloud security architecture or hardening.
How do I install cloud-security?
Run npx skills add AbsolutelySkilled/AbsolutelySkilled --skill cloud-security in your terminal. The skill will be immediately available in your AI coding agent.
What AI agents support cloud-security?
This skill works with claude-code, gemini-cli, openai-codex. Install it once and use it across any supported AI coding agent.
Maintainers
Generated from AbsolutelySkilled
SKILL.md
Cloud Security
A practitioner's framework for securing cloud infrastructure across AWS, GCP, and Azure. This skill covers IAM, secrets management, network security, encryption, audit logging, zero trust, and compliance - with opinionated guidance on when to use each pattern and why it matters. Designed for engineers who own the security posture of a cloud environment, not just a single service.
When to use this skill
Trigger this skill when the user:
- Designs or audits IAM roles, policies, or permission boundaries
- Manages secrets, API keys, or credentials in cloud environments
- Configures VPC security groups, NACLs, or network access controls
- Implements encryption at rest or in transit for cloud resources
- Sets up audit logging (CloudTrail, Cloud Audit Logs, Azure Monitor)
- Architects a zero trust or service mesh network
- Prepares for SOC 2, HIPAA, or PCI-DSS compliance
- Hardens a cloud account, project, or subscription configuration
Do NOT trigger this skill for:
- Application-layer security (SQL injection, XSS, auth flows) - use the backend-engineering skill's security reference instead
- On-premises or bare-metal infrastructure that has no cloud component
Key principles
Least privilege IAM - Every identity (human, service, CI/CD pipeline) gets only the minimum permissions required for its specific task. Never use root or owner-level credentials in automation. Scope permissions to a resource ARN or path, not
*. Review and prune permissions quarterly.Encrypt at rest and in transit - All data at rest uses provider-managed KMS keys (or customer-managed for regulated workloads). All data in transit uses TLS 1.2+ with no exceptions. Internal service traffic is not exempt. Certificate rotation is automated.
Never store secrets in code - No credentials, API keys, or tokens belong in source code, Dockerfiles, CI config, or environment variables baked into images. Secrets live in a secrets manager and are fetched at runtime. Secret scanning runs in every CI pipeline. Pre-commit hooks block high-entropy strings.
Defense in depth - No single control is the whole security posture. Layer network controls (VPC, security groups, NACLs), identity controls (IAM), data controls (encryption, DLP), and detection controls (audit logs, SIEM) so a failure in one layer does not compromise the system.
Audit everything - Every privileged action, every IAM change, every secret access, and every configuration drift must be logged to an immutable, centralized store. Logs have value only when there is alerting on anomalies and a process to act on them.
Core concepts
Shared responsibility model
Cloud providers secure the infrastructure of the cloud (physical hardware, hypervisor, managed service internals). You secure everything in the cloud: identity, data, network configuration, OS patching, application code, and compliance posture. Misunderstanding this boundary is the root cause of most cloud breaches.
| Layer | Provider's responsibility | Your responsibility |
|---|---|---|
| Physical hardware | Provider | - |
| Hypervisor / virtualization | Provider | - |
| Managed service internals | Provider | Configuration and access |
| Network configuration (VPC, SGs) | - | You |
| Identity and IAM | - | You |
| Data encryption | Provider tooling | Your configuration and keys |
| OS patching (VMs) | - | You |
| Application code | - | You |
IAM hierarchy: identity, policy, role
- Identity - who (or what) is making the request: a human user, a service account, a Lambda function, an EC2 instance, a CI/CD pipeline.
- Policy - the document that grants or denies specific actions on specific resources. Policies are attached to identities or roles.
- Role - a temporary identity assumed by a service or person. Roles issue short-lived credentials. Always prefer roles over long-lived access keys.
The evaluation order: explicit deny > service control policy (SCP/org policy) > identity-based policy > resource-based policy. A single explicit deny anywhere in the chain blocks access.
Network segmentation
Isolate workloads at multiple levels:
- Account/project level - separate AWS accounts or GCP projects per environment (prod, staging, dev) to create a hard blast-radius boundary
- VPC level - separate VPCs per environment or workload tier
- Subnet level - public subnets for load balancers only, private subnets for compute, isolated subnets for databases with no route to the internet
- Security group level - stateful rules on each resource; restrict to minimum source/port required
Encryption envelope pattern
KMS uses a two-layer encryption model: a Customer Master Key (CMK) in the cloud KMS encrypts a short-lived Data Encryption Key (DEK). The DEK encrypts the actual data. Store the encrypted DEK alongside the data. The CMK never leaves KMS. To decrypt, call KMS to decrypt the DEK, use the DEK in memory, then discard it. This pattern limits the blast radius of a key compromise and enables key rotation without re-encrypting all data.
Common tasks
Design IAM with least privilege
Start from the action, not the service. Ask: "What exact API calls does this identity need to make?" Then scope to specific resources.
AWS IAM policy - tightly scoped service role:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadSpecificS3Bucket",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-app-bucket",
"arn:aws:s3:::my-app-bucket/*"
]
},
{
"Sid": "ReadSpecificSecret",
"Effect": "Allow",
"Action": "secretsmanager:GetSecretValue",
"Resource": "arn:aws:secretsmanager:us-east-1:123456789:secret:my-app/db-*"
}
]
}GCP IAM - workload identity for a Cloud Run service:
# Bind a service account to a specific role on a specific resource
# gcloud run services add-iam-policy-binding my-service \
# --member="serviceAccount:my-svc@project.iam.gserviceaccount.com" \
# --role="roles/run.invoker"
# Grant minimal storage access - prefer predefined roles over basic roles
# gcloud projects add-iam-policy-binding PROJECT_ID \
# --member="serviceAccount:my-svc@project.iam.gserviceaccount.com" \
# --role="roles/storage.objectViewer" \
# --condition="resource.name.startsWith('projects/_/buckets/my-app-bucket')"Never use
roles/owner,roles/editor, orAdministratorAccessfor service accounts. Use permission boundaries on AWS to cap maximum effective permissions.
Manage secrets with Vault or AWS Secrets Manager
HashiCorp Vault - dynamic database credentials (no long-lived passwords):
# Enable the database secrets engine
path "database/config/postgres" {
capabilities = ["create", "update"]
}
# Define a role that generates short-lived credentials
resource "vault_database_secret_backend_role" "app" {
name = "app-role"
backend = vault_database_secrets_engine.db.path
db_name = vault_database_secrets_engine_connection.postgres.name
creation_statements = [
"CREATE ROLE \"{{name}}\" WITH LOGIN PASSWORD '{{password}}' VALID UNTIL '{{expiration}}';",
"GRANT SELECT, INSERT ON ALL TABLES IN SCHEMA public TO \"{{name}}\";"
]
default_ttl = "1h"
max_ttl = "24h"
}AWS Secrets Manager - fetch at runtime (never at build time):
import boto3
import json
def get_secret(secret_name: str, region: str = "us-east-1") -> dict:
client = boto3.client("secretsmanager", region_name=region)
response = client.get_secret_value(SecretId=secret_name)
return json.loads(response["SecretString"])
# Usage: fetch on startup, cache in memory, never log
db_config = get_secret("prod/my-app/database")Enable automatic rotation in AWS Secrets Manager for RDS credentials. Set a rotation window of 30 days or fewer. Use resource-based policies to restrict which roles can call
GetSecretValue.
Configure VPC security - security groups and NACLs
VPC Layout (3-tier):
Public subnet (10.0.1.0/24) - ALB only, ingress 443/80 from 0.0.0.0/0
Private subnet (10.0.2.0/24) - App servers, ingress from ALB SG only
Data subnet (10.0.3.0/24) - RDS/ElastiCache, ingress from App SG only, no NATSecurity group rules (stateful - return traffic is automatic):
| SG | Inbound rule | Source | Port |
|---|---|---|---|
| alb-sg | HTTPS | 0.0.0.0/0 | 443 |
| app-sg | HTTP | alb-sg (SG id) | 8080 |
| db-sg | Postgres | app-sg (SG id) | 5432 |
NACL rules (stateless - explicit rules for both directions):
- Data subnet NACL: deny all inbound from internet (0.0.0.0/0), allow from private subnet CIDR only. Deny all outbound to internet. This is the belt to the security group's suspenders.
Security groups are the primary control. NACLs are a secondary blast-radius limiter. Never expose port 22 (SSH) or 3389 (RDP) to 0.0.0.0/0 - use SSM Session Manager or a bastion in a locked-down subnet.
Implement encryption at rest and in transit
AWS S3 bucket - enforce encryption and TLS:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyNonTLS",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::my-app-bucket",
"arn:aws:s3:::my-app-bucket/*"
],
"Condition": {
"Bool": { "aws:SecureTransport": "false" }
}
},
{
"Sid": "DenyNonEncryptedPuts",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-app-bucket/*",
"Condition": {
"StringNotEquals": {
"s3:x-amz-server-side-encryption": "aws:kms"
}
}
}
]
}For RDS: enable encryption at creation (cannot be added later without snapshot restore). Use a customer-managed KMS key (CMK) for regulated workloads so you control the key policy and can audit usage separately.
Set up audit logging - CloudTrail and Cloud Audit Logs
AWS CloudTrail - organization-wide, immutable configuration:
resource "aws_cloudtrail" "org_trail" {
name = "org-audit-trail"
s3_bucket_name = aws_s3_bucket.audit_logs.id
include_global_service_events = true
is_multi_region_trail = true
enable_log_file_validation = true # SHA-256 digest for tamper detection
is_organization_trail = true # covers all accounts in AWS Org
event_selector {
read_write_type = "All"
include_management_events = true
data_resource {
type = "AWS::S3::Object"
values = ["arn:aws:s3:::"] # all S3 data events
}
}
cloud_watch_logs_group_arn = "${aws_cloudwatch_log_group.cloudtrail.arn}:*"
cloud_watch_logs_role_arn = aws_iam_role.cloudtrail_cw.arn
}GCP Cloud Audit Logs - enable data access logs at org level:
# Organization-level audit config (apply via gcloud or Terraform)
auditConfigs:
- service: allServices
auditLogConfigs:
- logType: ADMIN_READ
- logType: DATA_READ
- logType: DATA_WRITECritical alerts to configure: root account login (AWS), IAM policy changes, security group modifications, CloudTrail disabled, MFA disabled for privileged accounts.
Implement zero trust network - service mesh with mTLS
Zero trust assumes the network is hostile. Every service-to-service call must be authenticated and encrypted, regardless of whether it is "inside" the VPC.
Istio service mesh - enforce mTLS across the mesh:
# PeerAuthentication: require mTLS for all services in the namespace
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
name: default
namespace: production
spec:
mtls:
mode: STRICT # reject plaintext connections
---
# AuthorizationPolicy: service A can only call specific methods on service B
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: allow-orders-to-payments
namespace: production
spec:
selector:
matchLabels:
app: payments-service
rules:
- from:
- source:
principals: ["cluster.local/ns/production/sa/orders-service"]
to:
- operation:
methods: ["POST"]
paths: ["/v1/charges", "/v1/refunds"]Each service has its own SPIFFE identity (service account). The mesh enforces that only authorized callers can reach each endpoint - even if an attacker compromises the internal network, they cannot spoof a service identity.
Prepare for SOC 2 compliance - controls checklist
SOC 2 is organized around Trust Service Criteria (TSC). For a Type II audit you must demonstrate controls operated continuously over a period (typically 6-12 months).
Common Technical Controls Checklist:
Access Controls (CC6)
[ ] MFA enforced for all human users with cloud console access
[ ] Privileged access (root/owner) has separate credentials, used only for break-glass
[ ] Access reviews conducted quarterly; terminated employees deprovisioned within 24h
[ ] Service accounts use roles, not long-lived keys
[ ] SSH/RDP access disabled in favor of SSM / IAP (Identity-Aware Proxy)
Change Management (CC8)
[ ] All infrastructure changes via IaC (Terraform/Pulumi), not manual console
[ ] IaC changes require peer review in PRs before apply
[ ] Deployment pipeline enforces approvals for production changes
[ ] Rollback procedures documented and tested
Monitoring and Alerting (CC7)
[ ] CloudTrail / Cloud Audit Logs enabled across all regions and accounts
[ ] Log retention >= 1 year (hot) + 7 years (cold/archived)
[ ] Alerts on: IAM changes, SG changes, root login, failed auth spikes, CloudTrail off
[ ] Incident response runbooks exist and are tested annually
Encryption (CC6.7)
[ ] All data at rest encrypted (KMS CMK for regulated data)
[ ] All data in transit uses TLS 1.2+
[ ] Key rotation policy documented and automated
[ ] No plaintext secrets in code, logs, or environment variables
Availability (A1)
[ ] Recovery Time Objective (RTO) and Recovery Point Objective (RPO) defined
[ ] Backups tested by restoring to a non-production environment quarterly
[ ] Multi-AZ or multi-region architecture for critical servicesSee references/compliance-frameworks.md for SOC 2, HIPAA, and PCI-DSS
controls comparison.
Anti-patterns
| Anti-pattern | Why it's dangerous | What to do instead |
|---|---|---|
Wildcard IAM policies (Action: "*", Resource: "*") |
Any exploit or misconfiguration grants full account access | Scope policies to exact actions and specific resource ARNs |
| Long-lived access keys for service accounts | Keys can leak via logs, git history, or compromised machines; there is no expiry | Use IAM roles and instance profiles; rotate keys every 90 days if roles are impossible |
| Flat VPC with all resources in public subnets | Any misconfigured security group exposes databases and internal services to the internet | Three-tier subnet architecture; databases never in public subnets |
| Secrets hardcoded in environment variables baked into container images | Image layers persist forever; any image pull leaks the secret | Fetch secrets at runtime from a secrets manager; never bake into images |
| Single AWS account / GCP project for all environments | A prod incident can reach dev data; a dev mistake can delete prod resources | Separate accounts/projects per environment with SCPs to enforce boundaries |
| Disabling CloudTrail or audit logs to reduce cost | Audit gaps make incident investigation impossible; compliance evidence destroyed | Compress and archive logs to cheap storage (S3 Glacier); cost is negligible vs. risk |
Gotchas
Service Control Policies silently block actions - An SCP at the AWS Organization level that denies an action overrides any IAM Allow in a member account. When a permission looks correct in IAM but still fails with "AccessDenied", check the SCP chain at the organization and OU level - they are often overlooked because they're managed by a separate team.
CloudTrail logging gap on multi-region trails - A trail configured as multi-region still won't capture events from services that are global (IAM, STS, CloudFront) unless
include_global_service_eventsis explicitly set totrue. Most IAM changes and assume-role events fall into this gap and disappear from audit logs without this flag.KMS key deletion is irreversible after the waiting period - KMS imposes a 7-30 day waiting period before key deletion, but once the period expires, the key and all data encrypted with it that lacks a backup decryption path are permanently unrecoverable. Never schedule a key for deletion unless you have verified that no data encrypted with it needs to be decrypted in the future.
Security group rule accumulation - Security groups are additive - rules are only added, never automatically removed. Over months, groups accumulate stale rules (former services, debug ports, one-off access). A security group that looks fine has rules from two years ago that opened ports to long-deleted resources, some of which may overlap with new infrastructure in the same CIDR range.
Secrets in environment variables baked into container images - Setting
ENV DB_PASSWORD=...in a Dockerfile bakes the secret into every image layer permanently. Anyone withdocker historyaccess or registry pull access can recover it. Secrets must be injected at container runtime from a secrets manager, never built into the image.
References
For deep-dive guidance on specific domains, load the relevant file from
references/:
references/compliance-frameworks.md- SOC 2, HIPAA, PCI-DSS controls comparison and evidence requirements
References
compliance-frameworks.md
Compliance Frameworks: SOC 2, HIPAA, PCI-DSS
A side-by-side reference for the three most common compliance frameworks engineering teams encounter. Each section covers what the framework is, who it applies to, the core control areas, and the evidence typically required during an audit.
1. Framework Overview
| Attribute | SOC 2 | HIPAA | PCI-DSS |
|---|---|---|---|
| Governing body | AICPA | U.S. Dept. of Health & Human Services | PCI Security Standards Council |
| Primary audience | SaaS and service providers | Healthcare organizations and their business associates | Any entity that stores, processes, or transmits cardholder data |
| Data protected | Customer data (defined by scope) | Protected Health Information (PHI) | Cardholder data: PAN, CVV, expiry, name |
| Audit type | Third-party CPA attestation (Type I: design, Type II: operating effectiveness) | Self-attestation + OCR enforcement; no mandatory third-party audit | Self-assessment (SAQ) or Qualified Security Assessor (QSA) audit |
| Frequency | Annual audit for Type II | Ongoing; risk assessments at least annually | Annual assessment; quarterly scans |
| Penalties | Contractual; reputational | Civil: up to $1.9M per violation category per year; Criminal: up to $250K + jail | Fines from card brands ($5K-$100K/month); loss of card processing privileges |
2. SOC 2
What it is
SOC 2 is a voluntary framework for service organizations that store or process customer data. It is structured around five Trust Service Criteria (TSC): Security (required), Availability, Processing Integrity, Confidentiality, and Privacy. Most audits focus on Security and Availability.
A Type I report attests that controls are designed correctly as of a point in time. A Type II report attests that controls operated effectively over a period (typically 6-12 months). Customers and enterprise buyers almost always require Type II.
Trust Service Criteria - Engineering Controls
CC6 - Logical and Physical Access Controls
| Control | Implementation example |
|---|---|
| CC6.1 - Restrict logical access | IAM roles with least privilege; MFA for all console users |
| CC6.2 - Register and manage user identities | Centralized identity provider (Okta, Google Workspace); automated deprovisioning on offboarding |
| CC6.3 - Remove access when no longer needed | Quarterly access reviews; automated removal of unused accounts after 90 days |
| CC6.6 - Implement logical access security measures | Encryption at rest and in transit; SSH disabled in favor of SSM/IAP |
| CC6.7 - Restrict transmission of confidential information | TLS 1.2+ on all endpoints; DLP policies for exports |
| CC6.8 - Prevent unauthorized use of software | Allowlisted third-party integrations; dependency scanning in CI |
CC7 - System Operations
| Control | Implementation example |
|---|---|
| CC7.1 - Detect and monitor for new vulnerabilities | Automated vulnerability scanning (Inspector, Security Command Center); weekly digest |
| CC7.2 - Monitor system components | CloudTrail + SIEM; alerts on IAM changes, failed auth spikes, SG modifications |
| CC7.3 - Evaluate security events | Incident response runbook; severity classification; 24h SLA for critical events |
| CC7.4 - Respond to incidents | Documented IR process; post-mortems for all P1 incidents |
| CC7.5 - Recover from incidents | Tested backup restoration; RTO/RPO defined and measured |
CC8 - Change Management
| Control | Implementation example |
|---|---|
| CC8.1 - Manage changes to infrastructure | All changes via IaC (Terraform) with PR review; no manual console changes in prod |
A1 - Availability
| Control | Implementation example |
|---|---|
| A1.1 - Capacity planning | Auto-scaling policies; load testing before major releases |
| A1.2 - Environmental protections | Multi-AZ deployments; automated failover |
| A1.3 - Recovery and resumption | Quarterly DR drills; backup restoration tests |
Typical Audit Evidence
- IAM policies and role assignments (exported at audit period end)
- Access review records (spreadsheet or tool showing quarterly review completion)
- CloudTrail logs showing no direct console changes to production resources
- Terraform state and PR history showing change approval
- Incident tickets and post-mortems for the audit period
- Penetration test report (annual, from a qualified third party)
- Vendor risk assessments for critical subprocessors
- Security training completion records for all employees
3. HIPAA
What it is
HIPAA (Health Insurance Portability and Accountability Act) protects Protected Health Information (PHI) - any individually identifiable health information. The Security Rule specifies administrative, physical, and technical safeguards for electronic PHI (ePHI). The Privacy Rule governs how PHI may be used and disclosed. A Business Associate Agreement (BAA) is required with any vendor that handles PHI on your behalf (AWS, GCP, Azure, Twilio, etc.).
Technical Safeguard Categories
Access Control (45 CFR 164.312(a))
| Specification | Required/Addressable | Implementation |
|---|---|---|
| Unique user identification | Required | No shared accounts; each user has a unique identity |
| Emergency access procedure | Required | Break-glass accounts documented and tested |
| Automatic logoff | Addressable | Session timeouts after inactivity (15-30 min) |
| Encryption and decryption | Addressable | Encrypt ePHI at rest with AES-256; treat as required for cloud |
Audit Controls (45 CFR 164.312(b))
| Requirement | Implementation |
|---|---|
| Record and examine access to ePHI | CloudTrail + application-level audit logs for every PHI access |
| Log retention | Minimum 6 years (HIPAA); align with state law (often longer) |
| Anomaly detection | Alert on unusual access patterns: bulk exports, off-hours access, new IP geolocation |
Integrity (45 CFR 164.312(c))
| Requirement | Implementation |
|---|---|
| Protect ePHI from improper alteration or destruction | Enable S3 versioning + Object Lock; RDS Point-in-Time Recovery |
| Mechanism to authenticate ePHI | Checksums and hash verification for data exports |
Transmission Security (45 CFR 164.312(e))
| Requirement | Implementation |
|---|---|
| Guard against unauthorized access during transmission | TLS 1.2+ on all endpoints; no HTTP for any ePHI-carrying traffic |
| Encryption of ePHI in transit | TLS with valid certificates; mTLS for internal service-to-service |
Key HIPAA Engineering Rules
- BAAs are non-negotiable: before storing ePHI with any vendor, obtain a signed BAA. Major cloud providers offer BAAs (AWS HIPAA eligible services, GCP HIPAA Business Associate Agreement, Azure BAA).
- Minimum necessary principle: only access or disclose the minimum PHI required. Implement field-level access controls so support staff cannot see data they do not need.
- Breach notification: if ePHI is breached, you have 60 days to notify affected individuals and HHS. Encrypt all ePHI so that a lost device or leaked backup does not trigger breach notification (encryption provides a safe harbor).
- Workforce training: document annual HIPAA training completion for all staff with access to ePHI.
HIPAA-Eligible AWS Services (selected)
- EC2, RDS, S3, Lambda, EKS, DynamoDB, CloudTrail, KMS, CloudWatch, Secrets Manager, Cognito, API Gateway. Full list: aws.amazon.com/compliance/hipaa-eligible-services-reference
4. PCI-DSS
What it is
PCI-DSS (Payment Card Industry Data Security Standard) applies to any organization that stores, processes, or transmits cardholder data (credit/debit card numbers, CVV, expiry dates, cardholder names). Version 4.0 is the current standard (effective March 2024). The scope is determined by the Cardholder Data Environment (CDE) - ideally, minimize scope by tokenizing card data and using a PCI-validated payment processor (Stripe, Adyen, Braintree) so your systems never touch raw cardholder data.
12 Requirements Summary
| Req | Domain | Key engineering controls |
|---|---|---|
| 1 | Network security controls | Firewall rules documenting all CDE traffic; no inbound from untrusted networks; deny-all default |
| 2 | Secure configurations | Harden all system defaults; remove unnecessary services; vendor-supplied passwords changed before deployment |
| 3 | Protect stored account data | Never store CVV after authorization; encrypt PAN at rest (AES-256); mask PAN in displays (show only last 4 digits) |
| 4 | Protect data in transit | TLS 1.2+ for all cardholder data transmission; no older SSL/early TLS |
| 5 | Protect systems from malicious software | Anti-malware on all applicable systems; integrity monitoring |
| 6 | Secure systems and software | Vulnerability management program; penetration testing; secure development lifecycle; WAF required for web-facing CDE |
| 7 | Restrict access by business need | RBAC; access to CDE components restricted to those with a defined business need |
| 8 | Identify users and authenticate | Unique IDs; MFA required for all non-console CDE access (v4.0: MFA for all CDE access) |
| 9 | Restrict physical access | Physical access controls for CDE hardware; media destruction policies |
| 10 | Log and monitor all access | Audit logs for all CDE access; logs protected from modification; 12-month retention (3 months immediately available) |
| 11 | Test security regularly | Internal vulnerability scans quarterly; external scans by Approved Scanning Vendor (ASV) quarterly; annual pen test |
| 12 | Support information security | Written security policy; risk assessment annually; incident response plan tested annually |
Scope Reduction Strategy
The single highest-leverage action for PCI compliance is scope reduction:
Option A: Tokenization via PCI-validated processor
- Stripe/Adyen/Braintree handles card data; you receive only a token
- Your systems never touch PAN, CVV, or track data
- SAQ A or SAQ A-EP applies (minimal controls vs. full QSA audit)
Option B: iframe / hosted payment page
- Card entry happens in a provider-hosted iframe
- CDE is isolated to the payment processor
- Reduces scope to network controls and security policies
Option C: Full CDE in isolated AWS account
- Cardholder data in a dedicated AWS account with no peering to other workloads
- CDE boundary clearly defined in network diagrams
- Full SAQ D or QSA assessment requiredPCI-DSS v4.0 Changes (effective March 2024)
- MFA required for all access to the CDE (not just remote access)
- Targeted risk analysis required for many previously prescriptive controls
- Web application firewalls (WAFs) required for all internet-facing web applications in scope
- Script integrity checks required for payment pages (Subresource Integrity or CSP)
- Penetration testing methodology must include testing for business logic flaws
5. Cross-Framework Controls Matrix
Controls that satisfy requirements across all three frameworks simultaneously:
| Control | SOC 2 | HIPAA | PCI-DSS |
|---|---|---|---|
| MFA for all privileged access | CC6.1 | Access Control | Req 8 |
| Encryption at rest (AES-256) | CC6.6, CC6.7 | Technical Safeguard | Req 3 |
| TLS 1.2+ for all data in transit | CC6.7 | Transmission Security | Req 4 |
| Centralized, immutable audit logs | CC7.2 | Audit Controls | Req 10 |
| Quarterly access reviews | CC6.3 | Minimum Necessary | Req 7 |
| Annual penetration testing | CC4.1 | Risk Analysis | Req 11 |
| Incident response plan (tested) | CC7.4, CC7.5 | Breach Notification | Req 12 |
| Secrets manager (no hardcoded creds) | CC6.1 | Access Control | Req 2, 8 |
| Vulnerability scanning in CI | CC7.1 | Risk Analysis | Req 6, 11 |
| IaC-only infrastructure changes | CC8.1 | Change Management | Req 6 |
Practical advice: implement these 10 controls first. They give you the largest cross-framework coverage for the least engineering effort. Then layer in framework-specific requirements based on which audits you are preparing for.
Quick Reference: Which Framework Do I Need?
Do you handle credit/debit card numbers (PAN)?
YES -> PCI-DSS is mandatory. Minimize scope with tokenization.
Do you store, process, or transmit health data about US individuals?
YES -> HIPAA applies if you are a covered entity or business associate.
Obtain BAAs with all vendors handling ePHI.
Do you provide a B2B SaaS service where enterprise customers ask about
security practices before signing contracts?
YES -> SOC 2 Type II is effectively required for enterprise sales.
Are you subject to GDPR (EU personal data)?
YES -> SOC 2 Privacy TSC + DPA agreements cover significant overlap,
but GDPR has additional requirements (lawful basis, DSAR process,
72-hour breach notification). Consider ISO 27001 for EU markets. Frequently Asked Questions
What is cloud-security?
Use this skill when securing cloud infrastructure, configuring IAM policies, managing secrets, implementing network policies, or achieving compliance. Triggers on cloud IAM, secrets management, network security groups, VPC security, cloud compliance, SOC 2, HIPAA, zero trust, and any task requiring cloud security architecture or hardening.
How do I install cloud-security?
Run npx skills add AbsolutelySkilled/AbsolutelySkilled --skill cloud-security in your terminal. The skill will be immediately available in your AI coding agent.
What AI agents support cloud-security?
cloud-security works with claude-code, gemini-cli, openai-codex. Install it once and use it across any supported AI coding agent.