GitLab CI
This job runs witnyx check in GitLab CI. It downloads the Linux release binary and checks it against SHA256SUMS, keeps the public data in GitLab’s cache between pipelines, and keeps the reports as job artifacts.
The job
Section titled “The job”Add it to .gitlab-ci.yml. It expects the software bill of materials (SBOM) in bom.json in the project folder: make it in this job before the check, or in an earlier job that passes it on as an artifact. Your first check shows how to make one.
release-security-check: stage: test image: ubuntu:24.04 variables: WITNYX_VERSION: "0.1.0" cache: key: witnyx-data paths: - .witnyx-cache/ when: always before_script: - apt-get update - apt-get install --yes --no-install-recommends ca-certificates curl - mkdir -p /tmp/witnyx - curl -fsSL -o /tmp/witnyx/witnyx-linux-x64 "https://github.com/witnyx/witnyx/releases/download/v${WITNYX_VERSION}/witnyx-linux-x64" - curl -fsSL -o /tmp/witnyx/SHA256SUMS "https://github.com/witnyx/witnyx/releases/download/v${WITNYX_VERSION}/SHA256SUMS" - (cd /tmp/witnyx && sha256sum --check --ignore-missing SHA256SUMS) - install -m 0755 /tmp/witnyx/witnyx-linux-x64 /usr/local/bin/witnyx script: - | witnyx check bom.json --no-agent --cache-dir .witnyx-cache --output json=witnyx-report.json --output markdown=witnyx-report.md artifacts: when: always paths: - witnyx-report.json - witnyx-report.md expire_in: 90 daysWhat the job does
Section titled “What the job does”- The image. The Linux binaries need the GNU C library (glibc), so the job runs on Ubuntu, not on an Alpine image.
ubuntu:24.04has nocurl, sobefore_scriptinstalls it. - The download.
sha256sumstops the job when the binary’s checksum differs from the one inSHA256SUMS. For a stronger check, write the binary’s checksum into.gitlab-ci.ymlinstead of downloadingSHA256SUMSfrom the same place. - The check. It fails the job with exit code 1 when a
--fail-onrule triggers, and with exit code 2 when the check cannot run.--no-agentkeeps the text report in the job log, whatever the job’s variables say about AI coding agents. - The reports.
artifacts:when: alwayskeeps the JSON and Markdown reports also when the check failed the job. The JSON report is the record of the run:checkedAtsays when the check ran, and each actively exploited finding repeats it asawareAt.
The data cache
Section titled “The data cache”GitLab can cache only folders inside the project folder, so --cache-dir points to .witnyx-cache there. Witnyx keeps the public lists it downloads in that folder: CISA’s Known Exploited Vulnerabilities catalogue, ENISA’s list of exploited vulnerabilities (the source of EUVD IDs) and the end-of-life data of endoflife.date.
Witnyx uses a cached copy that is less than 24 hours old, and downloads an older one again. It reads the age from each file’s modification time, which GitLab’s cache keeps. When a download fails, it uses a cached copy up to 7 days old, and the report says so. OSV is asked on every run. cache:when: always saves the folder also when the check failed the job.
How a check works describes each source.
Next steps
Section titled “Next steps”- Choose when the build fails with
--fail-onand--strict. - Report formats describes the JSON and Markdown reports.
- To run the Docker image instead of the binary, see Docker.
Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.