

# Protecting package installs with the Continuum for software supply chain CLI

**Note**  
AWS Continuum for software supply chain is in preview release and is subject to change.

The Continuum for software supply chain CLI runs on a developer workstation or a build host. You put the `cscf` command before a package manager command, and the CLI requests a package decision for each package as the package manager downloads it. For what it doesn't check, see [Considerations](#sc-cli-limitations).

For the terms that Continuum for software supply chain uses, such as policies, package decisions, and package identity, see [AWS Continuum for software supply chain concepts](sc-concepts.md). To get your first package decision, see [Getting started with Continuum for software supply chain](sc-getting-started.md). To install the CLI, see [Step 1: Install the Continuum for software supply chain CLI](sc-getting-started.md#sc-getting-started-install).

## Run a package manager through the CLI
<a name="sc-cli-run"></a>

Put `cscf` before a package manager command. The CLI runs that command and passes its arguments through unchanged. As the package manager downloads each package, the CLI requests a package decision and stops any package that Continuum for software supply chain denies. For example:

```bash
PROMPT> cscf npm install express
PROMPT> cscf pip install -r requirements.txt
PROMPT> cscf cargo build
```

At the end of the run, the CLI lists blocked packages, unverified packages, and packages that an audit-mode policy would block once enforced.

The CLI supports the following package managers:


| Package manager | Commands | Platforms | 
| --- | --- | --- | 
| Cargo | cargo | Linux, macOS, Windows | 
| Go modules | go | Linux, macOS, Windows | 
| Maven | mvn, mvnw | Linux, macOS, Windows | 
| npm | npm | Linux, macOS, Windows | 
| NuGet | dotnet | Linux only | 
| pip | pip, pip3, and versioned names such as pip3.12 | Linux, macOS, Windows | 
| RubyGems | gem | Linux, macOS, Windows | 

The CLI runs on Linux, macOS, and Windows, each on x86\_64 and arm64.

This list isn't the same as the list of ecosystems that AWS Continuum for software supply chain evaluates. For the ecosystems, see [Supported ecosystems](sc-concepts.md#sc-concepts-package-identity-ecosystems).

## Using the CLI in CI/CD
<a name="sc-cli-ci"></a>

You can run the Continuum for software supply chain CLI in a continuous integration and continuous delivery (CI/CD) pipeline. The CLI works wherever you can run a command line.

In your pipeline, provide credentials through the default AWS SDK credential chain, such as the credentials of the build role. Install the CLI as a build step. Then put `cscf` before each package install.

A CI pipeline usually runs the CLI fail-closed, so that a package that gets no decision is blocked and the build fails with exit code `1`:

```bash
PROMPT> CSCF_FAIL_CLOSED=1 cscf npm ci
```

For the exit codes, see [Exit codes and fail-open behavior](#sc-cli-exit-codes). For fail-open and fail-closed behavior, see [Availability and fail-open behavior](sc-cli-security.md#sc-cli-security-availability).

## Exit codes and fail-open behavior
<a name="sc-cli-exit-codes"></a>

The CLI returns with the following exit codes:


| Exit code | Meaning | 
| --- | --- | 
| 0 | The install succeeded, and every package was checked. Audit-mode findings don't fail the run. | 
| 1 | The CLI blocked a package, couldn't start inspection, or its inspection proxy failed. This includes authentication failures and fail-closed blocks. | 
| 3 | The install succeeded, but the CLI didn't get a decision for at least one package. | 
| 130, 143 | The run was stopped with Ctrl-C (130) or SIGTERM (143). The CLI passes SIGTERM to the package manager. | 
| Other | The package manager failed. The CLI returns the package manager's exit code. | 

Authentication failures always block. If your AWS credentials are missing, expired, or rejected, the CLI blocks every package and returns with exit code `1`, even when fail-open is on.

If a package manager's own configuration sets a proxy (npm `https-proxy` or `proxy`, pip `proxy` or `PIP_PROXY`, Cargo `http.proxy` or `CARGO_HTTP_PROXY`), the CLI stops before the install and returns with exit code `1`. Set the network proxy with `HTTPS_PROXY` and `NO_PROXY` instead.

By default, the CLI fails open. For when it does and how to make it fail closed, see [Availability and fail-open behavior](sc-cli-security.md#sc-cli-security-availability).

## Considerations
<a name="sc-cli-limitations"></a>

As you use the Continuum for software supply chain CLI, keep the following in mind:
+ It is not a sandbox. It doesn't contain or isolate the package manager or the packages that it installs.
+ It checks only the commands that you run through it.
+ Packages already in a local cache don't pass through the CLI and aren't checked. Vendored and local path dependencies aren't downloaded, so they aren't checked either.
+ npm, pip, and Cargo dependencies installed from a Git repository aren't checked. Their registry dependencies are.
+ Some private registry layouts might not be recognized. Those packages install unchecked, and the CLI returns with exit code `3`.
+ A proxy set in the package manager's own configuration isn't supported. The CLI stops and returns with exit code `1`. Use `HTTPS_PROXY` and `NO_PROXY` instead.
+ With RubyGems versions earlier than 3.3 (such as the Ruby that comes with macOS), the CLI works out each gem's name from its file name, which can be wrong for some names that contain a version number.
+ For Maven, the CLI supplies its own global settings file for the run, so settings in the Maven installation's `conf/settings.xml` don't apply. Put mirrors and servers in `~/.m2/settings.xml`.
+ Under heavy use, the CLI retries a throttled lookup up to five times, so an install can pause.

For what the CLI sends to AWS and how it inspects downloads, see [Security of the Continuum for software supply chain CLI](sc-cli-security.md).