Skip to content

Domain 2: Security and Compliance

CLF-C02 Exam Domain 2 | 30% of Scored Content

Learning Objectives

By the end of this domain, you will be able to:

  • Understand the AWS Shared Responsibility Model
  • Define AWS security concepts and services
  • Understand IAM components and policies
  • Identify AWS security services for different use cases
  • Understand compliance concepts

AWS Shared Responsibility Model

Overview

The AWS Shared Responsibility Model defines which security tasks are AWS's responsibility and which are the customer's responsibility.

Visual Model

┌─────────────────────────────────────────────────────────────┐
│              AWS Shared Responsibility Model                │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  AWS RESPONSIBILITY                CUSTOMER RESPONSIBILITY  │
│  ┌──────────────────┐              ┌──────────────────┐     │
│  │ Security OF      │              │ Security IN      │     │
│  │ the Cloud        │              │ the Cloud        │     │
│  ├──────────────────┤              ├──────────────────┤     │
│  │ • Physical       │              │ • IAM & Access   │     │
│  │   Controls       │              │ • Data           │     │
│  │ • Hardware       │              │ • Encryption     │     │
│  │ • Networking     │              │ • Network Config │     │
│  │ • Software       │              │ • OS Patching    │     │
│  │ (Hypervisor)     │              │ • App Security   │     │
│  └──────────────────┘              └──────────────────┘     │
│                                                             │
└─────────────────────────────────────────────────────────────┘

Responsibilities by Service Model

Service ModelAWS ResponsibilityCustomer Responsibility
IaaS (EC2)Physical security, network, hypervisorOS, apps, data, IAM
PaaS (RDS)All of IaaS + OS, database softwareData, IAM, database configuration
SaaS (WorkSpaces)Most security tasksUser access, data classification

Security OF the Cloud (AWS)

AWS is responsible for:

ComponentDescription
Physical SecurityData center access, security guards, cameras
HardwareServers, storage devices, networking equipment
NetworkingNetwork infrastructure, firewalls
VirtualizationHypervisor that isolates customer instances
Regions & AZsAvailability and durability
Edge LocationsPhysical security of CDN infrastructure

Security IN the Cloud (Customer)

Customer is responsible for:

ComponentDescription
IAMUser management, access control, permissions
DataClassification, encryption, backup
NetworkVPC configuration, security groups, NACLs
Operating SystemPatching, hardening, anti-virus
ApplicationsCode security, dependencies, vulnerabilities
ConfigurationSecurity settings, compliance

Key Principle

"AWS is responsible for security OF the cloud, you are responsible for security IN the cloud."


Identity and Access Management (IAM)

Overview

IAM is the service that controls access to AWS resources securely.

Core Components

1. IAM Users

Definition: An entity that represents a person or application that interacts with AWS.

Characteristics:

  • Long-term credentials (password, access keys)
  • Can have console access and/or programmatic access
  • Belong to one or more groups

Example:

bash
# AWS CLI command to create a user
aws iam create-user --user-name john-developer

2. IAM Groups

Definition: A collection of IAM users.

Benefits:

  • Attach permissions to groups, not individual users
  • Users inherit permissions from groups
  • Simplifies permission management

Best Practice: Always use groups for permissions, assign users to groups.

Example:

bash
# Create a group
aws iam create-group --group-name Developers

# Add user to group
aws iam add-user-to-group --group-name Developers --user-name john-developer

3. IAM Roles

Definition: An IAM identity with specific permissions that is not associated with a specific user or group.

Use Cases:

  • Applications running on EC2 need AWS permissions
  • Cross-account access
  • Federated access (corporate SSO)
  • AWS Service roles (e.g., Lambda needs to access S3)

Key Difference from Users:

  • Roles provide temporary credentials
  • Users have long-term credentials

Example: EC2 instance using a role to access S3

┌──────────────┐         Assume Role          ┌──────────────┐
│   EC2        │ ────────────────────────────▶│    S3        │
│  Instance    │      (Temporary Creds)       │   Bucket     │
└──────────────┘                               └──────────────┘

       └── Instance Profile (contains role)

4. IAM Policies

Definition: JSON documents that define permissions.

Policy Structure:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::my-bucket/*"
    }
  ]
}

Policy Elements:

ElementDescriptionValues
EffectAllow or DenyAllow, Deny
ActionSpecific AWS operations"s3:GetObject", "ec2:RunInstances"
ResourceAWS resource ARN"arn:aws:s3:::bucket/*"
ConditionWhen policy applies"IpAddress": {"aws:SourceIp": "1.2.3.4/32"}

Policy Types:

TypeDescriptionExample
Identity-basedAttached to users, groups, rolesAdministratorAccess
Resource-basedAttached to resourcesS3 Bucket Policy
Trust policiesWho can assume a roleIAM Role Trust Policy
Permissions boundaryMaximum permissions for an entityDeveloperBoundary

5. IAM Best Practices

  1. Root Account: Use MFA, lock away access keys, only for account admin
  2. Individual Users: Never share credentials, one user per person
  3. Groups: Use groups for permissions, assign users to groups
  4. Least Privilege: Grant only minimum required permissions
  5. Roles: Use roles for applications and cross-account access
  6. MFA: Enable for all users, especially privileged accounts
  7. Rotate Credentials: Regularly rotate passwords and access keys
  8. Remove Unused: Delete unused users, groups, roles, and policies

IAM Policies Deep Dive

Policy Evaluation Logic

Request → Default Deny → Explicit Allow? → Explicit Deny?
           (All start)    (Check)          (Overrides all)
              │              │                 │
              ▼              ▼                 ▼
           DENIED     ALLOWED if no      ALWAYS DENIED
                      explicit deny

Key Rules:

  1. Default Deny: All requests are denied by default
  2. Explicit Deny: Overrides any Allow
  3. Explicit Allow: Grants permission (if no Deny)

Common Managed Policies

AWS Managed Policies:

  • AdministratorAccess - Full access to all AWS services
  • PowerUserAccess - Full access except IAM
  • ReadOnlyAccess - Read-only access to all services
  • AmazonS3FullAccess - Full access to S3

Example Policies

Read-Only S3 Access:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:Get*",
        "s3:List*"
      ],
      "Resource": "*"
    }
  ]
}

S3 Bucket Access (Specific Bucket):

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:PutObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::my-app-bucket/*"
    }
  ]
}

EC2 Full Access:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ec2:*",
      "Resource": "*"
    }
  ]
}

AWS Security Services

Overview

AWS provides a comprehensive set of security services to help protect your data, applications, and infrastructure.

Security Services Comparison

ServiceTypePurposeUse Case
IAMIdentityAccess managementUser/role permissions
KMSEncryptionKey managementEncrypt data at rest
Secrets ManagerSecretsStore secretsDatabase credentials
ShieldDDoSDDoS protectionLayer 3/4/7 protection
WAFFirewallWeb application firewallHTTP(S) protection
GuardDutyThreat detectionIntelligent threat detectionSecurity monitoring
Security HubComplianceSecurity and compliance centerCentralized security
InspectorVulnerabilityAutomated security assessmentsEC2 vulnerability scan
MacieData discoveryData classification and protectionS3 sensitive data
CloudHSMEncryptionHardware security moduleFIPS 140-2 compliance
ACMCertificatesSSL/TLS certificate managementCertificate provisioning

Detailed Service Coverage

1. AWS KMS (Key Management Service)

Purpose: Managed service that makes it easy to create and control encryption keys.

Features:

  • Centralized key management
  • Hardware Security Modules (HSMs)
  • Key rotation
  • IAM integration
  • Audit logging via CloudTrail

Use Cases:

  • Encrypt EBS volumes
  • Encrypt S3 objects
  • Encrypt RDS instances
  • Encrypt Lambda environment variables

Key Concepts:

  • Customer Master Keys (CMKs): Main encryption keys
  • Data Keys: Generated by CMKs to encrypt data
  • Envelope Encryption: CMK encrypts data keys, data keys encrypt data

2. AWS Shield

Purpose: Managed DDoS protection service.

Tiers:

TierCostProtection
StandardFREEAutomatic protection for all AWS customers
Advanced$3,000/month + usageAdvanced protection, 24/7 access, DDoS Response Team (DRT)

Protection Against:

  • Network layer (Layer 3/4) attacks: SYN floods, UDP reflection
  • Application layer (Layer 7) attacks: HTTP GET floods, DNS query floods

3. AWS WAF (Web Application Firewall)

Purpose: Web application firewall that helps protect web applications.

Features:

  • Rule-based traffic filtering
  • Bot control
  • SQL injection protection
  • Cross-site scripting (XSS) protection
  • Rate-based rules

Components:

  • WebACL: Container for rules
  • Rules: Conditions for allowing/blocking requests
  • Rule Groups: Collections of rules

Pricing: Pay per web ACL, per rule, and per million requests

4. Amazon GuardDuty

Purpose: Intelligent threat detection service.

Capabilities:

  • Analyzes logs (VPC Flow Logs, CloudTrail, DNS logs)
  • Machine learning for anomaly detection
  • Threat intelligence feeds
  • Integrated findings with Security Hub

Findings Categories:

  • CryptoCurrency (unusual activity)
  • Backdoor (Trojan detected)
  • Behavior (unusual API calls)
  • Reconnaissance (port scanning)
  • Stealth (attempting to avoid detection)

5. AWS Security Hub

Purpose: Comprehensive security and compliance center.

Features:

  • Aggregates security alerts and findings
  • Automates security checks
  • Tracks compliance with standards (CIS, NIST, PCI DSS)
  • Centralized security management

Integrations: GuardDuty, Inspector, Macie, IAM Access Analyzer

6. AWS Inspector

Purpose: Automated security assessment service.

What It Scans:

  • EC2 instances
  • Lambda functions
  • Container images (ECR)

Vulnerability Checks:

  • Common Vulnerabilities and Exposures (CVEs)
  • Network reachability
  • Security best practices

7. AWS Secrets Manager

Purpose: Securely store, encrypt, and manage secrets.

Features:

  • Rotate secrets automatically
  • Encrypt with KMS
  • Audit secret access via CloudTrail
  • Integrate with RDS, DocumentDB, Redshift

Secret Types:

  • Database credentials
  • API keys
  • OAuth tokens
  • Certificates

8. Amazon Macie

Purpose: Fully managed data security and data privacy service.

Capabilities:

  • Machine learning to discover sensitive data
  • Classifies PII, PHI, financial data
  • Alerts on suspicious access to S3 data
  • Provides data inventory

Use Cases:

  • GDPR compliance
  • HIPAA compliance
  • Data loss prevention

9. AWS CloudHSM

Purpose: Hardware Security Module (HSM) for key management.

Difference from KMS:

  • KMS: Managed, multi-tenant, simpler
  • CloudHSM: Dedicated, single-tenant, FIPS 140-2 Level 3 validated

Use Cases:

  • Strong regulatory compliance requirements
  • Need for exclusive control of cryptographic keys
  • Exportable keys

10. AWS Certificate Manager (ACM)

Purpose: Provision and manage SSL/TLS certificates.

Features:

  • Free public certificates
  • Automatic certificate renewal
  • Integration with:
    • Elastic Load Balancing
    • CloudFront
    • API Gateway

Compliance and Governance

Compliance Programs

AWS supports many compliance certifications:

StandardIndustryFocus
SOC 1/2/3GeneralService organization controls
PCI DSSPaymentsPayment card security
HIPAAHealthcareProtected health information
FedRAMPGovernmentFederal risk management
ISO 27001GeneralInformation security
GDPRPrivacyEU data protection
NISTGovernmentSecurity framework

AWS Artifact

Purpose: Portal for accessing AWS security and compliance documentation.

Contains:

  • Audit reports (SOC, PCI, ISO)
  • Agreements (BAA, NDA)
  • Compliance guides

AWS Config

Purpose: Service that enables auditing, evaluating, and recording configurations.

Features:

  • Track resource inventory
  • Assess compliance with rules
  • Detect configuration changes
  • Remediate non-compliant resources

Exam Tips - Domain 2

High-Yield Topics

  1. Shared Responsibility Model: Most important concept!

    • AWS = Security OF the cloud (physical, hardware, networking)
    • Customer = Security IN the cloud (IAM, data, OS, apps)
  2. IAM Components:

    • Users = People/applications with long-term credentials
    • Groups = Collection of users for permissions
    • Roles = Temporary credentials for services/apps
    • Policies = JSON permission documents
  3. IAM Policy Evaluation: Default DENY → Explicit ALLOW → Explicit DENY (trumps all)

  4. MFA: Multi-Factor Authentication - strongly recommended for root account

  5. Security Services:

    • KMS: Encryption key management
    • Shield: DDoS protection (Standard free, Advanced paid)
    • WAF: Web application firewall (Layer 7)
    • GuardDuty: Threat detection
    • Secrets Manager: Secret storage and rotation
    • Inspector: Vulnerability scanning
  6. Encryption:

    • At rest: KMS, CloudHSM
    • In transit: TLS/SSL, ACM
    • Client-side: Encrypt before upload

Additional Resources

DigitalCloud Training Cheat Sheets

Official AWS Documentation

AWS Security Resources


Next: Deployment & Operating Methods (Domain 3)

Released under the MIT License.