Sub topic 4
Security: protecting data, systems and assets
This chapter assumes you know core AWS services such as IAM, S3, EC2 and VPC. It also assumes you have read the shared responsibility chapter. The Security pillar covers how you protect data, systems and assets using cloud technologies. It sits close to the shared responsibility model: AWS secures the cloud itself, and you secure what you put in it.
Design principles
The pillar lists seven design principles.
- Implement a strong identity foundation. Apply least privilege and separation of duties. Centralize identity management and avoid long-term static credentials.
- Maintain traceability. Monitor, alert on and audit actions and changes in real time.
- Apply security at all layers. Use defense in depth: edge, VPC, load balancer, instance, operating system and application.
- Automate security best practices. Software-based controls scale and are repeatable.
- Protect data in transit and at rest. Classify data by sensitivity and use encryption, tokenization and access control.
- Keep people away from data. Reduce direct access and manual processing.
- Prepare for security events. Run incident response simulations and use tools that speed up detection and recovery.
Best practice areas
The pillar groups its questions and best practices into areas. Each area maps to familiar AWS services.
| Area | Question it answers | Typical services |
|---|---|---|
| Security foundations | How do you operate the workload securely? | AWS Organizations, accounts, SCPs |
| Identity and access management | Who can do what? | IAM, IAM Identity Center |
| Detection | How do you spot unexpected activity? | CloudTrail, GuardDuty, Security Hub |
| Infrastructure protection | How do you protect networks and compute? | VPC, security groups, AWS WAF |
| Data protection | How do you protect data at rest and in transit? | KMS, ACM, S3 |
| Incident response | How do you respond to and recover from events? | Runbooks, snapshots, isolation |
Worked example: protecting data in transit
Data protection is a common source of review findings. A bucket that accepts plain HTTP lets requests travel unencrypted. This bucket policy denies any request that does not use TLS.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Principal": "*",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::example-bucket",
"arn:aws:s3:::example-bucket/*"
],
"Condition": {
"Bool": { "aws:SecureTransport": "false" }
}
}
]
}The Deny applies to every principal. The condition matches only when aws:SecureTransport is false, so HTTPS requests are unaffected. Replace example-bucket with your bucket name before applying it.
Common errors
- Using IAM users with long-term access keys where roles with temporary credentials would work.
- Granting
Action: "*"onResource: "*"to make something work, then never narrowing it. - Enabling encryption at rest but ignoring data in transit, or the reverse.
- Turning on CloudTrail in one Region or account only, which leaves gaps in traceability.
- Writing no incident response plan, so the first rehearsal is a real incident.
How this shows up in a review
In a Well-Architected review, each Security question has best practices you mark as followed or not. Unfollowed practices raise the question's risk level to medium or high. For example, not enforcing least privilege typically produces a high risk item. You will handle those risk levels in a later chapter.
Exercise
A reviewer finds that an application uses an IAM user with a permanent access key stored in its configuration file. Which design principle does this violate, and what is the fix?
Show answer
It violates "implement a strong identity foundation" because it relies on a long-term static credential. Replace the user with an IAM role, for example an instance profile for EC2 or a task role for containers, so the application receives temporary credentials that rotate automatically.
Exercise
Why does the bucket policy above use Deny with a Bool condition instead of an Allow for HTTPS requests?
Show answer
An Allow for HTTPS would not block HTTP requests that another policy permits. An explicit Deny on aws:SecureTransport being false overrides every Allow, so insecure requests are always rejected.