CloudTrail, Config, Inspector, CodeGuru
Lesson 3 of 4 in Securing ML and AI Workloads.
After prevention comes proof. AWS CloudTrail is the ledger of who did what: management events (who created the training job, who updated the endpoint, who changed a role) are recorded by default; data events — S3 object-level reads and writes, like "who downloaded the training dataset" — are higher-volume and opt-in, which is exactly the detail scenario questions test. AWS Config answers a different question: is every resource configured the way policy says, continuously — it records configuration history and evaluates rules (for example: notebooks must not have direct internet access, volumes must be KMS-encrypted), flagging what drifts out of compliance. CloudTrail is the security camera; Config is the building inspector.
| Service | The question it answers | When it runs |
|---|---|---|
CloudTrail | Who called which API, when, from where (data events: who touched which objects) | Continuously, as calls happen |
AWS Config | Does each resource meet the configured compliance rules — and what changed? | Continuously, on configuration change |
Do EC2 instances, ECR container images, or Lambda functions carry known CVEs or unintended network exposure? | Continuous scanning; wire findings into CI/CD gates | |
CodeGuru Security | Does the source code itself contain vulnerabilities — injection flaws, hardcoded credentials? | Static scans in the pipeline, before merge/deploy |
Amazon Macie | Is there sensitive data (PII) sitting in these S3 buckets? | Scheduled/automated discovery jobs over S3 |
In an ML pipeline these slot in at specific stations. Before training: run Macie over the candidate S3 training data — discovering customer PII before it is baked into a model beats discovering it in a model's outputs (pair with the masking work from data preparation). At build: CodeGuru Security scans the training and serving code; Inspector scans the ECR container images your jobs and endpoints will run — a vulnerable base image ships its CVEs to every endpoint that uses it. At runtime: Inspector keeps scanning hosts and Lambda, Config keeps scoring the fleet, CloudTrail keeps the ledger. Alert routing goes through EventBridge to the on-call channel like any other operational alarm.
Interactive sorting exercise: The audit asks a question — which service answers it?
Interactive checkpoint quiz (2 questions) — open this page in a browser to take it.