Skip to main content
By the end of this guide, a pull request fails when your Go code calls a known-vulnerable function or a frontend depends on a package with a high or critical advisory. When an advisory has no fix and cannot reach your code, you accept that one advisory in forge.yaml with a reason and an expiry date, and the gate fails again on that date. reliant forge ci vuln-scan runs govulncheck over every Go module in the project and npm audit in every frontend, then makes the pass or fail decision itself, so it can honor reviewed exemptions that neither scanner supports on its own.

Before you begin

1

Run the scan the way CI does

The gate runs the scan as two rows, vuln-go and vuln-npm, and builds govulncheck at forge’s pinned version on first use:
terminal
These rows are never served from the gate’s verdict cache, because advisories change daily. To run the command on its own, put govulncheck on your PATH first. Without it the command refuses rather than report a pass it did not check:
terminal
reliant forge tools pins prints the govulncheck version the gate uses.
2

Fix a Go finding

govulncheck fails only on advisories your code calls, not on every vulnerable module in go.sum. A package that parses YAML with an old gopkg.in/yaml.v2:
Upgrade the module and scan again:
terminal
Every Go module is scanned, including nested ones such as gen/. --root-module limits it to the root.
3

Read an npm finding

npm audit fails on high and critical advisories and prints lower ones without failing. The scaffolded frontend of a forge v1.6.1 project reports a real one:
The first line is an exemption the scaffold wrote that no longer matches anything, so delete it. Upgrade the package when a fixed release exists, or use an npm overrides entry when only a transitive dependency has the fix. Here the fix is zod 4, a new major that changes the generated forms. Frontends scaffolded by forge v1.8.0 or later already use zod 4, and its upgrade notes cover porting existing forms.
4

Accept one advisory with an expiry date

Until you can upgrade, accept the advisory by its ID. Each entry needs a reason and an expires date:
forge.yaml
Use the ID the scanner printed: GO-YYYY-NNNN for govulncheck, GHSA-… for npm audit. One list serves both scanners. An entry accepts that one advisory only, so a new advisory in the same package still fails.
5

Verify the exemption and its expiry

terminal
An exemption is honored through the end of its expires date. The day after, the same run fails:
An entry with no expires, or an ID neither scanner uses, is not honored either and fails the gate.
6

Scan the container image

Image scanning is not part of reliant forge ci vuln-scan. The generated workflows run Trivy: ci.yml’s docker-build job scans the images it builds on a pull request, and build-images.yml scans the pushed image on main, both failing on HIGH,CRITICAL. To run the same scan locally:
terminal
No findings, but note the warning: the scaffolded Dockerfile’s runtime stage is alpine:3.21, which no longer gets security data. The Dockerfile is yours, so move its FROM alpine:3.21 lines to a supported release.

Choose the scanners

ci.vuln_scan in forge.yaml takes go, npm and docker (Trivy). Leave all three unset to run every scanner that applies. Setting one to true selects only the ones you set. Listing exemptions never turns a scanner off. The workflows are written once, so docker changes the Trivy steps only when a workflow is scaffolded; edit the workflow directly afterwards.

What this does not do

  • Exemptions cover govulncheck and npm audit only. Trivy findings in the workflows are not read from forge.yaml. Trivy’s own ignore file is the place for those.
  • npm advisories below high do not fail the scan. They are printed.
  • No scanning of your own code. These scanners check dependencies against advisory databases. Secret scanning is the gitleaks pre-commit hook described in the security model.
  • No automatic fixes. Dependabot’s weekly grouped bumps, configured in .github/dependabot.yml, open pull requests; the scan does not change files.
  • The image scan needs a build. It runs in GitHub Actions or wherever you run Docker, not in task ci.

Next steps

Gate pull requests

Run the whole gate, lint and tests included, locally and on every pull request.

Security model

Image signing, SBOMs, fail-closed auth and secret handling.

vuln-scan reference

Every flag of reliant forge ci vuln-scan.

What forge lint checks

The other half of the gate’s static checks.