Container Vulnerability
The Lacework Platform provides the capability to scan container images for vulnerabilities at both build time and runtime. The Lacework CLI provides the lacework vulnerability container sub-command with a number of capabilities to retrieve data about container vulnerability assessments, which is designed for individuals or teams responsible for tracking and remediating vulnerabilities by providing relevant data to help with prioritization through the ability to sort assessments by what is actively running in the environment, and by filtering on vulnerabilities that have available fixes.
To view all container vulnerability assessments for your Lacework account for the last 24 hours (default):
lacework vulnerability container list-assessments
Additionally, you can filter results with the following flags:
--fixabledisplays only vulnerabilities with fixes--repositorydisplays assessments for the specific repository
Note: You may pass this flag multiple times to filter on multiple repositories--registrydisplays assessments for the specific registry--startspecifies the start of the time range in UTC (format:yyyy-MM-ddTHH:mm:ssZ)--endspecifies the end of the time range in UTC (format:yyyy-MM-ddTHH:mm:ssZ)--rangenatural time range
You can specify different start and end times in one of the following formats:
- A relative time specifier
- RFC 3339 date and time
- Epoch time in milliseconds
To view all of the containers in your environment with vulnerabilities that have fixes.
lacework vulnerability container list-assessments --fixable
To request an on-demand container vulnerability scan.
lacework vulnerability container scan <registry> <repository> <tag|digest>
Where:
<registry>is the container registry where the container image has been published<repository>is the repository name that contains the container image<tag|digest>could be, either a tag or an image digest to scan (digest format:sha256:1ee...1d3b)
Scans can take up to 15 minutes to return results.
The following is an example of integrating the lacework vulnerability container command into a CI pipeline. The specific example requests an on-demand container vulnerability scan and waits for the scan to complete (results will be displayed in the terminal):
lacework vulnerability container scan <registry> <repository> <tag|digest> --poll --noninteractive
The
--noninteractiveflag disables interactive progress bars. ⏲️
When the flag --poll is specified, there are a few other flags you can use to modify the output of the assessment:
--fixabledisplays only fixable vulnerabilities--packagesmodifies the output format to show a list of packages with CVE count--htmlgenerates a vulnerability assessment in HTML format--fail_on_fixablereturns a non-zero exit code if the assessed container has fixable vulnerabilities--fail_on_severityallows you to specify a severity threshold to fail (return a non-zero exit code) if vulnerabilities are found
(available severities are critical, high, medium, low, and info)
To view a specific container vulnerability assessment use the command.
lacework vulnerability container show-assessment <sha256:hash>
You can extend the details of a vulnerability assessment by providing the flag --details.
Additionally, there are a few more flags you can use to modify the output of the assessment:
--fixabledisplays only fixable vulnerabilities--packagesmodifies the output format to show a list of packages with CVE count--htmlgenerates a vulnerability assessment in HTML format--csvoutputs the assessment in CSV format--fail_on_fixablehelps automated pipelines to fail if the assessed container has fixable vulnerabilities--fail_on_severityallows you to specify a severity threshold to fail if vulnerabilities are found (available severities are critical, high, medium, low, and info)
Generate Static HTML Vulnerability Assessment
To provide developers with clear, actionable, insights to understand and remediate vulnerabilities, the Lacework CLI has the ability to generate static HTML files of container vulnerability assessments.
Use the flag --html in the following commands:
lacework vulnerability container scanlacework vulnerability container show-assessment
The result is a standalone HTML file that can be downloaded and shared with other teams without additional artifacts, it looks exactly like the Lacework Console! 🖥️
