Reference
Gates and pull requests
Choose when a CI job fails: on the severity of a finding, on a known-exploited or malicious package, or only on the findings that a pull request adds; and read the exit codes of the CLI.
Choose the gate #
| Command | The job fails when | Use it on |
|---|---|---|
tuxcarectl sca | Never. It only reports. | Any branch, to keep the portal current. |
tuxcarectl sca --fail-on high | An open finding is high or critical. The other levels are critical, medium, and low. | The default branch and the release branches. |
tuxcarectl sca --fail-on-exploited | An open finding is known exploited, at any severity. It combines with --fail-on: either gate fails the job. CLI 0.1.80 or later. | The default branch and the release branches. |
tuxcarectl compare --base main --fail-on-new | The branch has an open finding that the latest scan of main does not have. | Pull requests and merge requests. See Pull and merge requests. |
tuxcarectl check | A project that uses TuxCare builds is not in the state that harden made. | Projects that use TuxCare builds. See Fix vulnerabilities. |
- Skip what your team ignored.
--baseline-portalmakesscaskip the findings that your team ignored in the portal. To turn it on for every run, setbaseline.portal: truein.tuxcare.yaml. - The gate on known-exploited findings. A finding is known exploited when the portal has a claim for it from CISA KEV, CVE ADP, or EUVD. A finding that your team ignored in the portal under
--baseline-portal, a finding that a TuxCare build fixes, a finding with no fix planned or a live-patched finding (a CLI release after 0.1.84), and a dev finding under--ignore-devdo not fail this gate. When no finding that can fail the gate is known exploited and the run did not read a part of the project,sca --fail-on-exploitedalone fails the job, as--fail-ondoes (CLI 0.1.86 or later): exit code 5 with the fix of each part, or exit code 2 when the part is a gap of tuxcarectl (see A part of the project that the run did not read). CLI 0.1.82 to 0.1.85 printed a warning and exited with code 0.comparehas no--fail-on-exploited: the summary of the portal does not count the new known-exploited findings. Runsca --fail-on-exploitedbesidecompare --fail-on-new.image submithas no--fail-on-exploitedeither: its gates are--fail-onand the malicious gate. To turn the gate on for every run, setfail_on_exploited: truein.tuxcare.yaml. - The gate on malicious packages. With CLI 0.1.94 or later, an open finding of a malicious package fails
scawith exit code 1, with or without--fail-on, at any severity.--ignore-devdoes not leave it out, and a suppression rule of the portal does not excuse it. With CLI 0.1.100 or later, a failed pull of the portal baseline underbaseline.on_fetch_error: closeddoes not hide it either. When the run read all the findings, it then judges only the malicious gate: it exits with code 1 for an open malicious finding. With no such finding, the failed pull gives the exit code, as before: for example 4 for a portal that did not answer, or 3 for a refused token.--fail-onand--fail-on-exploiteddo not judge their findings without the baseline. After a signal, the end of--timeout,--fix, a toolchain that did not resolve, or a read of the findings that ended short, the malicious finding does not decide the exit code. Starting with the release that adds the malicious package gate to image scans,image submitalso exits with code 1 on an open malicious package finding in the image at any severity, with or without--fail-on. Earlier releases ofimage submitgate findings only when you set--fail-on. Only the ignore of an admin of the workspace in the portal excuses it: see Allow a version. An older CLI gates a malicious finding only by its severity. - A part of the project that the run did not read. From CLI 0.1.86,
sca --fail-onfails the job when no finding reached the level and the run could not read a part of the project. The job exits with code 5 when you can fix the part: the message names each part and its fix, for example a lockfile that does not parse. It exits with code 2 when the part is a gap of tuxcarectl, for example a file that tuxcarectl does not support: report it to TuxCare. A finding at the level still gives exit code 1. From CLI 0.1.97, such a part also comes before a portal that did not answer: under--on-portal-error failthe run then exits 5 or 2 for the part, not 4. To keep exit code 0 until 2027-12-01, give--accept-unread all, or setaccept_unread: allin.tuxcare.yaml. Each run that uses it prints a deprecation warning. Fix each part that the report names before that date. Plainscawith no gate does not change: it exits with code 0. - A part of a container image that the run did not read.
tuxcarectl image submit --fail-onfollows the same rule assca --fail-on. A package reader that did not read a part of the image, for example an rpm database that does not parse, is a refusal withnot_read. CLI 0.1.93 introduced the warning, which its replacement 0.1.94 also prints. Releases that only warn about unread parts exit with code 0 when no finding fails a gate. With CLI 0.1.96 or later,--fail-onstops the build there, for example--fail-on high: no finding reached the bar, but tuxcarectl did not read 1 part(s) of this image, so this build does not pass
: it exits with code 5 and names the repair when the reader diagnoses a damaged file, else it exits with code 2 and directs you to TuxCare support. A finding at the level still gives exit code 1. From CLI 0.1.97, an unread part takes precedence over a portal that did not answer under--on-portal-error fail.--accept-unread allskips the unread-part exit until 2027-12-01 and emits one deprecation warning per run;image submitreads noaccept_unreadkey. Fix the image, or report the reader to TuxCare. Plainimage submitwith no--fail-onreports unread parts. Starting with the release that adds the malicious package gate to image scans, an open malicious finding still fails the job with exit code 1. - A portal that does not answer. The job then exits with code 4.
--on-portal-error warnmakes it go on with a warning. Use it when a build must never wait for the portal. From CLI 0.1.97, under the default--on-portal-error fail, an outage of the portal at the upload, at the release call, or at the read of the findings does not hide a part of the project or the image that the run did not read:sca --fail-on(alsosca --fail-on-exploited) andimage submit --fail-onthen exit with code 1 for a finding at a gate, else with code 5 (the message names the fix) or 2 (a gap of tuxcarectl), not with code 4. When the run read the whole project or image, an outage of the upload or of the read of the findings gives exit code 4, also beside a finding. With CLI 0.1.100 or later, after a complete read of the findings, a finding at a gate also wins over a failure of the release call — an outage, or a refusal named or unnamed: the job exits with code 1, and the output says that the release is not recorded and why. After a signal, at the end of the--timeoutlimit, with--fix, or beside a toolchain that did not resolve, the finding does not win over the release failure. When an outage at the upload, at the release call, or at the read of the findings gives way to a part not read, a toolchain that did not resolve takes precedence with exit code 5, before a finding or the unread-part exit. A refusal of the release call never gives way to a part not read: with no finding at a gate it keeps its own exit code under each policy. An unnamed refusal of the upload or of the read of the findings (a4xxthat the contract does not name, or a document over a cap) and a signal keep exit code 4 under each policy. Underfail, the end of the--timeoutlimit and--fixkeep exit code 4 for an outage at the upload, at the release call, or at the read of the findings. - A CVE that TuxCare has not evaluated. The portal marks a CVE as not evaluated when TuxCare has not assessed it on the installed TuxCare build (see The vulnerabilities of a host). With CLI 0.1.99 or later, such a CVE fails no gate:
sca,sbom --vulns, andimage submit --fail-onkeep their exit code.scaandimage submitprint one warning with the count of these CVEs and of their packages, and--output jsonlists each package and CVE invulnerabilities.source.not_evaluated_findings. The markdown format prints no warning: with--output markdown, the vulnerabilities section opens with aNot evaluated
paragraph.sca --output sarifcarries each one as a notification (securechain-not-evaluated), never as an alert of code scanning;image submithas no SARIF output.sbom --vulnswrites the warning into the SBOM document. A run whose only CVEs are not evaluated is not reported clean.
Pull and merge requests #
A pull request often inherits old findings from the base branch. compare --fail-on-new fails it only on the findings that it adds. The base branch needs a scan of its own, so scan the base branch on each push too. A finding that is Not evaluated on the base branch (TuxCare has not assessed the build, see Servers) and open on your branch counts as new, so compare --fail-on-new fails on it.
A Gradle or Maven project runs its build. Each command that reads a Gradle or Maven project runs the build of the project, registry check too: its build scripts and ./gradlew, or the files and extensions of .mvn/ of Maven. This holds with and without --run-project-hooks, and no option turns it off. So a scan of a merge request from a fork, or of other code that you do not trust yet, runs that code. Run such a scan in a sandbox job that holds no secret that the code must not read.
The jobs for each CI system: GitHub Actions, GitLab CI, and Jenkins.
The portal files the scan of a pull request under the branch that it comes from. The portal sends alerts for the default branch and the supported releases only, so a feature branch sends none.
Exit codes in CI #
| Code | Meaning | What to do |
|---|---|---|
| 0 | The run finished. No finding failed the gate. | Nothing. |
| 1 | A finding failed the gate. | Read the findings in the job log or in the portal. |
| 2 | A wrong option, a configuration file that the CLI cannot read, no package manager that it knows, or an --ecosystem or ecosystems name that it does not know (from version 0.1.71; the message lists the names). | Read the message. |
| 3 | No token, or the portal refused it. | Check the secret variable. See Troubleshooting. |
| 4 | The portal did not answer in time, or its answer failed a check. | Run the job again, or use --on-portal-error warn. |
| 5 | A tool on your side failed: the install command of your package manager, a project environment that the CLI cannot find, or a file that the CLI cannot write. Starting with the release that adds shared configuration locking, a wait for the lock also exits 5 if it reaches the timeout or the command cancels the wait after a signal. The two names of the portal URL (TUXCARE_PORTAL_URL and SECURECHAIN_PORTAL_URL) for two portals while a token is set stop with this code and send nothing; a refused global flag still exits 2 first. | Read the job log. If the CLI was waiting for the lock, the error names the --timeout limit or the signal that ended the wait. |
| 6 | harden, update, unharden, or fix changed the project, but the installed packages are not the planned ones. The CLI put your files back. | Read the message. Contact TuxCare if the error stays. |
| 7 | An error in the CLI. The CLI prints internal error: what the run was doing: error; please report this to TuxCare supportand writes no report file. | Run tuxcarectl doctor --bundle file, and send the archive to TuxCare. |
The install script never exits 1 (from version 0.1.71). It exits 5 when you must fix something on your side: the operating system or the CPU type, a directory that it cannot write, no answer from the server, or a download that failed. It exits 7 when the TuxCare release is wrong: no version, no checksum line, a checksum that does not match, a missing or invalid TuxCare signature of checksums.txt, or a downloaded binary that reports another version than the one that the script installs (install scripts since CLI 0.1.99). So exit_codes: [1] below lets only findings through, and a failed install fails the job. An older install script exits 1 when it fails: pin version 0.1.71 or later, or end the install line with || exit 5.
To let a job report findings and not stop the pipeline, allow exit code 1 only. In GitLab, write allow_failure: exit_codes: [1]. Do not write allow_failure: true: it also hides the codes 2 to 7, where the CLI could not do its job, and the pipeline then shows green for a scan that did not run.
The install command of your project also exits 1 when it fails, for example npm ci or pip install. With exit_codes: [1], the job then shows amber for a scan that did not run. End each install line with || exit 5, as in the example below. The CI/CD component does this for its install input from the CLI release after version 0.1.72: it prints the code of the install and exits 5.
GitLab Runner 19.0 and earlier can report exit code 1 in place of the real code, so exit_codes: [1] also lets a code from 2 to 7 pass. Set the variable FF_USE_NEW_BASH_EVAL_STRATEGY: "true" in the job: the runner then reports the real code. Runner 19.1 and later always reports the real code and ignores the variable.
tuxcarectl:
image: node:22
variables:
FF_USE_NEW_BASH_EVAL_STRATEGY: "true" # GitLab Runner 19.0 and earlier
allow_failure:
exit_codes: [1]
script:
- npm ci || exit 5 # the install step of your project
- curl -fsSL https://securechain.tuxcare.com/get/tuxcarectl | sh
- tuxcarectl sca --fail-on high
Exit codes lists every code.
Next: Releases