Lets you run Wazuh Security Configuration Assessment (SCA) policies (CIS YAML) locally,
using the same wazuh-regex engine Wazuh uses in production. Useful for quick local validation,
fast client checks, and iterating on policy files while you write them.
./sca.sh -pdc # run the full policy, per-check output
./sca.sh -soc -pdc -i 18500 # run a single check by ID
./sca.sh -f ./cis_ubuntu22-04.yml # run a different policy file
./sca.sh -h # show help- bash 4.0+
- yq + jq - use the apt packages:
sudo apt update && sudo apt install -y yq jq. The script also handles the snap/mikefarahyq, but apt is recommended (snap install yqemits YAML by default unless given-o=json). - wazuh-regex + its shared libraries - installed by
./install-wazuh-regex.shin the next step.
# 1. Install wazuh-regex + shared libraries (no root required)
./install-wazuh-regex.sh
# optionally pin a specific wazuh-manager version:
WAZUH_MANAGER_VERSION=4.9.1-1 ./install-wazuh-regex.sh
# 2. (Optional) refresh the bundled policies from upstream Wazuh.
# The repo already ships cis_ubuntu26-04.yml, cis_ubuntu24-04.yml and cis_ubuntu22-04.yml.
curl -sSfLo ./cis_ubuntu26-04.yml \
https://raw.githubusercontent.com/wazuh/wazuh/refs/heads/main/ruleset/sca/ubuntu/cis_ubuntu26-04.yml
LD_LIBRARY_PATHdefaults to./wazuh-lib. If you keep a manual copy elsewhere, point the script at it with-wl <PATH>.
Exit code:
0= no compliance failures,1= at least one check failed,2= script/config error. A red CI run therefore means the policy found issues - not that the script crashed.
| Short | Long | Description |
|---|---|---|
-h |
--help |
Show help |
-i |
--id <ID> |
Run only the check with the given ID |
-f |
--file <FILE> |
SCA YAML file (default ./cis_ubuntu24-04-v2024.yml) |
-wr |
--wazuh-regex <PATH> |
Path to wazuh-regex binary (default ./wazuh-regex) |
-wl |
--wazuh-libs <PATH> |
wazuh lib directory (default ./wazuh-lib) |
-soc |
--skip-os-check |
Skip OS requirement validation |
-pdc |
--print-detail-check |
Print per-check result |
-pao |
--print-actual-output |
Print actual command output (requires -pdc) |
-psc |
--print-section-count |
Print the rule count per CIS section |
| Feature | Status |
|---|---|
c: / f: / d: rule types (incl. nested d: → file → content) |
✅ |
p: process checks |
✅ (not exercised by bundled policies) |
r: / !r: regex, n: / !n: numeric with compare >= <= > < == != |
✅ |
not negation, && chains |
✅ |
condition: all / any / one / none |
✅ |
requirements (OS validation) |
✅ |
compliance mapping; per-section reports (-psc) via CIS ref comments |
✅ |
Variables ${var}, Windows registry: |
❌ Not implemented |
Coverage is tracked against the CIS Ubuntu 24.04 LTS benchmark. Per section, the format is (total benchmark rules) (checks implemented in the policy) (-missing).
| Section | Total | Covered | Missing |
|---|---|---|---|
| 1 | 66 | 63 | -3 |
| 2 | 43 | 42 | -1 |
| 3 | 18 | 18 | 0 |
| 4 | 29 | 23 | -6 |
| 5 | 71 | 68 | -3 |
| 6 | 62 | 53 | -9 |
| 7 | 23 | 18 | -5 |
Results are measured on the author's host via ./sca.sh -soc -pdc -psc (-soc skips OS-version validation);
your numbers will differ based on your configuration and hardening state.
- SCA workflow (
.github/workflows/sca.yml): on push/PR tomainit installs wazuh-regex via./install-wazuh-regex.sh, then runs the script against each bundled policy through astrategy.matrix(fail-fast: false). Reports are uploaded as artifacts even on failure (if: always()). - Renovate (
.github/renovate.json): keeps GitHub Actions and pre-commit hooks up to date; grouped and auto-merged. Requires installing the Renovate GitHub App for the repository.
pre-commit install # install hooks (codespell, yamllint, shellcheck, prettier, gitleaks, ...)
pre-commit run --all-files
shellcheck sca.sh # lint the script- Fork and create a feature branch.
- Make your changes.
- Run pre-commit and
shellcheck. - Open a pull request with the
pull_request_detailed.mdtemplate.
- Wazuh SCA documentation
- Wazuh Regex tool documentation
- Wazuh SCA policy repository
- CIS Benchmarks
- Ansible CIS Ubuntu 24.04
- Ansible CIS Ubuntu 22.04
- Wazuh SCA Rulesets
- Wazuh Issues
- Other
MIT - see LICENSE.