Jenkins
This stage runs witnyx check in a declarative Jenkins pipeline. It downloads the Linux release binary and checks it against SHA256SUMS, keeps the public data in a folder on the agent between builds, and archives the reports with the build.
The pipeline
Section titled “The pipeline”Add the stage to your Jenkinsfile, after the stage that builds your project and writes the software bill of materials (SBOM) to bom.json in the workspace. Your first check shows how to make one. The agent needs Linux with the GNU C library (glibc), curl and sha256sum.
pipeline { agent { label 'linux' } environment { WITNYX_VERSION = '0.1.0' } stages { // Build your project and write its SBOM to bom.json in an earlier stage. stage('Release security check') { steps { sh ''' bin="$WORKSPACE/.witnyx-bin" base="https://github.com/witnyx/witnyx/releases/download/v$WITNYX_VERSION" mkdir -p "$bin" curl -fsSL -o "$bin/witnyx-linux-x64" "$base/witnyx-linux-x64" curl -fsSL -o "$bin/SHA256SUMS" "$base/SHA256SUMS" (cd "$bin" && sha256sum --check --ignore-missing SHA256SUMS) install -m 0755 "$bin/witnyx-linux-x64" "$bin/witnyx" export PATH="$bin:$PATH" witnyx check bom.json --no-agent --cache-dir "$HOME/.cache/witnyx" --output json=witnyx-report.json --output markdown=witnyx-report.md ''' } post { always { archiveArtifacts artifacts: 'witnyx-report.*', allowEmptyArchive: true } } } }}What the stage does
Section titled “What the stage does”- The download. Jenkins runs the
shstep with-e, so the step stops whensha256sumfinds that the binary’s checksum differs from the one inSHA256SUMS. For a stronger check, write the binary’s checksum into theJenkinsfileinstead of downloadingSHA256SUMSfrom the same place. - The check. It fails the stage, and the build, 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 console output, whatever the agent’s environment says about AI coding agents. - The reports.
post { always { ... } }archives the JSON and Markdown reports also when the check failed the build. 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”--cache-dir points to a folder in the home folder of the agent’s user, outside the workspace. Witnyx keeps the public lists it downloads there: 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. The folder survives a cleaned workspace, so every later build on the same agent can use it. Builds that run at the same time can share it: Witnyx replaces a cached file in one step.
Witnyx uses a cached copy that is less than 24 hours old, and downloads an older one again. 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. An agent that starts empty for every build, such as a container, downloads the lists on every build.
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.