Sub topic 8
Your duties for data protection and encryption
This chapter assumes you know basic AWS services (S3, EBS, KMS), understand encryption at rest and in transit, and can read a short AWS CLI command. Under the shared responsibility model, AWS provides the encryption capabilities and the key infrastructure. You decide whether to use them, which keys to use, and who may use those keys.
Classify data first
Every other data protection decision depends on classification. AWS does not know which of your objects hold customer records and which hold public images. You decide what each dataset is and what protection it needs.
A simple scheme has three or four levels, such as public, internal, confidential, and regulated. Record the level on the resource itself with a tag, for example data-classification=confidential. Tags let you write policies and Config rules that apply stricter checks to higher levels.
What AWS provides and what you choose
| Area | AWS provides | You decide |
|---|---|---|
| Encryption at rest | Encryption features in S3, EBS, RDS and others, backed by AWS KMS | Whether to enable it, and which key type to use |
| Key management | Durable, access-controlled key storage in KMS | Key policies, grants, rotation, and who can use each key |
| Encryption in transit | TLS endpoints on AWS service APIs | Requiring TLS for your own applications, certificates, and bucket policies |
| Data access | Authorization engine | Who can read the data, and the permissions that grant it |
Many services now encrypt at rest by default with AWS-owned or AWS-managed keys. That protects against loss of physical media. It does not give you control over key access or an audit trail of key use. If your classification requires those, choose a customer managed KMS key.
Encrypt at rest
Encryption settings are often left to chance because the default differs by service. Turn the setting on explicitly where you can. This command makes new EBS volumes in a Region encrypted by default:
aws ec2 enable-ebs-encryption-by-default --region us-east-1
aws ec2 get-ebs-encryption-by-default --region us-east-1The setting is per Region and applies only to new volumes. Existing unencrypted volumes stay unencrypted until you copy them from a snapshot with encryption enabled.
For data in S3, the related choice is the default encryption key for each bucket. Use SSE-KMS with a customer managed key when you need key-level access control and CloudTrail records of each key use.
Encrypt in transit
AWS endpoints accept TLS, but nothing forces your clients to use it. You enforce it. For S3, add a bucket policy statement that denies any request where aws:SecureTransport is false. For your own load balancers, choose a modern TLS security policy and manage the certificates, typically with AWS Certificate Manager.
Control who can use the data and the keys
Encryption moves the access question from the data to the key. A key policy that is too broad undoes the protection. Apply least privilege to both the data and the key, and separate the people who administer a key from the people who use it.
Public exposure is the other data-access failure. Whether an S3 bucket is public is a customer configuration choice, even though AWS operates S3. This command turns on all four Block Public Access settings for one bucket:
aws s3api put-public-access-block \
--bucket amzn-s3-demo-bucket \
--public-access-block-configuration \
BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=trueHow the pieces fit
Verify your side
Configuration drifts. Someone creates a bucket without default encryption, or a new Region is used without the EBS setting. Use AWS Config rules to detect this, then list the rules that report problems:
aws configservice describe-compliance-by-config-rule \
--compliance-types NON_COMPLIANTManaged rules exist for checks such as encrypted volumes and S3 bucket encryption. An empty result means no rule currently reports a violation. It does not mean you have a rule for every control.
Common errors
- Assuming AWS encrypts everything in a way that satisfies your compliance rules, without checking which key protects each service.
- Enabling EBS default encryption in one Region and forgetting the others.
- Granting
kms:*to broad roles, which makes encryption irrelevant to those roles. - Encrypting at rest but allowing plain HTTP requests.
- Deleting or disabling a KMS key without confirming that no data still depends on it. Encrypted data becomes unreadable.
Exercise
A team enables S3 default encryption with an AWS-owned key and says the data is now fully protected under the shared responsibility model. Name two duties that remain theirs.
Show answer
Any two of: classifying the data to decide whether stronger protection is needed (such as a customer managed KMS key with its own policy and CloudTrail logging); controlling who can read the objects and use the key; enforcing TLS for requests; blocking public access; and verifying the configuration with AWS Config.
Exercise
You run aws ec2 enable-ebs-encryption-by-default --region us-east-1. Does this encrypt your existing volumes, and does it cover volumes created in eu-west-1?
Show answer
No to both. The setting applies only to new volumes and only in the Region where you set it. Existing volumes must be copied through an encrypted snapshot, and each other Region needs its own setting.