A tool for performing static and runtime analysis using STIGs
Project description
Anchore STIG
Anchore STIG is a complete STIG solution that can be used to run STIG profile against static images, running containers in a kubernetes cluster, and virtual machines via ssh.
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 profiles for static, runtime, and vm are as follows:
- 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 pip installedmakesaf- There is an option to install this tool after running the tool, but installing it manually is the most reliable.
Static
docker
Runtime
kubectl execprivileges- Pods running one of the above listed software / OS types
VM
- An SSH profile for the VM or the path to the key used to connect to the machine
- The VM's endpoint
Install
- clone the repo
- run
maketo install
Running the Program
Runtime
-
Run
anchorestig runtimefrom 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 executing
anchorestig runtime --interactivefrom 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, ubi8, 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: anchore-stig runtime -u current -n test -i postgres9 -p postgres9 -c default -o postgres.json
- NOTE: The output file will be saved to the
./outputsdirectory
Viewing Results
Navigate to the ./outputs directory to view the output file.
Static
- Run the tool using
anchorestig static IMAGE.- Ex:
anchorestig static docker.io/ubi8:latest
- Ex:
CLI Input Parameters:
-u, --username TEXT Username for private registry
-p, --password TEXT Password for private registry
-r, --url TEXT URL for private registry
-b, --aws-bucket TEXT S3 upload. Specify bucket name
-a, --account TEXT Anchore STIG UI account. Required for S3 upload
-s, --insecure Allow insecure registries or registries with custom certs
-l, --profile TEXT Specify profile to run. Can be the name of an existing profile or the path to a custom profile
-i, --input-file TEXT Specify the path to a custom input file to run with a profile.
--help Show this message and exit.
Viewing Results
Navigate to the ./stig-results directory. The output directory containing output files will be named according to the image scanned.
VM
- Run the tool using
anchorestig vm -h <vm-endpoint> -u <user> -k <path-to-key> --profile <profile>
CLI Input Paramters:
-u, --user TEXT Username for SSH Host [required]
-p, --password TEXT Password for SSH Host
-k, --key TEXT PEM Key path for SSH Host
-h, --host TEXT Username for SSH Host [required]
-l, --profile TEXT Specify profile to run. Can be the name of an existing profile or the path to a custom profile [required]
-i, --input-file TEXT Specify the path to a custom input file to run with a profile.
--help Show this message and exit.
Help
Use the --help flag to see more information on how to run the program:
anchorestig --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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anchorestig-0.75.1.tar.gz.
File metadata
- Download URL: anchorestig-0.75.1.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7026ee9b4ab63e808e3e65517cb841444e4f3d9a9f21a1bbf577c20c0cc615
|
|
| MD5 |
4cfe04826a53794eda35139ee1433272
|
|
| BLAKE2b-256 |
9f03564ad0b3d5eb7ad828c65c83a004b47a1c4342e60df1757c6b71c4f8b9e2
|
Provenance
The following attestation bundles were made for anchorestig-0.75.1.tar.gz:
Publisher:
release.yml on anchore/stig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anchorestig-0.75.1.tar.gz -
Subject digest:
8d7026ee9b4ab63e808e3e65517cb841444e4f3d9a9f21a1bbf577c20c0cc615 - Sigstore transparency entry: 156736182
- Sigstore integration time:
-
Permalink:
anchore/stig@4f4441ef58cea442b4cba9a95e21ef1c40510ab4 -
Branch / Tag:
refs/tags/v0.75.1 - Owner: https://github.com/anchore
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4f4441ef58cea442b4cba9a95e21ef1c40510ab4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file anchorestig-0.75.1-py3-none-any.whl.
File metadata
- Download URL: anchorestig-0.75.1-py3-none-any.whl
- Upload date:
- Size: 41.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcd680327c04d4276caf8e2516bac8296147c47df6b218c4019cb849cf18fbd6
|
|
| MD5 |
3ff8075b9d8875ea26c39cfe678dd000
|
|
| BLAKE2b-256 |
4717abeb5146aa3a7bc881d92615afa55229b68dcbcc9149f72f8e40651d6e9f
|
Provenance
The following attestation bundles were made for anchorestig-0.75.1-py3-none-any.whl:
Publisher:
release.yml on anchore/stig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anchorestig-0.75.1-py3-none-any.whl -
Subject digest:
dcd680327c04d4276caf8e2516bac8296147c47df6b218c4019cb849cf18fbd6 - Sigstore transparency entry: 156736184
- Sigstore integration time:
-
Permalink:
anchore/stig@4f4441ef58cea442b4cba9a95e21ef1c40510ab4 -
Branch / Tag:
refs/tags/v0.75.1 - Owner: https://github.com/anchore
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4f4441ef58cea442b4cba9a95e21ef1c40510ab4 -
Trigger Event:
push
-
Statement type: