Penthera in CI: the GitHub Action
Pro. For “how do I put it in CI?”There are three places to run Penthera on every change: the GitHub Action on pull requests, a scan step in your own workflow, and the pre-commit hook on each developer’s machine.
The GitHub Action
mode, path, base-ref, url,
fail-on, comment, sarif, penthera-version. Copy the full workflow, with
permissions and a lockfile paths filter, from
docs/examples/pr-dependency-review.yml.
What a reviewer sees:
file:line evidence, whether or not an advisory exists yet
(penthera deps).
A scan step in your own workflow
To scan a preview URL and upload SARIF, see scan in CI and the exampledocs/examples/github-actions-scan.yml.
Pin the Penthera version, so every run is checked by the same rules, and use
--baseline to show only what is new since the last scan. penthera --repo .
and penthera deps exit 1 on high or critical findings, so either works as a
gate.
Before you cut a release
For maintainers, locally:penthera agents on
your own repo reads what your users’ tools will load.
Penthera’s own releases are a pattern you can copy: npm provenance through
trusted publishing, each version staged until a maintainer approves it with
2FA, CI actions pinned by SHA, CodeQL on every push, and a public
OpenSSF Scorecard.
See .github/workflows/publish.yml.
The same check on every project
For agencies and teams that ship many similar apps, run the same steps on each project, in CI or before handover:What it does not do
- Dependency analysis covers npm and Python. The install firewall and the
--onlineregistry checks are npm only for now. - It does not track CVEs in your dependencies. Keep Dependabot or a similar service on for that (how they fit).
- It does not watch the registry for your package being republished by someone else. Enable 2FA and trusted publishing on npm for that.
- A capability is what code can do, not proof of intent. Many good packages use the network. The diff is there so a person can look.
- It does not replace a penetration test where a contract or a regulator asks for one.
- Fix recipes cover common JavaScript and TypeScript frameworks. Other stacks get findings and guidance, not diffs.