Q: What is Amazon Inspector and when would you use it?
Amazon Inspector is AWS's managed vulnerability management service: it continuously scans EC2 instances, container images in ECR and Lambda functions for known software vulnerabilities (CVEs) and unintended network exposure, and.
Want to master this scenario in a live sandbox? Stephane Maarek's AWS Certified DevOps Engineer Professional Masterclass on Udemy covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: <strong>Amazon Inspector</strong> is AWS's managed vulnerability management service: it continuously scans EC2 instances, container images in ECR and Lambda functions for known software vulnerabilities (CVEs) and unintended network exposure, and produces prioritized findings. You use it when you need always-on, automated coverage of workloads against known CVEs without running your own scanners. Interviewers ask about it to check you understand the security tooling landscape: Inspector finds vulnerable packages, while GuardDuty detects threats, Config tracks configuration and Security Hub aggregates findings. A good answer covers setup, how scanning works, triage and where it fits in CI and operations.
What Inspector scans and how
Inspector (the current generation, often called Inspector v2) is continuous and event-driven.
- EC2: uses the SSM Agent to inventory installed packages and compares them to a vulnerability database; instances must be SSM managed. An agentless option scans EBS snapshots for instances without SSM. It also reports network reachability findings.
- ECR images: scans on push and re-scans continuously when new CVEs are published, once enhanced scanning is enabled for the registry.
- Lambda: scans function dependencies, and with Lambda code scanning can also flag code-level issues in your own function code.
- Output: findings with a severity and an Inspector score that adjusts for context, with exploit information included, sent to the console, EventBridge and Security Hub, plus SBOM export for supported resources.
- When to use it: any account running EC2, containers in ECR or Lambda where compliance (patching SLAs, audit evidence) or security hygiene needs continuous, centralized CVE visibility.
Hands-on: enable Amazon Inspector and read findings
Turn it on for the resource types you run, then query findings.
aws inspector2 enable --resource-types EC2 ECR LAMBDA --account-ids 111122223333
aws inspector2 batch-get-account-status --account-ids 111122223333
aws inspector2 list-coverage \
--filter-criteria '{"resourceType":[{"comparison":"EQUALS","value":"AWS_EC2_INSTANCE"}]}' \
--query 'coveredResources[].[resourceId,scanStatus.statusCode,scanStatus.reason]'
aws inspector2 list-findings \
--filter-criteria '{"severity":[{"comparison":"EQUALS","value":"CRITICAL"}],"fixAvailable":[{"comparison":"EQUALS","value":"YES"}]}' \
--query 'findings[].[title,resources[0].id,inspectorScore]' --output table
- Enable per account and region: scanning is regional, so enable in every region you use.
- Organizations: designate a delegated administrator to enable Inspector for all member accounts and see findings centrally.
- Coverage check:
list-coverageshows which instances, repositories and functions are actually scanned and why others are not. - Filter findings: narrow to critical, fixable and in-use vulnerabilities first.
- Scan latency: new resources are typically discovered automatically, but allow time for the first scan; do not assume instant results in the first minutes.
Containers: enhanced scanning and CI
Move detection left and keep images watched after release.
aws ecr put-registry-scanning-configuration --scan-type ENHANCED \
--rules '[{"scanFrequency":"CONTINUOUS_SCAN","repositoryFilters":[{"filter":"*","filterType":"WILDCARD"}]}]'
# Fail a pipeline step if critical fixable findings exist for one repo
COUNT=$(aws inspector2 list-findings --filter-criteria \
'{"ecrImageRepositoryName":[{"comparison":"EQUALS","value":"my-app"}],"severity":[{"comparison":"EQUALS","value":"CRITICAL"}],"fixAvailable":[{"comparison":"EQUALS","value":"YES"}]}' \
--query 'length(findings)')
[ "$COUNT" -eq 0 ] || { echo "Critical fixable CVEs: $COUNT"; exit 1; }
- Registry setting: switch ECR from basic to enhanced scanning to use Inspector; choose scan-on-push and continuous scan filters per repository.
- Pipeline gate: after pushing an image, query findings for that repository and fail the pipeline on critical fixable CVEs; Inspector also offers a CI/CD scanning integration for build systems.
- Continuous value: an image that was clean at build time gets findings later when a new CVE is disclosed, which one-off scanners miss.
- Remediate: rebuild on an updated base image and redeploy; patch EC2 through Systems Manager Patch Manager.
- What it cannot see: findings reflect packages Inspector can inventory; custom-compiled or vendored binaries may be missed, so pair with SBOM and software composition analysis in CI.
Inspector vs GuardDuty, Config and Security Hub
Knowing what it does not do is part of the answer.
- Inspector: finds vulnerable software and exposure before an attacker exploits it.
- GuardDuty: detects suspicious activity and threats, such as credential misuse or malware communication, in logs and runtime.
- AWS Config: records and evaluates resource configuration, for example an unencrypted volume or public bucket; Inspector does not audit those settings.
- Security Hub: aggregates findings from all of these into one view and supports automated response.
- Legacy: the older Inspector Classic with assessment runs and agents has been replaced by the current service.
- Ownership: security owns enablement and policy, but service teams own remediation; align on severity-based SLAs.
Operate it day to day
Make findings actionable rather than noisy.
- Prioritize: start with critical or high findings that have a fix available, are network reachable, or run in production.
- Suppression rules: create filters with action
SUPPRESSfor accepted risks, with a documented reason and review date. - Automate response: route findings through EventBridge to tickets, chat or an SSM automation that patches instances.
- Track SLAs: measure time-to-remediate by severity and report coverage gaps, such as instances without a working SSM Agent.
- Cost awareness: pricing is based on scanned resources; check current pricing before enabling everywhere and use the free trial to estimate.
- Evidence for audits: export findings and SBOMs to S3 on a schedule to show continuous coverage.
- Amazon Inspector is a continuous vulnerability scanner for EC2, ECR images and Lambda that reports CVEs and network exposure with prioritized scores.
- I verify coverage with list-coverage and review findings filtered by severity and fix availability.
- I automate enablement through Organizations, gate pipelines on critical fixable findings, and route findings to Security Hub and EventBridge for remediation.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Assuming Inspector scans every EC2 instance by default Instances need SSM management (or agentless eligibility), so unmanaged ones go unscanned; check coverage.
- Expecting it to catch misconfigurations or active threats That is the role of AWS Config and GuardDuty; Inspector focuses on vulnerabilities and exposure.
- Leaving ECR on basic scanning Basic scanning does not provide the continuous, Inspector-powered re-scan when new CVEs appear.
- Enabling it in one region only Inspector is regional; workloads elsewhere are not covered.