Sub topic 12
Verifying your side with AWS Config and related services
This chapter assumes you know core AWS services (EC2, S3, IAM), can read a short AWS CLI command, and understand the split between security of the cloud and security in the cloud. AWS operates the facilities, hardware, and virtualization layer. You configure what runs on top of them. Nothing in the model checks that you did this correctly, so you need to verify it yourself.
Why verification is your job
AWS gives you the controls but does not turn them on for you. A bucket can be public, a volume can be unencrypted, and a security group can be open to the internet, all inside a fully compliant AWS data center. Verification means checking, repeatedly, that your configuration matches your intent.
Three questions drive the tooling:
- What is my resource configuration right now, and what was it before?
- Does it match the rule I set?
- Who changed it, and when?
The services and what each answers
| Service | Question it answers | Typical use on your side of the model |
|---|---|---|
| AWS Config | Is this resource configured the way I require? | Rules such as "S3 buckets block public access" |
| AWS CloudTrail | Who called which API, and when? | Tracing a policy change to a principal |
| IAM Access Analyzer | Who outside my account can reach this resource? | Finding public or cross-account access |
| Amazon GuardDuty | Is something suspicious happening? | Detecting unusual API or network activity |
| AWS Security Hub | What is the combined picture across services? | One view of findings and standards checks |
Config evaluates configuration state. CloudTrail records actions. The other three add analysis and aggregation. You usually need more than one.
Step 1: Apply the control
Verification starts after you configure something. 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=trueThis one makes new EBS volumes in the Region encrypted by default. The second command reads the setting back.
aws ec2 enable-ebs-encryption-by-default --region us-east-1
aws ec2 get-ebs-encryption-by-default --region us-east-1Reading the setting back is the smallest form of verification. Note that the EBS setting is per Region, so repeat it in each Region you use.
Step 2: Check compliance with AWS Config
AWS Config must be recording before rules can evaluate anything. Once rules exist, list the ones reporting problems.
aws configservice describe-compliance-by-config-rule \
--compliance-types NON_COMPLIANTEach result names a rule and its compliance state. A rule with no results may be compliant, or it may have nothing to evaluate. Check the state before you trust an empty list.
A managed rule such as S3_BUCKET_LEVEL_PUBLIC_ACCESS_PROHIBITED or ENCRYPTED_VOLUMES lets you turn a duty from your responsibility matrix into an automatic check.
Common errors
- Config not recording in every Region. Rules in one Region say nothing about another.
- Treating "no findings" as "secure." A service only reports on what it is enabled for and what its rules cover.
- Ignoring the delegated duty. Config tells you a bucket is public. Fixing it is still your work, either manually or with remediation actions.
- Verifying only once. Configuration drifts. Evaluate continuously, not at launch.
- Missing permissions. The CLI calls fail without the matching IAM permissions, such as
config:DescribeComplianceByConfigRule.
Tying it back to the model
Each check maps to a customer duty. Encryption rules check data protection. Public access rules check network and resource configuration. CloudTrail and Access Analyzer support identity and access. When you build your responsibility matrix, add a column naming the check that verifies each control.
Exercise
Your S3 bucket has Block Public Access enabled, and the AWS Config rule for public buckets shows no NON_COMPLIANT results. Name two reasons you still cannot conclude the workload is secure.
Show answer
First, the rule covers only public bucket access. Overly permissive IAM policies, unencrypted data, or open security groups need their own rules or services. Second, an empty list may mean Config is not recording in that Region or the rule has nothing to evaluate. Check that Config is recording and that the rule's compliance state is COMPLIANT, not INSUFFICIENT_DATA.
Exercise
Which service would you use to find out which principal changed a bucket policy yesterday?
Show answer
AWS CloudTrail. It records API calls with the caller identity and time. AWS Config shows the before and after configuration but CloudTrail identifies who made the call.