STIG for Container Images

Introduction

The Anchore STIG for Container Images feature is intended to allow users to perform STIG evaluations against container images and then manage them from within Anchore Enterprise. The STIG evaluation can be generated by using an AnchoreCTL workflow, described below. AnchoreCTL will generate a STIG evaluation using the cinc-auditor tool and a specified STIG profile.

Performing STIG Checks

STIG evaluations can be generated using an AnchoreCTL workflow.

Prerequisites of Running STIG Checks Locally

AnchoreCTL STIG evaluations are performed locally and as such there are some dependencies that must be present.

  • Docker Engine v20.10 or later - Install docs
  • Cinc Auditor - Install docs
  • AnchoreCTL - Install docs
  • Anchore Static STIG AddOn entitlement - This is a static entitlement that must be added to your Anchore Enterprise license and enabled on your Anchore Enterprise deployment. Please contact your Anchore Customer Success Team to obtain your entitlement.
  • The AnchoreCTL instance must be running on a linux host or a linux container that has access to the docker socket.

STIG Profiles

Anchore provides a set of STIG profiles that can be used to perform STIG evaluations against container images:

ProfileEvaluatesProvenance
rhel8Red Hat UBI 8 / RHEL 8 imagesMITRE SAF InSpec baseline implementing the DISA Red Hat Enterprise Linux 8 STIG
rhel9Red Hat UBI 9 / RHEL 9 imagesMITRE SAF InSpec baseline implementing the DISA Red Hat Enterprise Linux 9 STIG
ubuntu2204Ubuntu 22.04 imagesMITRE SAF InSpec baseline implementing the DISA Canonical Ubuntu 22.04 LTS STIG
ubuntu2404Ubuntu 24.04 imagesMITRE SAF InSpec baseline implementing the DISA Canonical Ubuntu 24.04 LTS STIG
apache-tomcat-9Apache Tomcat 9MITRE SAF InSpec baseline implementing the DISA Apache Tomcat Application Server 9 STIG
nginxNGINX imagesMITRE SAF “STIG-ready” baseline; not an official DISA STIG
chainguardChainguard and Wolfi-based imagesThird-party InSpec profile authored and published by Chainguard, mapped to the DISA GPOS SRG

The Profile column is the directory name that anchorectl stig write-profiles creates for each profile.

Profile Provenance

The profiles Anchore distributes are synchronized from upstream baseline repositories rather than authored from scratch by Anchore. Most are MITRE Security Automation Framework (SAF) InSpec baselines that implement the corresponding published DISA STIG; Anchore maintains forks of these upstream repositories and keeps them in sync. Two profiles have a different origin and are provided to extend coverage:

  • nginx is a MITRE “STIG-ready” baseline. DISA does not publish an NGINX STIG, so this profile is not an authoritative source.
  • chainguard is a third-party InSpec profile authored and published by Chainguard (Apache-2.0, chainguard-dev/chainguard-inspec). It evaluates Chainguard images against the DISA General Purpose Operating System (GPOS) Security Requirements Guide. Anchore redistributes it for convenience.

Write Profiles to Disk

Before these profiles can be used, they need to be written to disk in an accessible location for subsequent AnchoreCTL invocations to reach.

anchorectl stig write-profiles <PATH_TO_WRITE_PROFILES>

This creates one directory per profile. Each directory holds the profile archive and a profile-inputs.yaml file, for example rhel9/rhel9.tar.gz and rhel9/profile-inputs.yaml. A metadata.json file at the top level lists the version of each profile. The examples on this page assume the profiles were written to ./stig-profiles.

For an air-gapped deployment, this command must have connectivity with your Anchore Enterprise deployment. These profiles can be written to disk on a ‘connected’ device and then transferred as needed.

Update Profiles

Anchore publishes updated profiles through the Anchore Data Service, and your Anchore Enterprise deployment receives them with its feed sync. Air-gapped deployments receive them when they next download and import the datasets, as described in Air-Gapped Operation. AnchoreCTL does not refresh profiles that are already on disk. To use an update:

  1. Run anchorectl stig write-profiles <PATH_TO_WRITE_PROFILES> again. To confirm that you have the update, check that generated_at in metadata.json is on or after the date of the release note. Profile versions change only when a profile changes, not when only the profile-inputs.yaml files change.
  2. Rescan your images with the updated profiles. The new evaluation replaces the image’s existing evaluation for the same profile, as described in Managing STIG Evaluations.

Evaluations that you do not regenerate keep the results of the profile version they were generated with. For what changed in each update, see the STIG Profiles release notes.

Set Profile Inputs

Some controls read inputs, for example the Tomcat base directory (catalina_base) or the maximum password age (pass_max_days). Each profile has built-in default values, listed in the inspec.yml file inside the profile archive. The profile-inputs.yaml file next to each archive is an example, not a recommended configuration: some of its values, such as user_accounts: ["ec2-user"], come from test environments, and some differ from the STIG values in the built-in defaults. Compare it with the defaults in inspec.yml before you pass it.

To change some inputs, create a YAML file that sets only those inputs, and pass it with --stig-input-file. Inputs that the file does not set keep their defaults, and a value that you set replaces the whole default, including for list and hash inputs. The flag can be repeated to pass more than one file. Do not edit profile-inputs.yaml in place: running write-profiles again overwrites it.

For example, to require a 60-day maximum password age instead of the profile’s 180 days, save this as my-rhel9-inputs.yaml:

pass_max_days: 60
anchorectl stig docker image execute \
  docker.io/redhat/ubi9:latest@sha256:<digest> \
  --stig-profile ./stig-profiles/rhel9/rhel9.tar.gz \
  --stig-input-file ./my-rhel9-inputs.yaml

Generating STIG Evaluations

There are two methods of generating a STIG evaluation.

  • Image Add Workflow
    • To perform a STIG evaluation as part of the image add command you must pass in the --stig flag as well as --stig-profile with the path to the STIG profile you want to use. Example:
      anchorectl image add docker.io/redhat/ubi8:latest --stig --stig-profile ./stig-profiles/rhel8/rhel8.tar.gz
      
  • Independent STIG evaluation
    • Perform a STIG evaluation on an existing image that is already in the analyzed state. Use the anchorectl stig docker image execute command. You must provide the fully qualified image reference when using the execute command to ensure that the correct image is pulled locally to STIG. Example:
      anchorectl stig docker image execute \
        docker.io/redhat/ubi8:latest@sha256:3e6410626323e6f11af16b28b8e73faa4799fe0dbdb4b1cfbf6f029c34b038f3 \
        --stig-profile ./stig-profiles/rhel8/rhel8.tar.gz
      

Evaluating Shell-less Images

Many minimal and distroless images — including most Chainguard images — ship without a shell, so the usual technique of overriding the entrypoint with a shell command to keep the container alive during evaluation does not work.

AnchoreCTL handles this automatically by distributing a small open-source keep-alive binary (anchore/anchore-keep-alive), which it writes into the target container and uses as the entrypoint so the container stays running for the duration of the evaluation. No extra flags are required for this step.

Some profiles also need common utilities (for example sh, cat, stat) that a shell-less image does not provide. For these images, point AnchoreCTL at a tools image that contains a statically linked busybox; AnchoreCTL extracts busybox and the required symlinks into the target container before running the evaluation.

  • --stig-tools-image — a container image containing a statically linked busybox binary (for example docker.io/library/busybox:latest).
  • --stig-tools-binary-path — path to the busybox binary inside the tools image (default /bin/busybox).

Example:

anchorectl stig docker image execute \
  cgr.dev/chainguard/crane:latest@sha256:<digest> \
  --stig-profile ./stig-profiles/chainguard/chainguard.tar.gz \
  --stig-tools-image docker.io/library/busybox:latest

Managing STIG Evaluations

AnchoreCTL provides commands to manage STIG evaluations that have been uploaded to your Anchore Enterprise deployment. You can list, download, delete and add STIG evaluations for a specific image digest.

An image keeps one evaluation per profile, identified by the name in the STIG PROFILE column of anchorectl stig docker image list (for example redhat-enterprise-linux-9-stig-baseline, not the directory name). anchorectl stig docker image execute (unless you pass --stig-skip-upload) and anchorectl image add --stig upload the new evaluation and replace the image’s existing evaluation for the same profile.

To upload an evaluation file yourself, use the anchorectl stig docker image add command. If the image already has an evaluation for the same profile, pass that evaluation’s UUID with --stig-evaluation-uuid to replace it; without it, the upload fails with a conflict. anchorectl stig docker image list shows the evaluation UUIDs for an image. Example:

anchorectl stig docker image add \
  docker.io/redhat/ubi8:latest@sha256:3e6410626323e6f11af16b28b8e73faa4799fe0dbdb4b1cfbf6f029c34b038f3 \
  ./ubi8-stig-evaluation.json \
  --stig-evaluation-uuid 12345678-1234-1234-1234-123456789012

STIG Waiver Files

AnchoreCTL provides optional support for STIG Waiver files. A waiver file is a formal document granting an exception to a rule, requirement, or disqualification.
When performing STIG evaluations using AnchoreCTL, you can provide one or more STIG waiver files using the --stig-waiver-file option.

An example waiver file (.yaml) for the tomcat stig would be:

SV-222930:
  justification: "Waived"
  run: false

When the stig result is viewed in Heimdall you should see that control marked as waived.

Example YAML file:

SV-260482:
  justification: >
    Vendor-managed Kubernetes does not support user namespace remapping.
  risk_statement: >
    Containers may run with elevated privileges relative to the host.
  compensating_controls:
    - Pod Security Standards enforced
    - Read-only root filesystem
    - No privileged containers
  expiration_date: 2025-06-30
  approved_by:
    name: Jane Smith
    role: Authorizing Official

Example JSON file:

{
  "SV-260482": {
    "justification": "Vendor-managed Kubernetes does not support user namespace remapping.",
    "risk_statement": "Containers may run with elevated privileges relative to the host.",
    "compensating_controls": [
      "Pod Security Standards enforced",
      "Read-only root filesystem",
      "No privileged containers"
    ],
    "expiration_date": "2025-06-30",
    "approved_by": {
      "name": "Jane Smith",
      "role": "Authorizing Official"
    }
  }
}

STIG Compliance

Anchore Enterprise also provides STIG policy gate and triggers to ensure that your images are compliant. For more information on how to use the STIG policy gate, please see the STIG Policy Gate documentation.

STIG Metrics

For monitoring purposes, Anchore Enterprise has included a set of metrics that can be used to monitor STIG evaluations.

  • anchore_stig_image_count - Number of images with STIG evaluations uploaded
  • anchore_stig_count - Total number of STIG evaluations uploaded

For more information on Prometheus metrics, please see the Prometheus documentation.

Last modified November 6, 2026