How-to guide
Malicious packages
A malicious package runs the code of an attacker on the computer that installs it. tuxcarectl guard keeps a known malicious version out of the install, on your computer and in CI. tuxcarectl guard check stops a job before the install when a lockfile holds one. After the install, the portal reports each malicious package that a scan holds.
The guard needs CLI 0.1.94 or later. tuxcarectl upgrade moves the CLI to the newest release (see Upgrade the CLI).
What a malicious package is #
An attacker publishes a package with a name that is close to a real name (a typosquat), or a name of your own private packages. Or the attacker takes over the account of a maintainer and publishes a new version of a real package: in 2025 this happened to chalk 5.6.1, debug 4.4.2, and nx 21.5.0. Most such packages run their code when the package manager installs them, in an install script. The code reads the tokens and the keys of the computer and sends them to the attacker. A warning after the install comes too late, so the main defense is a block before the package manager downloads the package.
The source. The OpenSSF malicious packages project publishes a record for each malicious package. The id of such a record starts with MAL-, for example MAL-2025-46969. TuxCare brings the records to your workspace with the other advisories. TuxCare does not judge a package itself: the record does. The portal decides which versions are malicious, and the CLI only reads the answer:
- A record of a package that is malicious as a whole (a typosquat) names every version, also a version that is published later.
- A record of a hijacked package names the bad versions only. The other versions stay available.
- A record never names a TuxCare build of the TuxCare catalogue. The version text alone proves nothing: an attacker can publish
chalk@5.6.2-tuxcare.1on the public registry. Only a build that the catalogue holds counts as a TuxCare build. - When OpenSSF withdraws a record, the block ends, and the finding closes with no alert.
The three checks #
- The lockfile check before the install.
tuxcarectl guard checkreads the lockfiles of the project and stops when a locked version is malicious.tuxcarectl checkruns the same check first. - The filter of the install.
tuxcarectl guard npm install, and the other tools, run the package manager through the guard. The package manager does not get a malicious version. With the aliases, a plainnpm installgoes through the guard too. - The report after the install. The portal matches each scan on the server. A new record also finds the package in the scans that the portal received before the record existed. The finding is marked Malicious, it gives the repository the grade F, and it sends an alert at once.
tuxcarectl scafails with exit code 1 on an open malicious finding, with or without--fail-on, at any severity, and also under--ignore-dev. With CLI 0.1.100 or later, a failed pull of the portal baseline underbaseline.on_fetch_error: closeddoes not hide it: when the run read all the findings, it exits with code 1 (see the gate on malicious packages). Starting with the release that adds the malicious package gate to image scans,image submitalso exits with code 1 on an open malicious finding in the image, with or without--fail-onand at any severity.
tuxcarectl guard check #
tuxcarectl guard check reads the lockfiles of the project, sends each locked version to your workspace, and exits with code 1 when a version is malicious and no admin allowed it. It runs no package manager and uploads nothing. Run it in CI before the install, for example before npm ci.
tuxcarectl guard check [dir] [--on-portal-error fail|warn]
It reads each lockfile that tuxcarectl sca reads: npm, pnpm, Yarn, Bun, pip, uv, Poetry, PDM, Pipenv, Cargo, Bundler, NuGet, Gradle, Go, and the others. So it also protects a CI job of an ecosystem that the filter of the install does not cover yet. It reads no manifest: a range of a manifest names no version that the tool installs. A locked version that is a URL, a path, or a git repository is not sent, because it can hold a token: the check prints a warning not checked
for it. The output has one line for each blocked and each allowed version, then the result:
malicious chalk@5.6.1 (npm; package-lock.json): MAL-2025-46969 Malicious code in chalk https://osv.dev/vulnerability/MAL-2025-46969
verdict: fail (1 blocked, 0 allowed, 211 clean)
The lockfiles that the tool reads. A package manager can read a lockfile outside the directory, or a lockfile with another name. The check reads that file too, as the tool of the next step of the job reads it. It takes the variables of its own process:
- A member of an npm, pnpm, Yarn, or Bun workspace has no lockfile of its own: the tool installs the member from the lockfile of the workspace root. The check reads the lockfile of the workspace root.
- A member directory of a uv workspace has no
uv.lock: uv reads theuv.lockof the workspace root. The check reads it.UV_WORKING_DIRandUV_PROJECTmove the project, as for uv. - In a folder with no
pyproject.toml, the check reads thepoetry.lockof the project above, which Poetry reads. - A Gemfile of
BUNDLE_GEMFILE: the check reads its lockfile, for exampleGemfile.ci.lockforGemfile.ci, or theGemfile.lockbeside a Gemfile in another directory. A refusal of such a lockfile names it under its own name on each line, for examplenot checked: Gemfile.ci.lock: Gemfile.ci.lock line 3 holds a merge-conflict marker
; no line asks you to commit aGemfile.lock.guard bundlenames it the same way. - A
-modfileofGOFLAGS: the check reads that file in place ofgo.mod. PNPM_CONFIG_DIR(orpnpm_config_dir) names the project of pnpm: the check reads the lockfiles of that project, as pnpm does.- In a member of a Cargo workspace (a folder with a
Cargo.toml), cargo reads theCargo.lockof the workspace root. The check reads it. - In a module of a
go.work(a folder with ago.mod), go uses each module of thego.work. The check reads thego.modof each other module of thego.work.
In a folder with no package.json, guard check and check read no JavaScript lockfile of the project above: they run no tool, and a Go project below a folder with a package-lock.json is not a part of it. In the same way, above a folder with no Cargo.toml or go.mod, they read no Cargo.lock and no go.mod. A line of a lockfile outside the directory names the file by its full path, for example malicious chalk@5.6.1 (npm; /work/repo/package-lock.json). A lockfile that does not exist yet adds nothing.
A lockfile that the check could not read (a damaged file, a file it could not open, or a part of the project that the read refused) is no pass: the verdict is not checked
with the count of the parts it did not read, and with no blocked version the command stops with exit code 5 and the error names each file and its fix, or with exit code 2 when no part has a fix (a gap of the CLI itself). This holds also when the portal did not answer under --on-portal-error fail: a pipeline that lets exit code 4 pass must not pass a lockfile that no check read. And warn lowers the outage alone, not such a part: the verdict line counts it (verdict: not checked (the portal did not answer; 1 not read)), and the exit is 5, or 2, under warn too. A refusal of the portal (a refused token, a 4xx) keeps its own exit code, and a signal that ends the wait is exit code 4 under each policy. The --timeout limit that ends the wait counts as a portal that did not answer: warn lowers it, and such a part still gives exit code 5, or 2. The other refusals of the read stay warnings, and the check goes on: a manifest with no lockfile, a package at a commit, a URL, or a path, and a local replace of a go.mod.
The check counts a part that it did not read with the rule of tuxcarectl sca. So a file that the CLI declines with a step (for example requirements/base.txt or Gopkg.lock), and a file that the CLI does not read (for example rebar.lock, conda-lock.yml, or build.sbt), is a part that the check did not read, as for sca --fail-on. This change comes in two releases. In the first, such a part keeps exit code 0. When the check read no locked version, the verdict is not checked
with the count of the parts, for example not checked (1 part not read)
, not no locked version
. A warning says that the next release stops guard check there with the exit code that sca --fail-on gives for the same part: 5 for a file with a step, 2 for a file that the CLI does not read. The lockfile check of guard <tool> gives the same warning, and the tool starts. In the release after it, such a part gets the exit codes of a part that the check did not read (5, or 2 for a gap of the CLI), and guard <tool> does not start the tool.
| Code | When |
|---|---|
| 0 | No locked version is blocked and the check read each lockfile, the project has no lockfile, or the portal did not answer under --on-portal-error warn. |
| 1 | A locked version is malicious and no admin allowed it, or the portal cannot judge a locked version — also when another verdict request of the check failed. Remove the version from the lockfile, or ask an admin of the workspace to allow it. A malicious version wins with exit code 1 over each other stop of the check. |
| 2 | A wrong option, a directory that the check cannot read, or a part of the project that the check did not read and that has no fix (a gap of the CLI itself). |
| 3 | No token, or the portal refused the token. |
| 4 | The portal did not answer under --on-portal-error fail (see When the portal does not answer), or the portal is older than the check. When the --timeout limit of the command (20 minutes by default) ends the wait for the verdicts, the portal did not answer, so warn lowers it. A signal (for example Ctrl-C) that ends the wait is exit code 4, also under warn. |
| 5 | A lockfile that the check did not read (a damaged, unreadable, or unopenable lockfile, a link to a file outside the project, or a count of packages that does not match the file), and no blocked version: the error names the file and its fix, for example yarn.lock: repair the file, or write it again with its tool, and the verdict is not checked with the count, for example verdict: not checked (1 part not read). A blocked version still gives exit code 1. warn lowers an outage of the portal, not such a part, the verdict line then counts it under warn (verdict: not checked (the portal did not answer; 1 not read)) and the run exits 5 or 2; under fail such a part wins over a portal that did not answer too, with the same verdict line and exit 5 or 2. A pipeline that lets exit code 4 pass must not pass a lockfile that no check read. A refusal of the portal (a 4xx, a refused token) and a stop of a signal or of the --timeout limit keep their exit. |
| 7 | An error in the CLI. |
tuxcarectl guard <tool> #
Put tuxcarectl guard in front of a command of the package manager:
tuxcarectl guard npm install
tuxcarectl guard pnpm add left-pad
tuxcarectl guard uv sync --frozen
tuxcarectl guard dotnet restore
tuxcarectl guard mvn package
tuxcarectl guard ./gradlew build
tuxcarectl guard go build ./...
tuxcarectl guard cargo build
The tools are npm, npx, pnpm, yarn (Yarn 1 and Yarn 2 or later), bun, and bunx; pip, uv, uvx, and poetry; gem, bundle, and bundler; dotnet; mvn and gradle, and the wrappers of a project, ./gradlew and ./mvnw; go; and cargo. The guard covers each command of the tool (install, ci, add, update, exec, dlx, sync, lock, restore, build; get, mod, build, test, and run of go; fetch, build, update, add, and install of cargo), because each one can download a package. The options of tuxcarectl go before the tool. Each word after the tool belongs to the tool.
nuget(nuget.exe) is refused with exit code 2: it trusts only the certificate store of mono or of Windows, and the guard never adds its certificate authority to a trust store. Run the restore withtuxcarectl guard dotnet restore, and check the lockfile withtuxcarectl guard check.tuxcarectl guard ./gradlewandtuxcarectl guard ./mvnwrun the wrapper of the project through the guard, with the checks and the files ofguard gradleandguard mvn. The word can also be another path that ends ingradlewormvnw, or the bare namegradlewormvnw, which is the wrapper in--dir.tuxcarectl guard mvnandtuxcarectl guard gradlerun the tool of thePATH, not the version that the wrapper pins. Formvnwthe guard runs maven-wrapper 3.3.0 to 3.3.4 of the typeonly-script; before the first run of such a wrapper, the guard runs./mvnw --versionto install its Maven. These wrappers stop with exit code 5: a wrapper that does not exist or that you cannot run, amvnwthat runs Maven inmaven-wrapper.jar(the typesscript,source, andbin, and each wrapper before 3.3; make the wrapper again withmvn wrapper:wrapper -Dtype=only-script), a wrapper of the Maven daemon (mvnd), and agradlewthat names nogradle-wrapper.jar. The wrapper downloads its distribution of Maven or Gradle as it does with no guard: that download does not go through the guard.
The project of the lockfile checks. The checks before and after the tool read the lockfiles of the project that the tool uses, and the lockfiles that the tool reads:
- An option of the tool that names its project moves the checks to that project, in each form that the tool reads: npm also takes
-prefix dirand a prefix of--prefixsuch as--prefi dir, pnpm also takes-dir dirand--C dir, and go also takes--C dir. The variablePNPM_CONFIG_DIRof pnpm moves them too. For uv,--directory(elseUV_WORKING_DIR) moves them first, and--project(elseUV_PROJECT) moves them again, relative to that directory. For Poetry,--directory(-C) moves them first, and--project(-P) moves them again, relative to that directory, as for uv. Poetry also takes-Cdir,-Pdir, and a prefix of--directoryor--project.--manifest-pathof cargo moves them to the directory of thatCargo.toml. -fand--fileof mvn name the project, a POM or its folder, in each form that Maven reads (-f/path,-file path,-file=path). gradle reads its project from each form of-p:-p dir,-p/dir,-pdir,-p=dir,--p dir,--project-dir dir, and-project-dir dir. The checks read the same project.- dotnet names its project as a word with no flag: the checks also read each folder outside
--dirthat the command works on (the folder of a project or a solution file that a word names, a folder that holds a project, and the folder of each project that such a solution lists).guard dotnetchecks each project and folds the results as one check: a malicious version of any of them gives exit code 1. - In a member of an npm, pnpm, Yarn, or Bun workspace, and in a member directory of a uv workspace, the checks also read the lockfile of the workspace root.
- In a folder with no
package.json,guard <tool>also reads the lockfile of the project above, which the tool installs. In a folder with nopyproject.toml, it reads thepoetry.lockof the project above. - The checks also read the lockfile that the tool reads above the folder of the command. For cargo: the
Cargo.lockof the workspace root of the nearestCargo.toml, also for--manifest-path. For Bundler, with noBUNDLE_GEMFILE: the lockfile of the nearestgems.rborGemfile. For go: thego.modof each module of thego.work, else thego.modabove the folder. - A command that checks more than one project (
guard dotnetchecks each project that a word of the command names outside--dir) checks each project and folds the results as one check: a blocked version of any project gives exit code 1 and the error names each one, with the lockfile of a project outside--dirrelative to--dir; else a refusal of the portal or a refused token of any project; else a part of any project that it did not read; else the outage, by the policy. The order of the projects changes no exit.
- Before the tool. The lockfile check runs. A malicious locked version stops the command with exit code 1, and the tool does not start.
- The run. The CLI starts a proxy on
127.0.0.1and::1, with a secret, and a certificate authority of the run that only the tool trusts. The tool keeps its own registries, credentials, and lockfile URLs, also the TuxCare registry and your own mirror. Each request of the tool goes through the guard, and on through your own proxy when you have one. A few settings of a project send a request past the guard: see Settings that stop the guard or go past it. The guard removes each blocked version from the package lists that the tool reads. A tag such aslatestthat names a blocked version moves to the highest version below it. The download of a blocked version gets the answer 403 with the record, on any host: sonpm ci,uv sync --frozen, and a lockfile URL to another registry are also covered.- Maven and Gradle: a version range of Maven and a dynamic version of Gradle (
1.+) take the version below a malicious newest version. An exact version reads no version list, so the tool fails on the 403 of the download. - dotnet:
dotnet add packagewith no version, anddotnet restoreof a range, take the version below a malicious version. dotnet gets an HTTP cache of the run, so a version list that an earlier run cached does not skip the filter. - go: the version list and
@latestlose a malicious version, so go takes the version below it. The.infoand the.zipof a malicious version get 403. The.modpasses: it holds no code, and go reads the.modof versions that it does not build. A module that go fetches direct from its repository does not pass the filter: see Settings that stop the guard or go past it. - cargo: the sparse index of a crate, on each registry, loses each malicious version. So a malicious newest version leaves cargo with the version below it. The download of a malicious crate gets 403 with the record. A git index (
registry+https://) passes unread, but the download of a malicious version from it gets 403. cargo writesCargo.lockbefore it downloads: the lockfile check after the run then finds the blocked version, and the message says that the guard blocked it.
- Maven and Gradle: a version range of Maven and a dynamic version of Gradle (
- After the tool. The lockfile check runs again (for go, it reads
go.mod). The CLI prints one line for each version that the guard blocked, with the record and its link, and reports the blocks to the workspace: see Blocked installs.
The private key of the certificate authority stays in the memory of the CLI and is never written to disk. The certificate authority is never added to the trust store of the computer, and the CLI deletes its files at the end of the run. The guard writes no header, no body, and no credential to a log.
The tested versions. The guard was tested on Linux with npm 11.19, pnpm 11.21, Yarn 1.22 and Yarn 4.18, Bun 1.4, pip 23.3, uv 0.13, Poetry 2.5, gem of RubyGems 3.5 and 3.6, Bundler 2.4 to 2.6, the .NET SDK 8.0, 9.0, and 10.0, Maven 3.8.8 and 3.9.16, Gradle 8.14.7 and 9.9.1, go 1.21 to 1.27, and cargo 1.70, 1.80, and 1.100. It was not tested on Windows or macOS. On Windows and macOS, cargo can read the certificate store of the system and stop on the connection to the guard: tuxcarectl guard cargo warns there. On Windows and macOS, dotnet reads the certificate store of the system, so it can stop on the connection to the guard: tuxcarectl guard dotnet warns there. On Windows and macOS, go 1.26 or earlier does not trust the guard; use go 1.27 or later (also for a toolchain that go switches to). gem of RubyGems 3.4 or earlier reads an index that the guard does not filter: the download of a malicious version still gets 403, but gem does not take the version below it. gem update --system gives gem the newer index.
An option of the tool that names a proxy, or a list of hosts with no proxy (for example --noproxy of npm), stops the command with exit code 2: the tool would send its requests past the guard. For mvn and gradle, a property (-Dname=…) of the command line, of MAVEN_ARGS, or of .mvn/maven.config whose name holds proxy, useSystemProperties, resolver.transport, or aether.transport stops the command with exit code 2 too, and so does a word -- in MAVEN_ARGS. A word of MAVEN_OPTS, MAVEN_DEBUG_OPTS, .mvn/jvm.config, or MAVEN_ARGS with *, ?, or [ that the mvn script can expand to a -Duser.home, an @file, or a -XX:VMOptionsFile stops guard mvn with exit code 2, and so does each other such word when the working folder has a file or a folder whose name starts with - or @; a value of -s or -gs of MAVEN_ARGS with these characters stops it too. For cargo, a --config that sets a proxy, or that names a file that sets one, stops the command with exit code 2; so does a --config that is not TOML, or a file that the guard cannot read. The guard sends each request through your own proxy anyway.
| Code | When |
|---|---|
| The code of the tool | The tool ended. 0 is a success. |
| 1 | The lockfile check found a blocked locked version before or after the tool (also a version that the guard blocked and the tool still wrote into the lockfile), or the tool failed after the guard blocked a version. |
| 2 | A tool that guard does not run (also nuget), an option, a Maven property, or a cargo --config of the tool that names a proxy, a -- in MAVEN_ARGS, a word or a Maven settings value of MAVEN_OPTS, MAVEN_DEBUG_OPTS, .mvn/jvm.config, or MAVEN_ARGS with *, ?, or [ (see above), --isolated of pip, a wrong option, or a wrong guard key in .tuxcare.yaml; a part of the project that the lockfile check did not read, with no fix (a gap of the CLI). |
| 3 | No token, or the portal refused the token, under fail. |
| 4 | The portal did not answer, or the registry did not give the times of the versions for the release age, under fail. Also under warn: the --timeout limit of the command or a signal ended the command before the tool started. When the limit ended it, a lockfile that the check did not read keeps exit code 5, or 2, as the row of exit code 5 says. The tool does not run. |
| 5 | The tool is not on the PATH, a wrapper that the guard does not run (see the wrappers), a Maven settings file that the guard cannot tell mvn reads names an active proxy, a Maven proxy that the guard cannot take (see Settings that stop the guard or go past it), a proxy whose id starts with tuxcarectl-guard, the guard cannot read a Maven settings file, an init script or the settings script of gradle set a proxy property (with CLI 0.1.99 or later also a later hook or a build script before a resolve, also when the build catches the failure and gradle exits 0), the user NuGet.Config sets http_proxy, a mavenrc file that the mvn script runs does more than set JAVA_HOME (MAVEN_SKIP_RC empty; see Settings that stop the guard or go past it), a lockfile of the check before the tool is damaged or unreadable (the tool does not start; also when the portal did not answer under fail, and exit code 2 when the part has no fix), or a setting would undo the certificate authority of the run under the guard-run-ca-alone flag (see Settings that stop the guard or go past it). |
| 7 | An error in the CLI, or the guard could not start. |
Run a plain npm install through the guard #
You do not have to type tuxcarectl guard each time. tuxcarectl guard setup adds a function for each tool to the start files of your shells: bash (~/.bashrc and ~/.bash_profile), zsh (~/.zshrc), fish (config.fish), and the PowerShell profile. Each function runs tuxcarectl guard <tool>. Then a plain npm install in a new shell goes through the guard. Each command of a tool goes through the guard: for go also go build, go test, and go run, because each one can download a module. The programs that they start get the proxy and the certificate authority of the run. For cargo, each command goes through the guard too: cargo build, cargo test, and cargo run. A build script that cargo starts keeps your own proxy settings, and does not go through the guard.
tuxcarectl guard setup # names the files and asks before it writes
tuxcarectl guard remove # removes the block again
- It changes only a start file that exists. It writes one block between the lines
# securechain:guard:beginand# securechain:guard:end. A second run changes nothing.--yeswrites with no question. - The block works in a new shell. In the shell of the command, read the start file again, for example
. ~/.bashrc. tuxcarectl guard removeremoves the block and nothing else. It does not ask.- A function cannot cover a command that does not go through your shell: a script that starts with
#!/bin/sh, aMakefile, an IDE, or aDockerfile. There, typetuxcarectl guard <tool>. - When the function finds no
tuxcarectlon thePATH, it runs the tool with no filter and a warning. In CI it does not run the tool, and fails with exit code 5.
In CI #
Add two steps before the install of the job: tuxcarectl guard check, and tuxcarectl guard setup --ci. guard setup --ci writes a small script for each tool to a new folder of the job, and puts the folder first on the PATH. So the npm ci of the next step runs as tuxcarectl guard npm ci. The job needs the token as in Get started.
GitHub Actions #
On GitHub Actions, guard setup --ci adds the folder to the PATH of each later step of the job:
name: tuxcarectl
on:
push:
branches: [main]
pull_request:
jobs:
tuxcarectl:
runs-on: ubuntu-latest
env:
TUXCARE_PORTAL_TOKEN: ${{ secrets.TUXCARE_PORTAL_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: |
curl -fsSL https://securechain.tuxcare.com/get/tuxcarectl | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- run: tuxcarectl guard check
- run: tuxcarectl guard setup --ci
- run: npm ci # the install step of your project, through the guard
- run: tuxcarectl sca --fail-on high
GitLab CI #
A GitLab job runs the lines of its script in one shell. guard setup --ci prints the line that changes the PATH, and eval runs it in that shell:
tuxcarectl:
image: node:22 # the image that builds your project
variables:
TUXCARECTL_PIN: v0.1.94 # the first release with the guard
script:
- |
set -eu
base=https://securechain.tuxcare.com/get
curl -fsSL "$base/$TUXCARECTL_PIN/install.sh" -o /tmp/tuxcarectl-install.sh
TUXCARE_VERSION="$TUXCARECTL_PIN" TUXCARE_INSTALL_DIR=/tmp/tuxcarectl-bin \
TUXCARE_DOWNLOAD_BASE="$base" sh /tmp/tuxcarectl-install.sh
- export PATH="/tmp/tuxcarectl-bin:$PATH"
- tuxcarectl guard check
- guard_path="$(tuxcarectl guard setup --ci)"
- eval "$guard_path"
- npm ci # the install step of your project, through the guard
- tuxcarectl sca --fail-on high
Keep the two lines of guard_path. When the setup fails, the job stops at the first line. In one line, eval "$(tuxcarectl guard setup --ci)", a CLI that does not start gives an empty text, and the job goes on with no guard. The lines of before_script and script run in one shell. after_script and the other jobs do not get the guard. In a Go job each later go runs through the guard, go build and go test too. The job keeps its pin in TUXCARECTL_PIN, a name that the install script does not read, and gives it to TUXCARE_VERSION on the install line: a CI/CD variable of the project comes before a variable of the job, so a TUXCARE_VERSION of the project's CI/CD variables would install another version than the pin of the job.
Any other CI system #
Run these commands in one shell of the job, after the checkout. set -e stops the job at the first command that fails:
set -e
curl -fsSL https://securechain.tuxcare.com/get/tuxcarectl | sh
export PATH="$HOME/.local/bin:$PATH"
tuxcarectl guard check
guard_path="$(tuxcarectl guard setup --ci)"
eval "$guard_path"
npm ci # the install step of your project, through the guard
tuxcarectl sca --fail-on high
When the portal does not answer, the guard stops the job by default only in a CI run: the CLI reads CI=true and the variables of the common CI systems. Elsewhere it warns, and the install goes on with no filter. If your CI system does not set CI=true, add export CI=true before the guard lines. See When the portal does not answer.
guard setup --ci writes sh scripts, so it stops with exit code 2 on a Windows runner. There, run each tool as tuxcarectl guard <tool>, for example tuxcarectl guard npm ci.
A cache of the runner (node_modules, or the cache of the package manager) can hold a malicious copy from an earlier job: see The local cache.
The release age #
A new malicious version is often found and reported within hours or days. Before the report, no record can block it. The release age holds back each version that is younger than the age that you choose. It is off until you set it, in .tuxcare.yaml of the project:
guard:
min_release_age: 24h
- The value is a duration, for example
24hor72h.0turns it off. - The age is the publish time that the registry gives: the
timeof the version on npm, the upload time of each file on PyPI, the time of each version on RubyGems, the publish time of the registration of a NuGet feed, and theLast-Modifiedtime of the POM of each version for Maven and Gradle. - For go, the age is the
Timeof the.infoof each version: the time of the commit of the tag, which the author of the module sets, not the registry. - For cargo, the age is the
pubtimeof each line of the index of the registry. A registry that writes nopubtimegives no date: then the release age holds back each version of that registry, unless--allow-newnames it. - The guard reads the times from the registry of the tool, with the credential of the tool, also through a tunnel. When the registry does not give them (for example it answers 401, or it does not answer), the policy of When the portal does not answer applies, and the message names the registry and its answer.
- For Maven, Gradle, and go, the release age holds back only a version that the tool chooses: a version of a range of Maven, a dynamic version of Gradle, or a query of go (
latest,v1, a branch). It does not hold back an exact version, or a version thatgo.modnames. - A TuxCare build of the catalogue is never held back. Neither is a version that an admin allowed.
--allow-new <name>@<version>lets one young version through for one command, for exampletuxcarectl guard --allow-new left-pad@1.4.0 npm install. Give it again for each version. It does not let a malicious version through: no option and no variable switches off the malicious block.- A version that the release age held back shows on Blocked installs with the reason Too new.
Use guard.min_release_age, not the release age of the package manager (for example minimumReleaseAge of pnpm, or npmMinimalAgeGate of Yarn). The setting of the package manager also holds back a new TuxCare build: a build that fixes a vulnerability is a new version too, so the fix comes late. The guard knows which versions are TuxCare builds, and lets them through. tuxcarectl check reports the release age of the package manager for this reason.
When the portal does not answer #
The guard and the check ask your workspace about each version. When the portal does not answer, the result depends on where the command runs:
| Where | Default | What happens |
|---|---|---|
| Your computer | warn: fail open | Each request that the portal did not answer passes with no change, and the CLI prints a warning. A cached verdict that is still fresh counts as an answer: a version that it blocked stays blocked. With no token, the tool runs with no filter and a warning. |
| CI | fail: fail closed | The guard answers 503 to each request that it could not check, so the tool fails, and the command exits with code 4. With no token, the command exits with code 3, and the tool does not start. |
- The CLI is in CI when the CI system sets its variable, for example
CI=true,GITHUB_ACTIONS, orGITLAB_CI. - An answer of the portal that is still fresh counts: the CLI keeps each answer for some minutes, also between two runs.
--on-portal-error failor--on-portal-error warnchanges the default for one command. The keyguard.on_portal_errorof.tuxcare.yamlchanges it for the project. The option wins over the key.- The same policy applies when the registry of the tool does not give the times of the versions for the release age: 503 and exit code 4 in CI, a warning on your computer. The message names the registry host and its answer, not the portal, for example
the guard read the registry nuget.pkg.github.com to check 1 request of dotnet (for guard.min_release_age), and the registry answered 401 Unauthorized
. An older CLI sent no credential of a private NuGet feed in a tunnel for this read, and its message named the portal. warndoes not lower a stop before the tool starts. When the--timeoutlimit of the command (20 minutes by default) or a signal endstuxcarectl guard <tool>before the tool starts, the command stops with exit code 4, and the tool does not run, for exampleguard npm reached the --timeout limit before npm started
.- Do not set
warnon a job that builds a release: a check that passes when it cannot ask is not a check.
Allow a version #
A record can be wrong, and OpenSSF can take some time to withdraw it. Only a person who is signed in with the role admin of the workspace can allow a malicious version. A member, a department admin, an access token, and an MCP session cannot: also a token of an admin cannot.
- Open Settings › Allowed malicious versions, and select Allow a version…. Give the ecosystem, the package name, the version, why, and a reason. With no version, the allow covers every version of the package. A Last day (optional, UTC) ends the allow by itself.
- An admin's ignore of a malicious finding allows that version too. The triage control says so, and asks for the reason. A member can set Acknowledged: the finding still counts as open, and the CI gate still fails. No suppression rule covers a malicious finding.
- The allow is the ignore. When an admin ends the allow, or its last day passes, the finding counts as open again, and the CI gate fails, unless another allow still covers the version (an allow of every version of the package). A move to another version of the package is a new finding: the ignore covers it only when an allow covers that version. An ignore that lasts longer than an active allow of its version replaces that allow.
- An allow covers the whole workspace: the guard installs the version,
guard checkpasses it, and its findings count as ignored. Every member reads the list, with who allowed each version, when, and why. - An admin ends an allow with End in its row, then End the allow. An allow is never deleted: the list keeps it as Ended.
When you think that a record is wrong, also tell TuxCare. A correction of TuxCare ends a wrong record for every workspace.
Blocked installs #
After a command with a block, the CLI sends a report to the workspace: the tool, the command word (for example install), the blocked versions with their records, the repository when the command ran in one, and whether it ran in CI. The report holds no file path, no other word of the command, and no variable of the environment.

- The page Blocked installs lists the blocks of the workspace. The page Vulnerabilities links to it. The page of a repository shows its newest block.
- The reason is Malicious (a record names the version) or Too new (the release age).
- The daily digest lists the blocks of its day. A block sends no alert at once: the install did not happen.
- The portal keeps a block for 90 days.
- A workspace stores at most 5000 blocked versions in one hour. Above that, the CLI prints a warning that it could not send the block report, and the command ends as it would with no report. The guard still blocks each version.
Malicious sightings #
A malicious version that CI installed one time can have run its install script, and the harm can stay after the package goes. So the portal keeps a record of each malicious version that a scan held: the counts, the grade, and the banner of the Overview show only what the code holds now, and the record shows what it held.
- The page Malicious sightings lists each malicious version that a scan of the workspace held, on any branch, also a version that an admin allowed. The page Vulnerabilities links to it. Each row names the package, its records, the repository, the branch and the slot (the project path and the package managers of the scan), the first and the last scan that held it, and its state.
- A sighting stays after a newer scan no longer holds the package, after the old scans are deleted, and after the slot of the scan is removed. Only the delete of the repository or of the workspace removes it.
- The state is Open now while an open finding of the default branch or of an active release counts it, else Past. The Overview shows the line
N past sightings not reviewed
while such past sightings wait. - Check with your security team what the version could do, for example on the CI runners that installed it. Then an admin selects Mark reviewed… and writes a note, for example the ticket of the review. Only a person who is signed in with the role admin of the workspace can mark a sighting reviewed. The review stays on the record, with the name of the admin.
- The API
GET /api/v1/malicious/sightingsand the MCP toollist_malicious_sightingsread the same record.
Settings that stop the guard or go past it #
With the rollout flag guard-run-ca-alone, the guard keeps the system certificate authorities out of the run: mvn, gradle, pip, uv, uvx, Poetry, gem, Bundler, go, npm, npx, pnpm, and Yarn trust only the certificate authority of the guard during a guard run, as dotnet does in each run. gem keeps the two GlobalSign roots for rubygems.org, and bun, bunx, and cargo keep their other certificate authorities. A request that goes past the guard then fails on the TLS check. The limit is code of the build: a line of build.gradle, a Maven plugin, or a script of a package can set its own trust store or open its own connection, and no setting of the run closes that. A trust store that a beforeSettings hook of an init script or settings.gradle sets stops the build. With CLI 0.1.99 or later, so does a trust store that a settingsEvaluated, projectsLoaded, or beforeProject hook of an init script, or a line of build.gradle, sets before a resolve: only a line of build.gradle after the last resolve of Gradle stays code of the build (see the row of the Gradle proxy property below). When the command of the tool fails, the last line of its output says what to check. The flag is off until the portal turns it on.
Under the same flag, a setting that turns the certificate check off or names another certificate authority stops the run with exit code 5 before the tool starts, and the message names its place; remove the setting for the command. The settings are aether.connector.https.securityMode of mvn (on the command line, in MAVEN_ARGS, .mvn/maven.config, .mvn/jvm.config, MAVEN_OPTS, MAVEN_DEBUG_OPTS, JAVA_TOOL_OPTIONS, JDK_JAVA_OPTIONS, _JAVA_OPTIONS, or a file that one of the JVM places names) and javax.net.ssl.trustStore of mvn (on the command line, in MAVEN_ARGS, .mvn/maven.config, MAVEN_DEBUG_OPTS, or _JAVA_OPTIONS); --trusted-host of pip, each abbreviation of it, and that line of a requirements or constraints file; --allow-insecure-host and --trusted-host of uv and uvx, and allow-insecure-host of a uv.toml or of [tool.uv] of pyproject.toml; cert of [certificates.<source>] of poetry.toml or of the user configuration of Poetry, with false or a certificate authority file, and a certificate authority file in POETRY_CERTIFICATES_<SOURCE>_CERT; BUNDLE_SSL_VERIFY_MODE (other than 1) and BUNDLE_SSL_CA_CERT of the .bundle/config of the project or of BUNDLE_APP_CONFIG; and http.sslVerify = false of the git configuration for go, also for one URL. For pnpm, the flag refuses ca, cafile, and strict-ssl of a project or user .npmrc, ca or strictSsl of pnpm-workspace.yaml, ca of rc or config.yaml of the pnpm configuration folder, the certificate authority of one registry (<URL>:ca or <URL>:cafile, for example //registry.example/:cafile) in each of these files, and --use-bundled-ca in NODE_OPTIONS; for Yarn, ca, cafile, and strict-ssl of a project or user .yarnrc, and yarn_ca, yarn_cafile, and yarn_strict_ssl in the environment, with the name in any case. For npm, npx, and pnpm, a word of the command that names a certificate authority or turns the certificate check off stops the run with exit code 5, and the message names the word: --strict-ssl with a value other than true, --no-strict-ssl, --ca, --cafile, --<URL>:ca, and --<URL>:cafile, with their abbreviations, and --config.<key> of pnpm. A strict-ssl or strictSsl of true stops nothing. Other such settings the run outranks instead of refusing: trusted-host of a pip.conf, PIP_TRUSTED_HOST, UV_INSECURE_HOST, ssl_verify_mode of a gemrc, BUNDLE_SSL_VERIFY_MODE and ssl_verify_mode of ~/.bundle/config, GOINSECURE, GIT_SSL_NO_VERIFY, and a trust store of a Gradle init script. The guard checks each host with your own certificate authorities, so the tool needs no other one for a request through the guard.
The guard sets the proxy and the certificate authority of the tool in variables of the run. npm and npx also get NO_PROXY and no_proxy of the run, so a NO_PROXY of yours that names the registry host does not send npm past the guard. A file of the project or of your home directory can win over a variable. Then the tool either stops on the connection to the guard and installs nothing, or sends its requests past the guard. Correct these settings:
| Setting | What happens | What to do |
|---|---|---|
cafile or ca of npm, pnpm, or Yarn 1, in the .npmrc of the project or of your home directory | The tool does not trust the guard, stops, and installs nothing. | Remove the line, and give the certificate authority in NODE_EXTRA_CA_CERTS. The guard checks the registry with it. |
A networkSettings entry httpsProxy, httpProxy, httpsCaFilePath, or caFilePath for a host, in the .yarnrc.yml of the project, of a folder above it, or of your home directory (Yarn 2 or later) | The requests of Yarn to that host would go past the guard: the run stops with exit code 5 before Yarn starts, and the message names the file and the entry. | Remove the setting from the entry. Your own proxy goes in HTTPS_PROXY or the top level of ~/.yarnrc.yml, your own certificate authority in NODE_EXTRA_CA_CERTS. |
proxy of the pip.conf of the virtual environment of the project | The requests of pip go past the guard, with no filter. | Remove the line, and set your proxy in HTTPS_PROXY or PIP_PROXY. |
cert of a pip.conf (also of the virtual environment), a cert of a Poetry source, or native-tls = true of uv | The tool does not trust the guard, stops, and installs nothing. | Remove the setting, and give the certificate authority in SSL_CERT_FILE or REQUESTS_CA_BUNDLE. |
BUNDLE_SSL_CA_CERT in the .bundle/config of the project | Bundler does not trust the guard, stops, and installs nothing. | Remove the line, and give the certificate authority in SSL_CERT_FILE. |
An active <proxy> of a Maven settings file that the guard cannot tell mvn reads; a proxy whose password is encrypted (settings-security.xml), whose value is a ${…} that is no set variable, or whose value has a character outside ASCII; a proxy whose id starts with tuxcarectl-guard; or a Maven settings file that the guard cannot read | An active proxy of the Maven settings that mvn surely reads is the route of the guard: the file of -s or -gs on the command line or in .mvn/maven.config, ~/.m2/settings.xml of the home of the JVM, and conf/settings.xml of the Maven that runs. The guard sends each request of mvn on through the proxy that Maven would take, with its credential and its nonProxyHosts, and gives mvn a copy of its user settings with the proxy of the guard in its place. You need no HTTPS_PROXY for it. An active proxy of another settings file would win over the guard: a -s of MAVEN_ARGS, the file of a -Duser.home, or ~/.m2/settings.xml of a HOME that is not the home of the JVM. Then tuxcarectl guard mvn stops with exit code 5 before mvn starts, and so does a proxy that the guard cannot take as Maven does. The message names the file and the proxy. A proxy whose id starts with tuxcarectl-guard stops it too, also an inactive one: Maven would put it in the place of the proxy of the guard. A settings file that the guard cannot read (for example a UTF-16 file, or a file that is not XML) stops it too, with the file and the reason: it could name an active proxy. An active <proxy> under <proxies> counts whatever the name of the root element of the file is: Maven reads a file whose root is not <settings> too, with a warning. guard mvn reads -s and -gs in each form that Maven reads (-s/path, -settings path, -s=path, --s path, -gs=path, -B-s path), on the command line, in MAVEN_ARGS, and in the .mvn/maven.config of the folder of -f or of MAVEN_BASEDIR. It also reads .m2/settings.xml of each -Duser.home that Maven gets: in MAVEN_OPTS, MAVEN_DEBUG_OPTS (the mvn script gives it to each run of mvn, not only to mvnDebug), .mvn/jvm.config, JAVA_TOOL_OPTIONS, _JAVA_OPTIONS, JDK_JAVA_OPTIONS, the command line, MAVEN_ARGS, and .mvn/maven.config, and in the files that a -XX:VMOptionsFile or an @file of these sources names, as the java launcher reads them. A -- in MAVEN_ARGS stops guard mvn with exit code 2. A word with *, ?, or [ in MAVEN_OPTS, .mvn/jvm.config, or MAVEN_ARGS, and in MAVEN_DEBUG_OPTS too, that mvn can expand to -Duser.home, an @file, or a -XX:VMOptionsFile stops it too, and each other such word when the working folder has a file or a folder whose name starts with - or @. A wildcard value of -s or -gs in MAVEN_ARGS stops guard mvn with exit code 2 as well: the actual file cannot be determined. | Name the settings file with -s on the command line, so that the guard takes its proxy. Else set <active>false</active> for the command, and set your proxy in HTTPS_PROXY. Write the password of the proxy in the file with no encryption, or set the variable that the ${…} names. Give your own proxy an id that does not start with tuxcarectl-guard. Save a settings file that the guard cannot read in UTF-8. For a stop on a wildcard word, take the *, ?, and [ out of the argument or of the path that the settings name. |
A mavenrc file that a mvn script can run (~/.mavenrc, /etc/mavenrc, /usr/local/etc/mavenrc, /etc/java/maven.conf, or mavenrc_pre.bat or mavenrc_pre.cmd of %USERPROFILE%), while MAVEN_SKIP_RC is empty, that does more than set JAVA_HOME to a plain value | tuxcarectl guard mvn stops with exit code 5 before mvn starts: the mvn script runs the file after the guard read the environment, so it could set MAVEN_OPTS. The guard reads each file of this list, whatever the mvn script of the run reads. The message names the file, the number of the line, and the variable that the line sets. A file that the guard cannot read stops it too. | Set MAVEN_SKIP_RC=1 for the command and give the settings of the file in the environment, or remove the line. |
A proxy that only a systemProp line of gradle.properties names | The guard reads no setting of Gradle, so it cannot reach the registry through that proxy. For mvn the proxy of its settings is the route of the guard (see the row of the Maven proxy). | Set your proxy in HTTPS_PROXY for the command. |
A proxy property (https.proxyHost, http.nonProxyHosts, and the other proxy properties) that an init script of the Gradle user home (init.gradle, init.d), a later -I, a hook of an init script, settings.gradle, or build.gradle sets, with guard gradle or guard ./gradlew | The guard sets its own proxy again before the settings, so a property of an init script sends no request past the guard. When a beforeSettings hook of an init script, or settings.gradle, changes such a property (with the flag guard-run-ca-alone also javax.net.ssl.trustStore), the build stops at the end of the settings with the message tuxcarectl guard: an init script or the settings script set the system property …, and the command exits with code 5. CLI 0.1.99 or later also checks these properties before each resolve of the build. When a settingsEvaluated, projectsLoaded, or beforeProject hook of an init script, or a System.setProperty of build.gradle or of a plugin, changes such a property before a resolve, the build stops before the first request of that resolve, with the same message, and the command exits with code 5. It exits with code 5 also when the build catches the failure and gradle exits 0, unless the check after the tool ends the run first with its own exit code (a blocked version, or a portal that did not answer under fail). A version that the guard blocked in the same build still gives exit code 1 when gradle failed after the block. Up to CLI 0.1.97, a plugin of settings.gradle can resolve past the guard before the stop at the end of the settings, and it stays in the Gradle cache. With Gradle before 6.0, each proxy property that an init script of the user sets stops the build. A System.setProperty of build.gradle after the last resolve (up to CLI 0.1.97, each one after the settings), or code that sends requests with a client of its own, can still send requests past the guard. | Remove the property from the script, and set your proxy in HTTPS_PROXY for the command. |
http_proxy in the config section of the user NuGet.Config (~/.nuget/NuGet/NuGet.Config) | dotnet takes that proxy over the proxy of the guard. tuxcarectl guard dotnet stops with exit code 5 before dotnet starts, and names the file. A user NuGet.Config that the guard cannot read as XML stops it too. The http_proxy of a project nuget.config or of a file of --configfile changes nothing. | Remove http_proxy from the file, and set your proxy in HTTPS_PROXY. |
A certificate authority only in a Java trust store (javax.net.ssl.trustStore, the cacerts of a JDK) | The guard checks the registry with the system store and SSL_CERT_FILE, so it does not trust the registry. A javax.net.ssl.trustStore on the command line also stops the tool on the connection to the guard. | Give the certificate authority in SSL_CERT_FILE, and remove the trust store from the command line. |
GOPROXY=direct, a module of GOPRIVATE or GONOPROXY, or an entry after a | in GOPROXY | go fetches the module from its repository, past the filter. The lockfile check after the run reads go.mod, and exits with code 1 for a malicious version that go added. | Put a , in place of a | in GOPROXY. For a module that go must fetch direct, the lockfile check after the run is the only check. |
A GOPROXY entry on localhost or a loopback IP (for example 127.0.0.1 or [::1]), in the environment or in the Go env file (the file of go env -w, or the file that GOENV names) | go sends its requests to it direct, past the guard, with no filter. Before go starts, tuxcarectl guard go stops with exit code 5 when such an entry comes before off or direct. The error names each entry by its position and its host, and prints no credential, path, or query of its URL. | Set GOPROXY to a proxy on a host that is not a loopback host. For an entry of the Go env file, set a non-loopback GOPROXY in the environment first: go reads the environment before the file, and the guard then lets go env -w GOPROXY=… fix the file. |
GODEBUG=x509sslcertoverrideplatform=0 on Windows or macOS | go reads the trust store of the system, does not trust the guard, and stops. | Remove the setting. |
| A NuGet feed of the v2 protocol | The guard does not filter its version list: dotnet can choose a malicious version. The download gets 403, and the command fails and names the record. | Use the v3 feed of the host. |
| An index file in the cache of Bundler from a run with no guard | Bundler can choose a malicious version from it. The download gets 403, and the command fails and names the record, but Bundler does not take the version below it. | Remove ~/.bundle/cache/compact_index (or the compact_index folder under BUNDLE_USER_CACHE when you set it), and run the command again. |
net.git-fetch-with-cli = true of cargo | The git of the system fetches a git index or a git dependency, and that fetch can go past the guard. The download of a crate still goes through the filter. | Remove the setting for the command. |
The local cache #
The guard sees each request that the tool sends. It does not see a package that the tool takes from its own cache: the npm cache, the pnpm store, the Yarn cache of the repository, the uv cache, the global packages folder of NuGet (~/.nuget/packages), the local Maven repository (~/.m2), the Gradle cache, the Go module cache (go clean -modcache empties it), or the cargo cache (~/.cargo/registry/cache, when cargo runs with --offline or net.offline). The lockfile check before the run stops each malicious version that the lockfile names. But when the lockfile did not name the version before the run, and the tool takes it from its cache, the version passes the filter, and the tool runs its install script. The lockfile check after the run finds it: the command exits with code 1 and names the version. A module that go run module@version or go install module@version builds is not in go.mod, and the check after the run does not see it. Maven has no lockfile, and Gradle has one (gradle.lockfile) only when the project turns on dependency locking: so a malicious version that mvn, or gradle with no lockfile, takes from its local cache passes with no check, also after the run.
Such a cached copy comes from an earlier install on the same computer, or from a cache of the CI runner, and that earlier install ran its code already. When this happens, treat the computer as exposed: remove the package, clear the cache of the tool, and replace the tokens and keys that the computer holds.
What the guard does not cover #
- A request that a setting of the project sends past the guard: see Settings that stop the guard or go past it.
- An install that does not go through
tuxcarectl: a plainnpm installin a shell with no aliases, an install from an IDE, or aDockerfilethat does not call the CLI. - The install of an ecosystem that the filter does not cover yet, for example Composer.
tuxcarectl guard checkstill reads their lockfiles, and the portal still reports them after a scan. - nuget.exe: run
tuxcarectl guard dotnet. The download of the distribution of Maven or Gradle by./mvnwor./gradlew(see the wrappers). - An older CLI. A CLI of 0.1.92 or earlier has no
guard(0.1.93 was tagged but never promoted: it holds the token leak SC-3522), and itsscagates a malicious finding only by its severity.
The TuxCare registry #
TuxCare builds each TuxCare build from the source, in its own pipeline, so a hijacked package file of a public registry is not in a build. A malicious record never blocks a build of the TuxCare catalogue.
The TuxCare registry also serves the upstream versions of the packages, for example of npm. The registry does not remove a malicious upstream version yet. So use the guard also when your projects install from the TuxCare registry: the requests of the tool to the registry go through the guard, as the requests to each other host do.
Next: Releases, VEX, compliance