Scan an Amazon EC2 AMI for software vulnerabilities with Amazon Inspector
Amazon Inspector is a vulnerability management service that scans your AWS workloads, including your Amazon EC2 AMIs, for software vulnerabilities. Two scan types are available: an on-demand scan of an AMI, and continuous AMI scanning on an AWS account. For more information, see Scanning machine images with Amazon Inspector in the Amazon Inspector User Guide.
When Amazon Inspector scans an AMI, Amazon EC2 makes the scan results available for the AMI. The
scan results include a summary and the detailed findings. You can view the summary in the
ScanResults field of the describe-images response, and you can
view the detailed findings with the get-image-findings command. In the Amazon EC2
console, you can view both on the Security tab for the AMI.
When you share an AMI with other AWS accounts, organizations, or organizational units (OUs), or make it public, its scan results and findings are available to those accounts along with the AMI. When you copy an AMI, Amazon EC2 copies the scan results summary and the source AMI's top 50 findings to the new AMI, so the copy can have fewer findings than the source AMI. This number might change in the future.
You can use Allowed AMIs to permit only AMIs that meet your scan-result criteria. To do so,
add a ScanResultCondition to your Allowed AMIs settings. For more information,
see Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs.
Topics
Run an on-demand scan of an AMI
You can run an on-demand scan of an AMI that you own. You don't need to activate Amazon Inspector to run an on-demand scan. An AMI can have only one scan in progress at a time, and you can have up to 20 on-demand scans in progress at the same time. When the scan completes, Amazon Inspector sends the results to Amazon EC2. The results of an on-demand scan don't appear in the Amazon Inspector console. For more information, see Running on-demand machine image scans with Amazon Inspector in the Amazon Inspector User Guide.
Enable continuous AMI scanning
With continuous AMI scanning, Amazon Inspector monitors the AMIs in your account that match the scanning criteria that you define, and scans them for software vulnerabilities. You can view the results in the Amazon Inspector console or in the Amazon EC2 console. When you share a scanned AMI, the accounts that you share it with can also view its scan results.
To scan the AMIs in your account continuously, activate AMI scanning in Amazon Inspector. To open the Amazon Inspector console from the Amazon EC2 console, choose Actions, Security, Manage AMI scanning. For more information, see Configuring machine image scanning in the Amazon Inspector User Guide.
View a summary of the scan results for an AMI
The scan results summary for an AMI includes the following:
-
HighestFindingSeverityLabel– The highest severity among the AMI's findings, whether or not a fix is available. The value isinformational,low,medium,high, orcritical. -
FindingScanDate– The date and time of the most recent Amazon Inspector scan of the AMI. -
InformationalFixAvailableSince,LowFixAvailableSince,MediumFixAvailableSince,HighFixAvailableSince, andCriticalFixAvailableSince– For each severity, the earliest date and time that Amazon Inspector reported a fix as available for a finding of that severity on the AMI. Amazon EC2 returns each field only when such a finding exists. These dates are specific to the AMI. Each date reflects when a fix became available for a finding on that AMI, not when the vendor released the fix. As a result, a date can be later than the vendor's release date, and AMIs with the same vulnerability can have different dates.
You can view the scan results for an AMI that you scanned, and for a shared or public AMI that Amazon Inspector has scanned.
View the detailed findings for an AMI
Each finding includes the title, the severity label, and the Amazon Inspector score. Each finding shows whether a fix is available, and when Amazon Inspector first observed and last updated the finding. Each finding also includes the ID of the Amazon EBS snapshot where Amazon Inspector detected the vulnerability, and the affected file paths. Amazon EC2 returns up to 10 affected file paths for each finding.
To view the history of on-demand scans for an AMI, select the AMI in the Amazon EC2
console and choose the Security tab. The describe-images
and get-image-findings responses don't include the scan history. For more
information, see Running on-demand machine
image scans with Amazon Inspector in the Amazon Inspector User Guide.
Pricing
Amazon Inspector charges for both on-demand scans and continuous AMI scanning. For more
information, see Amazon Inspector
pricing