The Anchore ServiceNow integration imports your container images and the vulnerabilities Anchore Enterprise finds in them into ServiceNow Vulnerability Response. Security teams can then triage, group, report on, and remediate container vulnerabilities with the ServiceNow workflows they already use.
Choosing an Integration
The integration ships as two product lines, one for each generation of ServiceNow’s container vulnerability module. Install the one that matches your instance.
| Line | ServiceNow module | Current release |
|---|---|---|
usem | Unified Security Exposure Management (USEM): Vulnerability Response and Containers 30.x, on Zurich | usem 2.0.0 |
cvr | Container Vulnerability Response, Containers 2.x | cvr 1.0.0 |
Both lines work the same way. The differences are called out where they matter below. See the ServiceNow Integration release notes for what each release contains.
Requirements
- Anchore Enterprise v5.x or later, with a user that has at least read access.
- ServiceNow applications: Vulnerability Response and Vulnerability Response and Configuration Compliance for
Containers, at the version for your line (30.x for
usem, 2.x forcvr), and Vulnerability Response Integration with NVD, which supplies CVSS scores and risk ratings. Forusem, the NVD integration is optional: without it, vulnerable items show a risk rating of “5 - None”, and the Anchore data still imports in full. - A MID Server that can reach both your ServiceNow instance and the Anchore Enterprise API. Anchore Enterprise needs no inbound access from ServiceNow.
- Container images in the ServiceNow CMDB. The integration matches the Docker Images already in ServiceNow to the images Anchore has analyzed, by image digest. It covers images that are in both systems.
How It Works
The integration is a ServiceNow application with two integrations: one imports images, the other imports their vulnerabilities. Each run, on demand or on a schedule, works in two stages.
- Collect. The integration script calls the Anchore Enterprise API through the MID Server. It asks Anchore for
a summary of every analyzed image (
/v2/summaries/image-tags) and matches those images to your Docker Images by digest. For each matching image, the vulnerabilities integration then fetches the image’s ancestry (/v2/images/<digest>/ancestors) and all of its vulnerabilities (/v2/images/<digest>/vuln/all). When Anchore finds a base image, the integration passes its digest so that Anchore reports which vulnerabilities come from the base image. The results are saved to ServiceNow as JSON attachments, which ServiceNow turns into Import Sets. - Process. ServiceNow runs the integration’s processor script over each Import Set row. The processor looks up the vulnerability (often already in ServiceNow from the NVD integration) and the Docker Image, using a CMDB Lookup Rule, and writes the finding and its container vulnerable item.
Images are processed in batches, 50 per Import Set by default, so ServiceNow starts processing the first batch while the integration is still collecting the rest.
What You See in ServiceNow
- Findings and container vulnerable items that match Anchore’s vulnerability report for each image, one for one. A finding names the vulnerability, the affected package with its type, version, file path, and package URL, the image’s registry and repository, and whether the vulnerability comes from the image’s base image layer.
- First found and last found times. First found is Anchore’s detection time for the vulnerability. In
usem, last found is the time of the run that last saw the vulnerability. Incvr, it is also Anchore’s detection time. - Image records (
usem). Every image that Anchore has analyzed and that ServiceNow holds as a Docker Image becomes a Discovered Container Image, linked to its Docker Image CI and its container repository. - Records attributed to Anchore (
usem). Findings, vulnerable items, and discovered images carry the Anchore integration as their source, so you can filter and report on Anchore results and run the integration alongside other container scanners. - Repositories. The processor identifies each image’s repository from its tag. With Add Missing Repos? set to true, it creates repositories that do not exist yet.
In usem, each run updates the records the previous run wrote rather than adding duplicates, and a vulnerable item
stays open while the daily run keeps finding the vulnerability. Once Anchore no longer reports it, because it was fixed or
because the image was deleted from Anchore, USEM’s Container last scanned auto-close rule closes the item as
Closed – Fixed two to three days after the last run that found it.
Installing
Contact Anchore Customer Success for the release package and its install guide. Releases are published as GPG-signed zips with SHA-256 checksums, so you can verify the package before installing it.
The install guide covers these steps:
- Install the ServiceNow applications listed under Requirements. For
usem, installing Vulnerability Response and Configuration Compliance for Containers 30.x from Application Manager also installs Vulnerability Response and its other dependencies, and can take a few hours. - Set up a MID Server on a host that can reach ServiceNow and the Anchore Enterprise API, and validate it. For
usem, the MID Server user needs themid_serverandsnc_basic_auth_api_accessroles, because ServiceNow rejects basic-auth API calls from users without the second role. - Import the Anchore application into ServiceNow from the release package.
- Configure the integration with your Anchore Enterprise details. For
usem, a setup script creates the records an application import cannot carry and checks the configuration. Its first run is a preview that lists every change and writes nothing. The setup script is designed for development and test instances: review it, and the changes its preview lists, before running it on a production instance. - Run both integrations, images first, and then schedule both to run at least once a day.
To confirm the install, check that both runs show Complete with the result Success under Vulnerability Response > Integration Runs, and that container vulnerable items appear for your images.
Configuration Settings
Set these in the Anchore integration’s configuration in ServiceNow.
| Setting | Description |
|---|---|
| Username and Password | An Anchore Enterprise user with at least read access, and its password. usem stores the password encrypted, and only the two integration scripts can decrypt it. |
| Anchore API | The Anchore Enterprise API URL, as the MID Server reaches it, starting with http:// or https://, including the port, and without a trailing slash. |
| Midpoint Server | The MID Server that relays requests to Anchore Enterprise. |
| Enable Debug Logging? | When true, the integration logs in much more detail. |
| SNOW Image List - Encoded Query String | An encoded Glide query that selects which images in the cmdb_ci_docker_image table to cover. By default, all images. |
| Add Missing Repos? | When true, creates repositories that are missing from cmdb_ci_container_repository, based on each image’s tag. When false, the repository is looked up and left blank if not found. |
| Vuln Processor Batch Size - Image Count | The number of images per Import Set. Default: 50. |
Anchore API Timeout (seconds) (usem) or HTTP Timeout (cvr, in milliseconds) | How long to wait for an Anchore API response, including ECC Queue and MID Server latency. The usem default is 120 seconds and the cvr default is 15 seconds. |
The integration can also read images from an Anchore account other than the configured user’s own, through an optional account setting.
Performance Tuning
Batch Size
Set the batch size so that, in the vulnerability integration run statistics, the REST API time and the Import queue processing time are roughly balanced at about five minutes. A larger batch takes longer to reach the import queue, which lengthens the run. A smaller batch adds overhead for the larger number of Import Sets.
MID Server Latency and Scale
Every API call goes through the ServiceNow ECC Queue to the MID Server and on to Anchore Enterprise, and the integration makes its requests one at a time: two at the start of a run, then two for each image. MID Server latency therefore sets the pace of a run, and it depends heavily on load. Run a dedicated MID Server for the Anchore integration, or schedule runs for when the MID Server is least busy.
For deployments querying 10,000 or more images:
- Increase the MID Server’s Max Payload (
mid.eccq.max_payload_size) so it can carry Anchore’s summary of all images. - Disable the HTTP Max Timeout system property (
glide.http.outbound.max_timeout.enabled=false). - Increase the integration’s API timeout so that the
/v2/summaries/image-tagscall can complete.
Anchore Enterprise computes an image’s vulnerability report the first time it is requested, so the first run against
large images takes longer. usem waits up to the API timeout for each report and retries a request once if the MID
Server returns no HTTP response.
Troubleshooting
- Logs: set Enable Debug Logging? to true for detailed logs. The
usemintegration logs under the sourcex_1105186_anchore. - Skipped images (
usem): if Anchore Enterprise cannot return an image’s vulnerabilities within the API timeout, the run logs an error naming the skipped images, and those images are not updated even though the run reports success. Increase the API timeout and run again. - HTTP 401 from Anchore Enterprise: check the Anchore username and password. In
usem, if the log also shows “Access Denied to cryptographic module”, the module access policy for that integration script is missing or set to Reject. Set it to Track under Key Management > Module Access Policies, or import the application again. - Image tags in USEM: an image’s tag is on its container repository entry, which is linked to the image record, not on the image record itself.
- Other scanners: image records in the CMDB are shared with other scanners, so an image may show another scanner as its creator while the Anchore findings on it show Anchore as their source.