How do you ensure all new EBS volumes and RDS instances are encrypted, even if a team forgets?
IntermediateScenarioContainer and IaC Security
Answer
Situation read → Rely on defaults and guardrails, not on remembering.
What I'd do →
- Turn on EBS encryption by default per region:
aws ec2 enable-ebs-encryption-by-default. - Use IaC modules where
storage_encrypted = trueis hard-coded. - Add an SCP denying
rds:CreateDBInstancewhenrds:StorageEncryptedis false. - Add AWS Config rules (
encrypted-volumes,rds-storage-encrypted) with auto-remediation or alerts. - Use customer managed KMS keys for sensitive data with key policies.
Why → Preventive controls beat detective ones; you want both.
Interview tip → Remember that you cannot encrypt an existing unencrypted RDS instance in place; you restore from an encrypted snapshot copy.
More on Container and IaC Security
A team asks whether to use `ubuntu`, `alpine` or a distroless base image. How do you advise?Beginner`trivy image` shows 300 vulnerabilities in your app image. How do you bring this down?BeginnerA Dockerfile runs the app as root. How do you fix it and prove the fix?IntermediateCheckov fails a Terraform PR because an S3 bucket allows public access. What do you change?BeginnerHow do you set up image scanning so nothing vulnerable reaches production?IntermediateAn image passed scanning three weeks ago and runs in production. A new critical CVE is published today. What happens next?Intermediate