Lesson 1 of 3 Amazon Inspector and Secure Pipelines

Managing Vulnerabilities with Amazon Inspector

This lesson explains how Amazon Inspector, the AWS automated vulnerability management service, continuously discovers workloads and scans them for known vulnerabilities and unintended network exposure.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the resource types Inspector scans and what it finds.
  • Explain how the Inspector score adjusts CVSS severity to the environment.
  • Describe how Inspector is enabled across an organisation.
  • Prioritise findings by network reachability.

What Inspector scans

Amazon Inspector finds software vulnerabilities, identified by CVE (Common Vulnerabilities and Exposures) numbers, and unintended network exposure across several resource types. For EC2, it scans operating system packages either through the SSM Agent or agentlessly, from EBS snapshots, for instances without the agent. Its network reachability findings show which ports are reachable from outside and the network path that allows it. For ECR container images, it scans when an image is pushed and continuously afterwards as new CVEs are published, and shows which running ECS tasks and EKS pods use an affected image.

For Lambda, standard scanning finds vulnerable dependencies in function packages and layers, and code scanning examines the function's own code for flaws such as injection, data leaks, weak cryptography and hard-coded secrets. Inspector code security extends scanning to source code repositories. The following table summarises the targets.

TargetScanning
EC2OS and package CVEs, with an agent (SSM Agent) or agentlessly from EBS snapshots; network reachability findings show reachable ports and the path
ECR imagesOn push and continuously as new CVEs appear; mapped to running ECS tasks and EKS pods
LambdaStandard: vulnerable dependencies in packages and layers. Code scanning: injection, data leaks, weak crypto, hard-coded secrets
Source repositoriesInspector code security
Match the pairs

What Inspector scans

Exam skills 3.2.3

Match each resource with what Amazon Inspector scans in it.

Log in to try this activity Interactive activities are free with an account.

Findings

A vulnerability's general severity, expressed as a Common Vulnerability Scoring System (CVSS) score, says how dangerous it can be, but not how dangerous it is in a particular environment. A critical vulnerability on an instance that is unreachable from any network is less urgent than a medium one on an internet-facing server with a public exploit. Amazon Inspector reports each vulnerability as a finding with a score adjusted to the environment, so that teams fix the most important ones first. The following list describes the characteristics of these findings.

  • The Inspector score adjusts the CVSS base score for your environment (reachability, exploit availability).
  • Findings close automatically when fixed; suppression rules hide accepted risks.
  • SBOM export produces software bills of materials.

The following diagram shows how two kinds of Amazon Inspector finding overlap to identify which of hundreds of critical vulnerabilities to patch first.

Prioritising hundreds of critical CVEs. Instances that appear in both Inspector lists, critical findings with a known exploit and network reachability findings with an open path from the internet, are patched first; the rest follow the normal cycle, and suppression rules record accepted risks.
The circles are not to scale.
Scenario questions

Prioritising Inspector findings

Exam skills 3.2.3 · 3.3.5

Use Inspector findings to decide what to fix first.

Log in to try this activity Interactive activities are free with an account.

Organisation setup

Inspector is enabled across an organisation from a delegated administrator account, which activates scan types for all member accounts and turns on auto-enable so new accounts are covered. As with GuardDuty and Security Hub, this must be done in each Region. Findings are sent to Security Hub for a combined view with other security services, and to EventBridge, where rules can create tickets or start automated patching with Systems Manager Patch Manager.

True or false

Inspector across an organisation

Exam skills 3.2.3 · 6.1.4

Check how Inspector is enabled and integrated organisation-wide.

Log in to try this activity Interactive activities are free with an account.
Worked example

Finding what is actually exposed

Inspector reports hundreds of critical CVEs, more than the team can fix this week. The question is which ones attackers can reach. Filtering for critical findings on instances that also have a network path from the internet narrows the list dramatically:

aws inspector2 list-findings --filter-criteria '{
  "severity":[{"comparison":"EQUALS","value":"CRITICAL"}],
  "findingStatus":[{"comparison":"EQUALS","value":"ACTIVE"}],
  "resourceType":[{"comparison":"EQUALS","value":"AWS_EC2_INSTANCE"}],
  "exploitAvailable":[{"comparison":"EQUALS","value":"YES"}]
}' --query 'findings[].{id:resources[0].id,cve:packageVulnerabilityDetails.vulnerabilityId,score:inspectorScore}'

aws inspector2 list-findings --filter-criteria '{
  "findingType":[{"comparison":"EQUALS","value":"NETWORK_REACHABILITY"}]
}' --query 'findings[].{instance:resources[0].id,ports:networkReachabilityDetails.openPortRange}'

Instances that appear in both lists, with a known exploit and an open path from the internet, are patched first; the Inspector score already raises such findings. The rest follow the normal patch cycle. Suppression rules record accepted risks, for example a vulnerable library that is never loaded, so they stop distracting the team.

Check yourself

How can Inspector scan EC2 instances that have no agent?

Show answer

With agentless scanning, which analyses EBS snapshots.

Exam Tips

Remember for the exam

  • Continuous CVE scanning across EC2, ECR images and Lambda points to Amazon Inspector.
  • To see which EC2 ports can be reached from the internet, use Inspector network reachability findings.
  • To scan instances without an agent, use Inspector agentless scanning.
  • For a software bill of materials for workloads, use Inspector SBOM export.
  • Hard-coded secrets in Lambda code are found by Inspector Lambda code scanning.