relgap outdated
Scans the project at path (default: the current directory) the way 'relgap pins' does and compares each pin with the newest stable version on the tool's release line.
CURRENT is the version a pin stands for. An exact pin is itself. A value marked ≈ allows more than one version, and the notes say which one relgap used: a constraint (~> 1.15) takes the highest exact pin of the tool in the same repository that satisfies it, otherwise the lowest version that does; a prefix (26, prefix:1.2) takes the highest stable version that starts with it; the latest channel is the latest version. Other channels (lts) aren't compared.
BEHIND, BREAKING and DEPRECATION come from the digest of CURRENT..LATEST, the same digest 'relgap digest <tool> <current>..' prints. Entries below --min-confidence aren't counted.
relgap finds the latest versions with GraphQL queries of 10 to 25 tools, sent in parallel. Only pins that are behind, and constraint and prefix pins, need a tool's full release list; constraint and prefix pins start loading it at the same time.
tfprovider, tfmodule and chart pins are looked up in the Terraform registry and Artifact Hub, which name the repository. A chart pin with a repository URL (a Chart.yaml repository or a Renovate comment's registryUrl) uses the Artifact Hub repository at that URL, so a chart name that several repositories share still resolves. bitbucket: and gitlab: pins read the tags of their repository on that host. Image pins compare with the tags of their registry, and their notes come from the GitHub repository the image's source label names. Action pins (scan.detectors.ci_actions) compare with the releases of the action's repository; a pin by commit SHA counts as the version its line comment names (# v4.1.3). Pins of tools without a repository relgap can read and images on a registry relgap doesn't read are skipped; --format json lists them with the reason.
EOL shows whether CURRENT's release cycle has reached its end on endoflife.date (yes, no, or ? when endoflife.date doesn't list the cycle), for tools whose registry entry names a product. --format json also has the state of LATEST's cycle. VULNS counts the OSV vulnerabilities of CURRENT, and how many of them upgrading to LATEST fixes; 0 means OSV has none. A pin OSV wasn't asked about shows ?, and the list after the notes gives the reason: no-advisory-source, private-source, not-exact, unresolved, offline or failed. --format json lists them in unchecked. Both sources are cached for a day. When one is down, relgap warns and prints the rest.
A pin with a vulnerability gets a fix target, listed under "Fix targets" and as fix in --format json: the lowest stable release above CURRENT that every advisory with a fix has left behind, checked against OSV, and the same within CURRENT's line. An advisory the latest release still has is one no release fixes, and relgap warns when the latest release has any.
Config vulns.ignore and OpenVEX documents in vulns.vex or --vex suppress advisories the way 'relgap audit' says: VULNS and --fail-on vuln leave them out, and the "Suppressed" list and suppressed in --format json give the reason.
--kev (config vulns.kev) marks the advisories whose CVE is in the CISA Known Exploited Vulnerabilities catalog, which relgap fetches from www.cisa.gov once a day: VULNS counts them as "1 KEV", and --format json and SARIF have kev with the date CISA added it. --epss (config vulns.epss) adds each advisory's FIRST EPSS score, the probability of exploitation in the next 30 days, from api.first.org, to --format json and SARIF. Advisories in the catalog sort first, then by severity and EPSS score. When a feed is down, relgap warns and prints the rest.
--binaries also reads the Go build info of each pinned tool's installed executables (on PATH and in mise's installs directory) and lists the OSV vulnerabilities of the Go version and main module they were built with, suppressed and marked the same way. Like govulncheck's binary mode, minus the check that the binary calls the vulnerable code.
--format sarif writes a SARIF 2.1.0 log for GitHub code scanning, located at each pin's file and line: a result per pin behind latest (outdated), per pin on an EOL cycle (eol), per upgrade with breaking changes or deprecations (breaking, deprecation), per advisory that affects a pin (one rule per OSV ID), per pin or file that failed (failed), and per pin not checked for vulnerabilities (unchecked, a note). The results don't depend on --fail-on.
--fail-on takes breaking, deprecation, eol, vuln, outdated and kev. Each value counts findings: outdated counts the pins further behind than --max-behind (major:N, minor:N, patch:N, releases:N or days:N; empty means any pin behind latest), breaking and deprecation count the pins whose digest has such an entry, eol counts the pins on an EOL cycle, and vuln counts the advisories that affect a pin at or above --vuln-severity or of unknown severity, and with --vuln-fixable only those with a fixed version above CURRENT. kev counts the advisories in the KEV catalog, whatever their severity, and needs --kev. A value whose count reaches --min-count (default 1) exits 3. Otherwise a tool or file that failed exits 1, and so does an endoflife.date outage under --fail-on eol, an OSV outage under --fail-on vuln or a KEV outage under --fail-on kev, since a pass on partial data proves nothing.
Usage
relgap outdated [path] [flags]Arguments
| Argument | Required | Repeatable |
|---|---|---|
path | no | no |
Flags
| Flag | Description | Type | Default | Values | Config key | Notes |
|---|---|---|---|---|---|---|
--binaries | also check the Go version and main module of the pinned tools' installed executables against OSV | bool | ||||
--epss | add each advisory's FIRST EPSS score, asking api.first.org about its CVE IDs (config vulns.epss) | bool | vulns.epss | |||
--fail-on | exit 3 when this matches: breaking, deprecation, eol, vuln, outdated or kev; repeatable (config policy.fail_on) | list, repeatable | breaking: a breaking change in the rangedeprecation: a deprecation in the rangeeol: a pinned version past its end of lifevuln: a known vulnerability in a pinned versionoutdated: a pin further behind than --max-behindkev: a known vulnerability in the CISA KEV catalog; needs --kev | policy.fail_on | ||
--kev | mark advisories in the CISA Known Exploited Vulnerabilities catalog, fetched from www.cisa.gov (config vulns.kev) | bool | vulns.kev | |||
--max-behind | how far behind --fail-on outdated allows, such as minor:2, releases:10 or days:90 (config policy.max_behind) | string | major:1: at most one major version behindminor:2: at most two minor versions behindpatch:5: at most five patch versions behindreleases:10: at most ten releases behinddays:90: the first newer release is at most 90 days old | policy.max_behind | ||
--md-max-chars | cut Markdown output to this many characters at a row or section boundary; 0 means no limit | int | 60000 | |||
--min-count | findings a --fail-on value needs before it exits 3 | int | 1 | |||
--out | also write the report to a file as format=path (repeatable); format is one of plain, md, json, sarif or github | string, repeatable | plain: table without colormd: Markdownjson: JSON envelope for scriptssarif: SARIF 2.1.0 for code scanninggithub: GitHub Actions annotations | |||
--vex | OpenVEX v0.2.0 document whose not_affected and fixed statements suppress advisories; repeatable; replaces config vulns.vex | list, repeatable | vulns.vex | |||
--vuln-fixable | --fail-on vuln counts only advisories with a fixed version above the pinned one (config policy.vuln_fixable) | bool | policy.vuln_fixable | |||
--vuln-severity | lowest rating --fail-on vuln counts: low, medium, high or critical; an unknown rating always counts, and empty counts all (config policy.vuln_severity) | string | low: CVSS 0.1 to 3.9medium: CVSS 4.0 to 6.9high: CVSS 7.0 to 8.9critical: CVSS 9.0 to 10.0 | policy.vuln_severity |
The global flags work with every command.
Output formats
--format accepts tty, plain, md, json, sarif, github. Without it, the format is tty when stdout is a terminal and plain otherwise. Formats are described on the global flags page.
Fail-on values
--fail-on makes the command exit 3 when the report has a match:
| Value | Matches |
|---|---|
breaking | a breaking change in the range |
deprecation | a deprecation in the range |
eol | a pinned version past its end of life |
vuln | a known vulnerability in a pinned version |
outdated | a pin further behind than --max-behind |
kev | a known vulnerability in the CISA KEV catalog; needs --kev |
Exit codes
| Code | Meaning |
|---|---|
| 0 | The command finished. With --fail-on, nothing matched. |
| 1 | The command failed: a read, a write, a child process or a check failed. |
| 2 | Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal. |
| 3 | A --fail-on gate matched. The report is still written. |
| 4 | Credentials were missing or rejected for every source the command needed. |
| 130 | Interrupted by Ctrl-C (SIGINT) or a cancelled context. |
All codes are listed on the exit codes page.
Examples
relgap outdated
relgap outdated ~/src/infra --format md
relgap outdated --fail-on outdated --max-behind minor:2
relgap outdated --fail-on eol --fail-on vuln --vuln-severity high
relgap outdated --kev --epss --fail-on kev
relgap outdated --fail-on outdated --min-count 5 --format sarif > relgap.sarif
relgap outdated --binaries --format json | jq '.data.binaries[]'
relgap outdated --format json | jq '.data.pins[] | select(.status == "outdated")'