Skip to content

Add a STIG profile to your compliance scans

What you'll learn:

  • What a compliance profile is, and how the DISA STIG profile differs from the built-in CIS one
  • How to list the profiles and read the controls of the STIG profile
  • How a profile reaches a machine: applicability, assignment, and what replaces what
  • What a STIG scan can and cannot tell you today

Time: ~15 minutes
Prerequisites: A machine in SSH mode, scanned at least once (see Add your first client machine), and an administrator account. You have read Check a machine against the CIS benchmark.


Know the limits first

Be clear about what the STIG profile is today, so you do not rely on it for more than it gives:

  • There is no screen for it. The machine's Conformité CIS tab shows the CIS result only. Profiles are managed with the API.
  • None of the 402 controls has a check yet. The profile carries the official identifiers, severities and titles, but no script that verifies a machine. A scan reports every control as not_implemented. Repod does not invent checks: they are written and validated by a person, then added (see Compliance scanning).
  • It targets Red Hat Enterprise Linux 9. It is not applied to Ubuntu, nor to AlmaLinux or Rocky.

So the STIG profile gives you the catalogue of controls today and the plumbing to assign and scan. It does not yet give you a compliance score.


Step 1 — List the profiles

The API calls below need a token (see Manage users, roles and groups, Step 6), and the compliance_profiles feature must be part of your licence. Replace the address and $TOKEN with yours.

curl -s https://repod.example.com/api/v1/compliance/profiles \
  -H "Authorization: Bearer $TOKEN"

Two profiles come with Repod:

Profile Framework Applies to Controls With a check
cis-builtin-linux cis every machine 40 40
stig-rhel9-disa stig RHEL 9 (os_match: rhel9) 402 0

is_builtin is true for CIS only. The STIG profile is loaded from backend/data/compliance/stig_rhel9_disa.json, built from the official DISA identifiers published in Red Hat's Ansible role for the STIG.


Step 2 — Read the controls

curl -s https://repod.example.com/api/v1/compliance/profiles/stig-rhel9-disa/controls \
  -H "Authorization: Bearer $TOKEN"

Each control looks like this:

{
  "check_id": "RHEL-09-171011",
  "category": "DISA STIG RHEL 9",
  "severity": "medium",
  "title": "Set the GNOME3 Login Warning Banner Text",
  "official_reference": "CCE-86529-5",
  "implemented": false,
  "remediation": ""
}

The 402 controls split into 25 high, 352 medium, 21 low and 4 unknown. implemented: false is what makes a scan report the control as not_implemented.

The titles are not the official wording

The title comes from the name of the remediation task in the Ansible role, not from the DISA wording. The identifier (RHEL-09-171011) is the official one. For the exact text of a rule, read the STIG published by DISA before you decide anything.


Step 3 — Understand applicability

A profile runs on a machine only if its os_match matches the machine's detected distribution. Repod compares them ignoring punctuation: rhel9 matches a machine detected as rhel:9.

You can ask for a scan of a given profile on a given machine without assigning anything. On the Ubuntu machine of this series:

curl -s -X POST https://repod.example.com/api/v1/inventory/clients/$CLIENT_ID/compliance/scan \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"profile_ids": ["stig-rhel9-disa"]}'

The scan answers 202 and runs in the background. The profile is skipped, and no connection to the machine is even opened: an Ubuntu machine is not a RHEL 9 machine, so a STIG result would be meaningless. The only trace is in the backend log (docker compose logs backend): "0 contrôle(s) sur 0 profil(s) exécuté(s), 1 non applicable(s)".

On a RHEL 9 machine, the profile runs and returns the 402 controls as not_implemented, each with the line "Script de vérification pas encore écrit/validé pour ce contrôle." This is the expected result today, not a failure.

AlmaLinux and Rocky are not RHEL

The AlmaLinux machine of this series (almalinux:9) does not match rhel9, so the RHEL 9 STIG does not apply to it. Widening that is a deliberate decision, not an accident to work around.


Step 4 — Assign the profile

To have the daily scan use a profile, assign it to a machine tag or to one machine (administrator):

curl -s -X POST https://repod.example.com/api/v1/compliance/profiles/stig-rhel9-disa/assignments \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"principal_type": "tag", "principal_id": "rhel9-prod"}'

Use "principal_type": "client" with a machine id to target one machine. Two rules decide what runs:

  • A machine assignment replaces its tag assignments. They are never combined.
  • Assigning a profile replaces the default CIS. A machine with no assignment is scanned with CIS. As soon as you assign STIG to it, only STIG runs, and the machine stops getting CIS scans.

Assign CIS as well

To keep both, assign cis-builtin-linux to the same tag or machine, with the same call. Otherwise the CIS tab of that machine stops being refreshed, and its score slowly becomes outdated.

List what is assigned with GET /compliance/profiles/stig-rhel9-disa/assignments, and remove an assignment with DELETE /compliance/profiles/assignments/{id}.


Step 5 — Read the multi-profile result

curl -s https://repod.example.com/api/v1/inventory/clients/$CLIENT_ID/compliance/profiles \
  -H "Authorization: Bearer $TOKEN"

For every profile that has been run on the machine, you get its controls, its score and its scan date. GET .../compliance (without /profiles) keeps returning the CIS result alone, as the CIS tab uses it.


What's next