Why This Matters#

Cloud environments are the primary target for modern attacks. Misconfigurations — not sophisticated exploits — cause most cloud breaches. The shared responsibility model means YOU are responsible for securing your workloads, data, and configurations.


Shared Responsibility Model#

flowchart TD
    subgraph You["YOUR Responsibility"]
        Data["Data & Encryption"]
        IAM["IAM & Access Control"]
        App["Application Security"]
        OS["OS & Network Config"]
        FW["Firewall Rules"]
    end
    
    subgraph Provider["PROVIDER Responsibility"]
        Physical["Physical Security"]
        Network["Global Network"]
        Hypervisor["Hypervisor"]
        Hardware["Hardware"]
        Regions["Regions & AZs"]
    end

Responsibility by Service Type#

LayerIaaS (EC2)PaaS (Lambda, RDS)SaaS (S3, SQS)
Data classification & encryptionYouYouYou
IAM policiesYouYouYou
Application codeYouYouN/A
OS patchingYouProviderProvider
Network configYouSharedProvider
Physical infrastructureProviderProviderProvider

Key insight: Moving to managed services (PaaS/SaaS) shifts more responsibility to the provider — but data and access control are ALWAYS yours.


Cloud IAM#

AWS IAM Principles#

PrincipleImplementation
Least privilegeStart with zero permissions, add only what’s needed
No long-lived credentialsUse IAM roles, not access keys
MFA everywhereRequire MFA for console and sensitive API calls
Separate accountsDifferent AWS accounts per environment
Service control policiesGuardrails at organization level

IAM Policy Evaluation#

flowchart TD
    Request["API Request"] --> Explicit["Explicit Deny?"]
    Explicit -->|Yes| Deny["DENY"]
    Explicit -->|No| SCP["SCP Allow?"]
    SCP -->|No| Deny
    SCP -->|Yes| Permission["Permission Boundary?"]
    Permission -->|No| Deny
    Permission -->|Yes| Policy["Identity Policy Allow?"]
    Policy -->|No| Resource["Resource Policy Allow?"]
    Policy -->|Yes| Allow["ALLOW"]
    Resource -->|No| Deny
    Resource -->|Yes| Allow

Common IAM Mistakes#

MistakeRiskFix
Action: "*"Full account accessScope to specific actions
Resource: "*"Access to all resourcesScope to specific ARNs
Long-lived access keysCredential theftUse roles, rotate keys
No MFA on rootAccount takeoverEnable MFA, lock root away
Unused permissionsExcessive accessAccess Analyzer, regular reviews
Cross-account trust too broadLateral movementRestrict with conditions (ExternalId)

Common Cloud Misconfigurations#

Storage#

MisconfigurationImpactPrevention
Public S3 bucketData exposure to internetS3 Block Public Access (account-level)
Unencrypted storageData breach if disk stolen/sharedDefault encryption (SSE-KMS)
No versioningData loss, no recoveryEnable versioning + lifecycle
Overly broad bucket policyUnauthorized accessPrinciple of least privilege

Compute#

MisconfigurationImpactPrevention
IMDSv1 enabledSSRF → credential theftRequire IMDSv2 (token-based)
Public instances with admin portsDirect attackPrivate subnets, bastion/SSM
Overprivileged instance roleBlast radiusMinimal IAM role per service
Unpatched AMIsKnown vulnerability exploitationAutomated AMI pipeline

Network#

MisconfigurationImpactPrevention
Security group 0.0.0.0/0 ingressOpen to internetRestrict to known CIDRs
No VPC flow logsNo network visibilityEnable flow logs to S3/CloudWatch
Public subnets for private workloadsUnnecessary exposurePrivate subnets + NAT gateway
Missing encryption in transitData interceptionTLS everywhere, VPC endpoints

Cloud Security Posture Management (CSPM)#

Automated, continuous scanning for misconfigurations:

AWS-Native Tools#

ToolFunction
AWS Security HubAggregates findings, compliance checks
AWS ConfigTrack resource configurations, enforce rules
IAM Access AnalyzerFind resources shared externally
GuardDutyThreat detection (anomalous API calls, crypto mining)
CloudTrailAPI audit log (who did what, when)
MacieDiscover and protect sensitive data in S3

Third-Party CSPM#

ToolStrength
WizAgentless, graph-based risk analysis
Prisma Cloud (Palo Alto)Multi-cloud, runtime protection
OrcaAgentless, SideScanning
LaceworkAnomaly detection, compliance

Infrastructure as Code Security (Shift-Left)#

Catch misconfigurations BEFORE deployment:

ToolScansIntegration
CheckovTerraform, CloudFormation, K8sCI/CD pipeline
tfsecTerraformCI/CD pipeline
KICSMulti-framework IaCCI/CD pipeline
TerrascanTerraform, K8s, HelmCI/CD pipeline

Container and Kubernetes Security#

Container Image Security#

flowchart LR
    Build["Build Image"] --> Scan["Scan for CVEs"]
    Scan --> Sign["Sign Image"]
    Sign --> Registry["Push to Private Registry"]
    Registry --> Admit["Admission Control"]
    Admit --> Run["Deploy (if policy passes)"]

Kubernetes Security Layers#

LayerControls
ClusterAPI server auth, RBAC, audit logging
NetworkNetwork policies (deny by default), service mesh
PodSecurity context, non-root, read-only FS
ContainerMinimal image, no shell, seccomp
Supply chainSigned images, admission webhooks

Pod Security Standards#

LevelRestrictions
PrivilegedNo restrictions (admin workloads only)
BaselinePrevents known privilege escalations
RestrictedHeavily restricted (best practice for all workloads)

Cloud Logging and Detection#

Essential Logs#

Log SourceContainsRetention
CloudTrailAll API calls (who, what, when)90 days (default), archive to S3
VPC Flow LogsNetwork traffic metadata30–90 days
GuardDuty FindingsThreat detectionsIndefinite (in Security Hub)
S3 Access LogsBucket access patternsAs needed
ALB Access LogsHTTP request details30–90 days
CloudWatch LogsApplication logsVaries by service

Detection Patterns#

IndicatorMay Suggest
Console login from unusual locationCredential compromise
API calls from new IP/user-agentStolen access keys
Disabled CloudTrail/GuardDutyAttacker covering tracks
Mass S3 downloadsData exfiltration
New IAM user/role creationPersistence
Security group opened to 0.0.0.0/0Backdoor
EC2 instance in unusual regionCrypto mining

Multi-Account Strategy#

Isolate environments and workloads in separate AWS accounts:

flowchart TD
    Org["AWS Organization (Management Account)"]
    Org --> Security["Security Account<br/>(GuardDuty, Security Hub)"]
    Org --> Log["Log Archive Account<br/>(CloudTrail, Config)"]
    Org --> Prod["Production Account"]
    Org --> Pre["Pre-Production Account"]
    Org --> Test["Test Account"]
    Org --> Shared["Shared Services<br/>(CI/CD, DNS, networking)"]

Benefits#

BenefitMechanism
Blast radius containmentCompromise of test ≠ compromise of prod
Billing isolationClear cost attribution
IAM boundaryPolicies can’t cross accounts without explicit trust
ComplianceSeparate regulated workloads
SCPsPreventive guardrails at OU level

Key Takeaways#

  1. Shared responsibility means YOUR data, YOUR IAM, YOUR config — always
  2. Misconfigurations cause most cloud breaches — not sophisticated attacks
  3. Shift left — scan IaC before deployment (Checkov, tfsec)
  4. No long-lived credentials — use roles, OIDC federation, temporary tokens
  5. Multi-account isolation — separate environments, separate blast radius
  6. Enable everything — CloudTrail, GuardDuty, Config, flow logs (cost is minimal vs. breach cost)
  7. IMDSv2 is mandatory — blocks the most common cloud SSRF attack