Skip to main content

Anchore Runtime STIG

Anchore STIG is a complete STIG solution that can be used to run STIG profile against running containers in a cluster.

Description

Use Anchore STIG to perform STIG checks against running containers in Kubernetes environments or static Docker images from a registry or stored locally. The tool executes automated scans against specific STIG Security Guide (SSG) policies. The program will output either a JSON report with a summary of STIG check results for runtime checks or XCCDF XML and OpenSCAP XML and HTML for static checks.

The runtime functionality includes the following profiles:

  • Ubuntu 20.04 (ubuntu-20.04)
  • Ubuntu 22.04 (ubuntu-22.04)
  • Universal Base Image 8 (ubi8) - This runs the full RHEL 8 STIG
  • Universal Base Image 9 (ubi9) - This runs the full RHEL 9 STIG
  • Postgres 9 (postgres9)
  • Apache Tommcat 9 (apache-tomcat9)
  • Crunchy PostgreSQL (crunchy-postgresql)
  • JBOSS (jboss)
  • Java Runtime Environment 7 (jre7)
  • MongoDB Enterprise (mongodb)
  • nginx (nginx)

Getting Started

Dependencies

Overall

  • python3 >= 3.8 with pip3 installed
  • make

Runtime

  • kubectl exec privileges
  • Pods running one of the above listed software / OS types

Install

  • clone the repo
  • run make to install

Running the Program

Runtime

  • Run anchorestig runtime from the terminal.

    • NOTE: This edition of the demo has been optimized for single-container pods by default
  • The program will run in interactive mode by just executing anchorestig runtime --interactive from the terminal, however, you may also use the following CLI input parameters:

CLI Input Parameters:

  -i, --image TEXT       Specify profile to use. Available options are
                         ubuntu-20.04, ubuntu-22.04, ubi8, ubi9, postgres9,
                         apache-tomcat9, crunchy-postgresql, jboss, jre7,
                         mongodb, nginx
  -p, --pod TEXT         Any running pod running an image that runs one of the
                         specififed profile's software
  -c, --container TEXT   Container in the pod to run against
  -o, --outfile TEXT     Output file name. Only JSON output filetype is
                         supported (include the '.json' extension with the
                         output file name in CLI)
  -n, --namespace TEXT   Namespace the pod is located in
  -u, --usecontext TEXT  Specify the kubernetes context to use
  -b, --aws-bucket TEXT  Specify the S3 bucket to upload results to. Omit to
                         skip upload
  -a, --account TEXT     Specify the Anchore STIG UI account to associate the
                         S3 upload with. Omit to skip upload
  -t, --interactive      Run in interactive mode
  -s, --sync             Sync policies from Anchore
  --help                 Show this message and exit.

Ex: anchorestig-runtime runtime -u current -n test -i postgres9 -p postgres9 -c default -o postgres.json

  • NOTE: The output file will be saved to the ./outputs directory
Viewing Results

Navigate to the ./outputs directory to view the output file.

Help

Use the --help flag to see more information on how to run the program:

anchorestig-runtime runtime --help

CINC Functionality Explanation

cinc-auditor allows users to specify a target to run profiles against. This can be a number of things including SSH targets or a local system. The train-k8s-container plugin allows our STIG tool to target a kubernetes namespace, pod, and container to run cinc profiles against. When a container is set as the target, each individual control will be prepended with kubectl exec ..... and the appropriate commands to run within the container and retireve the results to make the determination of a pass or fail against the control baseline.

Modifying Controls

The policies directory contains sub-directories for the Ubuntu, UBI, and Postgres STIG profiles. Each directory has a tar.gz file that can be decompressed. From there, each control that runs is defined as a ruby gem file in the controls directory. The ID of each control (displayed in Heimdall) is pulled from the control section at the beginning of the ruby gem file. To change what is displayed, change the control id at the beginning of the file.

Adding Not-Applicable Controls

The UBI 8 and Ubuntu 20.04 policies were built with the not-applicable rules removed. To add them back, untar the tar files in each repository, move the ruby gem files from the not-applicable/ directory to the controls directory. Then run cinc-auditor archive . in the untarred directory. This will generate a new tar archive file. Replace the original archive, that you un-tarred at the beginning with the newly generated one and the newly included rules will run.

Authors

Release files for anchorestig-runtime 0.75.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anchorestig-runtime 0.75.1
File Size Uploaded
anchorestig_runtime-0.75.1.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anchorestig-runtime 0.75.1
File Interpreter ABI Platform
anchorestig_runtime-0.75.1-py3-none-any.whl Python 3 none any Details

Total release size: 64.3 kB

Release files / anchorestig_runtime-0.75.1.tar.gz

Download URL anchorestig_runtime-0.75.1.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1fb1f882ed64093e428cbeab01fba88884b41d062d3b5a4eca4567d8f5b77673
BLAKE2b-256 checksum
How to use checksums
01e1dbb4d166bbe3a8fea276bb028029ede58fdc26f5defe2d186fc3e028cb7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2024.

Transparency log

Release files / anchorestig_runtime-0.75.1-py3-none-any.whl

Download URL anchorestig_runtime-0.75.1-py3-none-any.whl
Size 37.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb0e48afdd5050275034931cf020d93099e2290c5ff3464b918d0112af8a102a
BLAKE2b-256 checksum
How to use checksums
f8943bb101626553c7d40acafe6f04bb6bee3ba8ea218e383bf80a4795473836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.75.1 This release

2 release files

0.75.0

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page