Security
Overview
The Security pillar is about protecting data, systems and assets using cloud technologies, while still supporting the business. It covers who can do what (identity), how you detect problems, how you protect networks and workloads, how you encrypt data and how you respond when something goes wrong.
AWS operates under the shared responsibility model. AWS secures the facilities, hardware and managed-service infrastructure ("security of the cloud"). You secure your data, identities, configuration, operating systems on EC2 and network rules ("security in the cloud"). How much falls to you depends on the service: more for EC2, less for Lambda or S3.
Security is the largest SAA-C03 domain (30%), so be fluent in IAM, KMS, encryption in transit and at rest, network layers, logging and threat detection.
Key Concepts
- Design principles: implement a strong identity foundation, enable traceability, apply security at all layers, automate security best practices, protect data in transit and at rest, keep people away from data, prepare for security events.
- Least privilege with IAM roles (not long-lived keys), MFA, permission boundaries and SCPs for guardrails.
- Defence in depth: edge (CloudFront, WAF, Shield), network (SGs, NACLs, private subnets), compute, data (KMS, TLS).
- Encryption at rest with KMS (customer managed keys, automatic rotation yearly) and in transit with TLS via ACM certificates.
- Detection: CloudTrail, GuardDuty, Security Hub, Config, Macie, Inspector, Detective.
- Secrets belong in Secrets Manager (automatic rotation) or Parameter Store, never in code.
- Incident response: isolate, preserve evidence (snapshots), automate with Lambda/SSM and rehearse in game days.
- Shared responsibility shifts with the service type: IaaS (EC2) customers do more, managed/serverless customers do less.
Detailed Notes
Seven focus areas
- Security foundations: shared responsibility, multi-account strategy with Organizations, Control Tower guardrails.
- Identity and access management: IAM, IAM Identity Center (SSO), federation, roles, MFA.
- Detection: logging, monitoring, findings.
- Infrastructure protection: network and compute hardening.
- Data protection: classification, encryption, key management, backups.
- Incident response: preparation, tooling, forensics.
- Application security: secure development lifecycle, dependency scanning.
Service map by control type
| Control | Services |
|---|---|
| Identity | IAM, IAM Identity Center, Cognito (customer identities), Directory Service, STS |
| Governance | Organizations (SCPs), Control Tower, Config, Service Catalog |
| Detection | GuardDuty (threat detection from CloudTrail, VPC Flow Logs, DNS), Security Hub (aggregates findings), Inspector (EC2/ECR/Lambda vulnerabilities), Macie (sensitive data in S3), Detective (investigation) |
| Network protection | SGs, NACLs, WAF (L7), Shield Standard/Advanced (DDoS), Network Firewall, Firewall Manager |
| Data protection | KMS, CloudHSM, ACM, Secrets Manager, S3 Object Lock, EBS/RDS encryption |
| Audit | CloudTrail, Config, VPC Flow Logs, Artifact (compliance reports) |
| Incident response | EventBridge, Lambda, SSM Automation, snapshots, Detective |
IAM essentials
- Explicit Deny always wins; otherwise default is deny, then allow if any policy allows.
- Roles provide temporary credentials via STS; use them for EC2, Lambda, cross-account and federated access.
- SCPs set maximum permissions for accounts in an Organization but do not grant permissions; they do not apply to the management account.
- Permission boundaries cap what an IAM principal can be granted.
- Policy conditions such as
aws:MultiFactorAuthPresent,aws:SourceIp,aws:PrincipalOrgIDandaws:SecureTransporttighten access.
Encryption
| Topic | Key points |
|---|---|
| KMS | AWS managed keys vs customer managed keys (CMK); automatic rotation yearly for customer managed; envelope encryption; key policies; regional (multi-Region keys optional) |
| CloudHSM | Dedicated single-tenant FIPS 140-2 Level 3 HSM, you manage keys |
| S3 | SSE-S3 (default for all new objects), SSE-KMS, SSE-C, client-side |
| EBS / RDS | Encrypt at creation; snapshots of encrypted volumes stay encrypted; encrypt an existing unencrypted DB by copying a snapshot |
| In transit | TLS with ACM certificates on ALB/CloudFront/API Gateway; enforce HTTPS with bucket policies |
Enforcing TLS on an S3 bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::example-data-bucket",
"arn:aws:s3:::example-data-bucket/*"
],
"Condition": { "Bool": { "aws:SecureTransport": "false" } }
}
]
}
Network defence in depth
Internet -> Route 53 -> CloudFront + WAF + Shield -> ALB (public subnet)
-> app in private subnet (SG: only from ALB-SG)
-> database in isolated subnet (SG: only from app-SG, encrypted with KMS)
Security groups are stateful allow-only; NACLs are stateless with allow and deny. Use VPC endpoints to keep traffic off the internet and Network Firewall for deep inspection.
Detection and response
- Enable CloudTrail (all Regions, organisation trail, log file validation), GuardDuty, Security Hub and Config in all accounts.
- Auto-remediate with EventBridge -> Lambda/SSM; isolate a compromised instance by swapping to a quarantine security group and snapshotting its volumes for forensics.
Real World Example
Scenario — a bank moving customer-facing apps to AWS under strict regulation.
The bank adopts a multi-account landing zone with Control Tower. SCPs prevent disabling CloudTrail, leaving approved Regions or creating unencrypted volumes. Engineers sign in through IAM Identity Center federated to the corporate IdP with MFA; there are no long-lived IAM user keys.
Customer traffic passes CloudFront + WAF + Shield Advanced to an ALB. Application servers run in private subnets with security groups that allow traffic only from the ALB. Data is encrypted with customer managed KMS keys with separate key policies for each team, and DB credentials are in Secrets Manager with 30-day rotation.
An organisation-wide CloudTrail, GuardDuty and Security Hub feed a central security account. When GuardDuty flags an EC2 instance contacting a crypto-mining domain, an EventBridge rule triggers a Lambda that swaps in a quarantine security group, snapshots the volume and notifies the SOC, all within a minute.
Architecture Diagram
Edge protection, network segmentation, encryption and detection all work together.
- 1CloudFront, WAF and Shield absorb DDoS and filter malicious requests at the edge.
- 2TLS terminates at the ALB using an ACM certificate; security groups only allow ALB -> app -> database.
- 3The database is encrypted with KMS and credentials are fetched from Secrets Manager using the instance role.
- 4CloudTrail and GuardDuty send logs and findings to a central security account for detection and response.
Best Practices
- ✓Apply least privilege, use roles and temporary credentials, enforce MFA and remove unused access (IAM Access Analyzer).
- ✓Use a multi-account strategy with Organizations, SCPs and Control Tower guardrails.
- ✓Encrypt everything at rest with KMS and in transit with TLS; control key access separately from data access.
- ✓Keep workloads in private subnets; chain security groups instead of using IP ranges.
- ✓Store credentials in Secrets Manager/Parameter Store and rotate them automatically.
- ✓Enable CloudTrail, GuardDuty, Security Hub, Config and VPC Flow Logs in all accounts and Regions.
- ✓Automate detection and response with EventBridge, Lambda and SSM, and rehearse incident response.
- ✓Protect applications with WAF, Shield and a secure software supply chain (Inspector, signed artifacts).
Common Interview Questions
Exam Tips
SAA-C03 focus
- "Threat detection / unusual API calls / crypto mining" -> GuardDuty; "sensitive data (PII) in S3" -> Macie; "vulnerability scanning" -> Inspector.
- "Block a specific IP" -> NACL deny rule (security groups cannot deny).
- "Web exploits / SQL injection / XSS" -> WAF; "DDoS" -> Shield (Advanced adds DRT and cost protection).
- "Rotate database credentials automatically" -> Secrets Manager; "cheap config/secrets storage" -> Parameter Store.
- "Restrict permissions across all accounts in an Organization" -> SCP.
- "Encrypt with keys you control and audit" -> KMS customer managed key; "dedicated HSM" -> CloudHSM.
- "Application on EC2 needs AWS access" -> IAM role via instance profile, never access keys.
- "Who made this API call?" -> CloudTrail; "Compliance reports" -> AWS Artifact.
Finished this lesson?
0 of 64 lessons done · 0% of the course

