Pulse Beta

User guide

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:

The three checks #

  1. The lockfile check before the install. tuxcarectl guard check reads the lockfiles of the project and stops when a locked version is malicious. tuxcarectl check runs the same check first.
  2. 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 plain npm install goes through the guard too.
  3. 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 sca fails 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 under baseline.on_fetch_error: closed does 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 submit also exits with code 1 on an open malicious finding in the image, with or without --fail-on and 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:

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.

CodeWhen
0No 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.
1A 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.
2A 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).
3No token, or the portal refused the token.
4The 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.
5A 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.
7An 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.

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:

  1. Before the tool. The lockfile check runs. A malicious locked version stops the command with exit code 1, and the tool does not start.
  2. The run. The CLI starts a proxy on 127.0.0.1 and ::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 as latest that 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: so npm 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 package with no version, and dotnet restore of 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 @latest lose a malicious version, so go takes the version below it. The .info and the .zip of a malicious version get 403. The .mod passes: it holds no code, and go reads the .mod of 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 writes Cargo.lock before it downloads: the lockfile check after the run then finds the blocked version, and the message says that the guard blocked it.
  3. 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.

CodeWhen
The code of the toolThe tool ended. 0 is a success.
1The 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.
2A 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).
3No token, or the portal refused the token, under fail.
4The 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.
5The 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).
7An 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

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

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:

WhereDefaultWhat happens
Your computerwarn: fail openEach 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.
CIfail: fail closedThe 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.

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.

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, with three blocked versions: chalk 5.6.1 and reqeusts 2.32.4 with the reason Malicious and their records, and @acme/ui-kit 3.2.0 with the reason Too new. Each row names the command, the repository, CI or a developer machine, and the time.
The page Blocked installs, with the filter of the reason and the search.

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.

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:

SettingWhat happensWhat to do
cafile or ca of npm, pnpm, or Yarn 1, in the .npmrc of the project or of your home directoryThe 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 projectThe 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 uvThe 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 projectBundler 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 readAn 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 valuetuxcarectl 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 namesThe 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 ./gradlewThe 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 GOPROXYgo 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 macOSgo reads the trust store of the system, does not trust the guard, and stops.Remove the setting.
A NuGet feed of the v2 protocolThe 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 guardBundler 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 cargoThe 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 #

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