Edit icon Edit This Page

Start a vulnerability scan of a package version

Start a vulnerability scan of one version of a package. The server answers 202 and scans in the background; its Location header names the scan, which rp prints. A manual scan runs whatever the repository’s automatic scan setting says, but not when scanning is switched off on the server (code scannerDisabled).

With a scanner enabled every upload starts a scan on its own, so a trigger right after ‘rp push’ meets a scan that is already running (HTTP 409, code scanAlreadyRunning). rp then attaches to that scan instead of failing: with –wait it waits for it and applies –fail-on; without –wait it prints the running scan’s id and status and exits 0 (a note on stderr says it attached).

–scope is the npm scope without the “@” (scoped npm packages only).

In a Maven repository the artifact is groupId:artifactId (for example com.acme:app); the server finds nothing for the bare artifactId, so rp refuses it. The other formats take the plain package name.

–wait polls until the scan is COMPLETED or FAILED (the server has no status endpoint): first every –poll-interval, then slower, up to 15 seconds. It gives up after –timeout (default 10m) with a timeout error, which is NOT the threshold error: it exits 1, says nothing about the findings, and the scan keeps running on the server.

–fail-on critical|high|medium|low exits 5 when the scan has a finding at or above that severity; UNKNOWN findings never count. A scan that FAILED, or that is not final yet, cannot be judged: that is an error with exit 1, not a pass. Exit codes: 0 passed, 5 threshold reached, 1 timeout or other failure.

Examples:

rp scan trigger libs my-app 1.2.0
rp scan trigger maven-libs com.acme:my-app 1.2.0 --wait --fail-on high
rp scan trigger <repo> <artifact> <version> [flags]

Options

      --fail-on string           Exit 5 when a finding has this severity or worse (critical, high, medium, low)
      --poll-interval duration   First pause between polls; it grows up to 15s (with --wait) (default 2s)
      --scope string             npm scope, without the @
      --timeout duration         Give up waiting after this long (with --wait) (default 10m0s)
      --wait                     Wait until the scan is COMPLETED or FAILED

Options inherited from parent commands

      --api-url string           Panel API URL of the profile, overrides the stored value
      --ca-file string           PEM file with extra trusted CA certificates
      --debug                    Print debug output with secrets redacted
      --hostname string          Repsy host to use instead of the current profile
      --insecure                 Do not verify TLS certificates (unsafe; plain http is chosen with the URL, not with this flag)
      --insecure-storage         Keep credentials in a plain 0600 file instead of the OS keyring (unsafe; a warning is printed once per command)
      --jq string                Filter JSON output with a jq expression (implies --output json)
      --no-color                 Disable colored output
      --no-input                 Never prompt; fail when input is needed
      --output table|json|yaml   Output format: table, json or yaml (default table; json when --jq is given)
      --owner string             Owner segment of Cloud protocol URLs; --owner= means none
      --registry-url string      Protocol host URL of the profile, overrides the stored value
      --type os|cloud            Product of the host, overrides detection
      --web-url string           Panel UI URL of the profile (where /cli/auth lives), overrides the stored value
      --yes                      Answer yes to confirmation prompts

See also

  • rp scan - Trigger vulnerability scans and read their results
Found a problem with this page?