penthera 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -3
- package/README.md +151 -249
- package/SECURITY.md +28 -6
- package/docs/compliance-nis2.md +166 -0
- package/docs/examples/github-actions-scan.yml +55 -0
- package/docs/index.md +4 -3
- package/lib/compliance/readiness.js +16 -4
- package/lib/injections.js +103 -34
- package/lib/machine.js +39 -5
- package/lib/nuclei-loader.js +56 -5
- package/lib/retirejs.js +36 -12
- package/lib/templates.js +32 -5
- package/lib/whitebox/secrets.js +49 -19
- package/package.json +7 -9
- package/skills/penthera/SKILL.md +2 -2
- package/skills/penthera/references/output-and-ci.md +12 -50
- package/skills/penthera/references/troubleshooting.md +1 -1
- package/skills/penthera/scripts/preflight.sh +4 -4
- package/src/cli/baseline.js +6 -3
- package/src/cli/merge-results.js +3 -1
- package/src/cli.js +1 -1
- package/src/reporter.js +10 -1
- package/src/scan-url.js +22 -1
- package/scripts/package-skill.sh +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,106 @@ All notable changes to Penthera are documented here. Versioning follows [SemVer]
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.2.0] - 2026-10-19
|
|
8
|
+
|
|
9
|
+
The first step toward securing the AI toolchain itself: catch AI provider keys,
|
|
10
|
+
harden Penthera's own supply chain, and make CI test what it says it tests. The
|
|
11
|
+
[roadmap](ROADMAP.md) now sets out the AI supply-chain and local agent-loop
|
|
12
|
+
tracks.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **AI provider key detection** in repo scans: Anthropic, OpenAI project and
|
|
17
|
+
service-account keys, OpenRouter, Google (Gemini / Firebase), Groq, Hugging
|
|
18
|
+
Face, Replicate, xAI, Perplexity, LangSmith, and Pinecone. Jupyter notebooks
|
|
19
|
+
(`.ipynb`) are now scanned too. A provider key inside an `api_key = "..."`
|
|
20
|
+
assignment is reported once, under its provider, instead of twice
|
|
21
|
+
- `findSecretsInText()` exported from `lib/whitebox/secrets.js`, so the same
|
|
22
|
+
rules can run on any text (groundwork for scanning JS bundles)
|
|
23
|
+
- CodeQL and OpenSSF Scorecard workflows, Dependabot for npm and GitHub Actions
|
|
24
|
+
(with a 7-day cooldown before adopting new releases)
|
|
25
|
+
- CI check that `package.json`, the lockfile, the skill, and both plugin
|
|
26
|
+
manifests carry the same version
|
|
27
|
+
- Roadmap: AI supply-chain audit (`penthera agents`), a fully local
|
|
28
|
+
scan → fix → verify → learn loop, and LLM-endpoint probes. Principles now
|
|
29
|
+
state no telemetry, no auto-push, and no remote learning
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **Modern OpenAI keys were missed.** The old pattern stopped at the hyphen in
|
|
34
|
+
`sk-proj-...` and `sk-svcacct-...`, so the key format OpenAI has issued since
|
|
35
|
+
2024 never matched
|
|
36
|
+
- The example scan workflow lived in `.github/workflows/`, so it ran on its
|
|
37
|
+
weekly cron and failed every Monday. It moved to
|
|
38
|
+
`docs/examples/github-actions-scan.yml` and now uses `npx penthera@<version>`,
|
|
39
|
+
so it works when copied into your own repo
|
|
40
|
+
- CI ran only 4 of 24 test files; it now runs the full `npm test`
|
|
41
|
+
- Removed `tests/pentest-static.test.js`, which tested functions defined inside
|
|
42
|
+
the test file rather than anything Penthera ships
|
|
43
|
+
- `.claude-plugin/plugin.json` still said 1.0.0
|
|
44
|
+
- `SECURITY.md` listed 1.0.x as supported. It now covers 1.2.x and gives response
|
|
45
|
+
times, scope, and safe-harbor terms
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- **Node.js 22 or newer is now required.** Node 18 and 20 are end-of-life, and
|
|
50
|
+
the test toolchain (vitest 5) needs 22. CI runs on Node 22 and 24
|
|
51
|
+
- GitHub Actions are pinned to commit SHAs, and every workflow declares
|
|
52
|
+
least-privilege `permissions`
|
|
53
|
+
- Releases use npm trusted publishing (OIDC, no stored token) and **staged
|
|
54
|
+
publishing**: CI stages each version, and it only goes live after a
|
|
55
|
+
maintainer approves it with 2FA. The workflow also creates the GitHub Release
|
|
56
|
+
- The Docker image runs as the unprivileged `node` user on `node:22-alpine`
|
|
57
|
+
- README reordered so install and quick start come before compliance. The full
|
|
58
|
+
NIS2 guide moved to [`docs/compliance-nis2.md`](docs/compliance-nis2.md)
|
|
59
|
+
- vitest 3 → 5 (clears 8 dev-only advisories), yaml 2.8 → 2.9
|
|
60
|
+
|
|
61
|
+
## [1.1.1] - 2026-08-16
|
|
62
|
+
|
|
63
|
+
A correctness release. One of these was a live outage: if you are on 1.1.0,
|
|
64
|
+
upgrade.
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- **JS dependency scanning was silently dead.** The Retire.js vulnerability
|
|
69
|
+
database URL pointed at a fork that now returns 404, so every scan reported
|
|
70
|
+
"no vulnerable JS libraries" without ever running the check. It now reads from
|
|
71
|
+
upstream RetireJS with a mirror, validates the payload, and when no source is
|
|
72
|
+
reachable it says the check did not run instead of returning a clean result.
|
|
73
|
+
The probe is also excluded from coverage in that case, so a compliance report
|
|
74
|
+
cannot claim supply-chain evidence that was never collected
|
|
75
|
+
- **Command injection in the machine audit.** Binary paths read from
|
|
76
|
+
attacker-writable plists were interpolated into a shell string, so a malicious
|
|
77
|
+
persistence entry could execute code inside the scanner. Paths are now argv
|
|
78
|
+
entries and signature checks use the exit status, failing closed
|
|
79
|
+
- Two built-in templates fired on any single-page app with catch-all routing:
|
|
80
|
+
the `.env.local` matcher accepted a bare `=` (present in every HTML attribute)
|
|
81
|
+
and the Firebase one accepted any 200 without the word "error", so an
|
|
82
|
+
`index.html` served at those paths was reported as critical
|
|
83
|
+
- Time-based SQL and command injection no longer report on a single slow
|
|
84
|
+
response. A candidate delay is re-sampled and only reported when the median
|
|
85
|
+
holds, which a garbage-collection pause or cold start does not survive
|
|
86
|
+
- Community template regexes ran unbounded against whole response bodies. A
|
|
87
|
+
catastrophically-backtracking pattern would hang the scanner; patterns with
|
|
88
|
+
nested quantifiers are now refused and input is capped
|
|
89
|
+
- Dedupe and baseline comparison used different keys that included severity, so
|
|
90
|
+
re-rating a finding reported it as one resolved plus one new. Both now share
|
|
91
|
+
the audit loop's fingerprint
|
|
92
|
+
- A measure with nothing scanned and nothing attested was scored as a gap,
|
|
93
|
+
telling an entity that had not yet filled in the self-assessment that it had
|
|
94
|
+
failed. That state is now reported as not assessed
|
|
95
|
+
- The XSS canary was a fixed, fingerprintable string; it is now randomised per
|
|
96
|
+
probe
|
|
97
|
+
- XProtect staleness was computed and discarded; it is now reported
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- The Nuclei loader documents the subset it actually implements and reports per
|
|
102
|
+
template which unsupported features it needs, instead of letting a template
|
|
103
|
+
that cannot match look like a clean pass
|
|
104
|
+
- Provenance (confidence, method, collection time) now travels into SARIF, and
|
|
105
|
+
the terminal marks findings a scanner cannot adjudicate
|
|
106
|
+
|
|
7
107
|
## [1.1.0] - 2026-08-16
|
|
8
108
|
|
|
9
109
|
NIS2 / Cyberbeveiligingswet readiness work: a hardening pass over the
|
|
@@ -130,7 +230,7 @@ and generated documents.
|
|
|
130
230
|
live integration tests report as skipped (not passed) without a running target
|
|
131
231
|
- Corrected the built-in template count (14, not 17) in docs and progress output
|
|
132
232
|
|
|
133
|
-
## [1.0.0]
|
|
233
|
+
## [1.0.0] - 2026-06-30
|
|
134
234
|
|
|
135
235
|
First production-ready release.
|
|
136
236
|
|
|
@@ -155,14 +255,15 @@ First production-ready release.
|
|
|
155
255
|
|
|
156
256
|
- URL trailing-slash normalization (double-slash 404 bug)
|
|
157
257
|
|
|
158
|
-
## [0.2.0]
|
|
258
|
+
## [0.2.0] - 2026-04
|
|
159
259
|
|
|
160
260
|
- Markdown reports, scan profiles, auth tooling, expanded API discovery
|
|
161
261
|
|
|
162
|
-
## [0.1.x]
|
|
262
|
+
## [0.1.x] - 2026-04
|
|
163
263
|
|
|
164
264
|
- Initial CLI: URL, repo, and machine scan modes
|
|
165
265
|
- Built-in templates, TLS, CORS, SARIF export
|
|
166
266
|
|
|
267
|
+
[1.1.1]: https://github.com/danoszz/penthera/compare/v1.1.0...v1.1.1
|
|
167
268
|
[1.1.0]: https://github.com/danoszz/penthera/compare/v1.0.0...v1.1.0
|
|
168
269
|
[1.0.0]: https://github.com/danoszz/penthera/compare/v0.2.0...v1.0.0
|
package/README.md
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
<br/><br/>
|
|
6
6
|
|
|
7
|
-
](https://www.npmjs.com/package/penthera)
|
|
8
|
+

|
|
9
9
|

|
|
10
10
|
[](https://github.com/danoszz/penthera/actions/workflows/ci.yml)
|
|
11
|
+
[](https://scorecard.dev/viewer/?uri=github.com/danoszz/penthera)
|
|
11
12
|
|
|
12
13
|
<br/>
|
|
13
14
|
|
|
@@ -33,7 +34,8 @@ issues." The agent picks the scan, runs it, and gives you the fixes.
|
|
|
33
34
|
You shipped something fast: vibecoded, AI-assisted, already live. The same models
|
|
34
35
|
that helped you build it also make it easy for someone to probe it. Exposed API
|
|
35
36
|
routes, missing security headers, weak auth, a hardcoded key in the repo. These
|
|
36
|
-
are the common mistakes that get apps broken into.
|
|
37
|
+
are the common mistakes that get apps broken into. An AI provider key in the
|
|
38
|
+
frontend bundle is the newest and most expensive of them.
|
|
37
39
|
|
|
38
40
|
Penthera is the check you run before you launch. Ask your agent to "scan my app
|
|
39
41
|
for security issues" and it runs an authorized, non-destructive scan, then lists
|
|
@@ -43,6 +45,34 @@ background to use it.
|
|
|
43
45
|
Penthera is for hardening systems you own. It is powerful, so please use it
|
|
44
46
|
carefully. See [Ethical use](#ethical-use--authorization) and the [Disclaimer](#disclaimer).
|
|
45
47
|
|
|
48
|
+
Shipping in the EU? Penthera also generates your
|
|
49
|
+
[NIS2 readiness report, policy pack, incident-report drafts, SBOM, and prefilled
|
|
50
|
+
customer security questionnaires](#compliance-nis2-and-the-cyberwetgeving).
|
|
51
|
+
Offline, no accounts. Readiness tooling, not a certification.
|
|
52
|
+
|
|
53
|
+
### What you get
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Findings
|
|
57
|
+
|
|
58
|
+
HIGH IDOR/BOLA: GET /api/users/{user_id}
|
|
59
|
+
http://localhost:3000/api/users/1 → 200
|
|
60
|
+
HIGH OAuth open redirect
|
|
61
|
+
http://localhost:3000/api/oauth/callback?redirect_uri=... → 302
|
|
62
|
+
MED Missing Content-Security-Policy
|
|
63
|
+
MED No login rate limiting detected
|
|
64
|
+
http://localhost:3000/api/login → 401
|
|
65
|
+
LOW Missing X-Frame-Options
|
|
66
|
+
INFO Missing Referrer-Policy
|
|
67
|
+
|
|
68
|
+
──────────────────────────────────────────────────────────
|
|
69
|
+
2 high · 5 medium · 2 low · 2 info
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Every finding carries a confidence label (`confirmed`, `likely`, `potential`,
|
|
73
|
+
`needs-human-review`), so a heuristic never poses as a certainty. Reports come
|
|
74
|
+
out as Markdown, JSON, and SARIF, with the fixes in priority order.
|
|
75
|
+
|
|
46
76
|
---
|
|
47
77
|
|
|
48
78
|
## Run it
|
|
@@ -68,6 +98,12 @@ Then talk to your agent:
|
|
|
68
98
|
"Find hardcoded secrets in this repo before I push"
|
|
69
99
|
```
|
|
70
100
|
|
|
101
|
+
**Or try it with no install at all:**
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx penthera https://your-app.example
|
|
105
|
+
```
|
|
106
|
+
|
|
71
107
|
Prefer the terminal? Run `penthera` with no arguments for a guided wizard.
|
|
72
108
|
|
|
73
109
|
> The skill adds an authorization gate: it instructs your agent to refuse targets
|
|
@@ -80,7 +116,7 @@ Prefer the terminal? Run `penthera` with no arguments for a guided wizard.
|
|
|
80
116
|
| Mode | Command | Coverage |
|
|
81
117
|
|------|---------|----------|
|
|
82
118
|
| **URL scan** | `penthera https://example.com` | TLS, fingerprinting, endpoint discovery, templates, CORS, cookies, JS CVEs, param discovery, OpenAPI/FastAPI probes, security headers, auth hardening |
|
|
83
|
-
| **Repo scan** | `penthera --repo ./my-app` | API route discovery (Next.js, Express, Hono, Fastify), trust-boundary mapping, hardcoded-secret scanning |
|
|
119
|
+
| **Repo scan** | `penthera --repo ./my-app` | API route discovery (Next.js, Express, Hono, Fastify), trust-boundary mapping, hardcoded-secret scanning (including Anthropic, OpenAI, Gemini, Groq, Hugging Face and other AI provider keys) |
|
|
84
120
|
| **Combined** | `penthera https://staging.app --repo .` | Black-box and white-box in one run |
|
|
85
121
|
| **Interactive** | `penthera` *(no args)* | Guided wizard (URL plus optional repo scan, Markdown report) |
|
|
86
122
|
| **Machine audit** | `penthera --machine` | macOS checks (keyloggers, persistence, rootkits) |
|
|
@@ -123,245 +159,6 @@ Findings map to the [OWASP Web Security Testing Guide](docs/owasp-wstg-coverage.
|
|
|
123
159
|
|
|
124
160
|
---
|
|
125
161
|
|
|
126
|
-
## Compliance: NIS2 and the cyberwetgeving
|
|
127
|
-
|
|
128
|
-
The EU NIS2 directive and its national transpositions (the Cyberbeveiligingswet
|
|
129
|
-
in the Netherlands, the NIS2-wet in Belgium) put a duty of care, the *zorgplicht*,
|
|
130
|
-
on in-scope organisations. That duty is the set of risk-management measures in
|
|
131
|
-
Article 21(2) of the directive. Most of them are organisational. Some are
|
|
132
|
-
technical and testable, and that is the part Penthera helps with.
|
|
133
|
-
|
|
134
|
-
Penthera does not make you compliant and does not certify anything. What it gives
|
|
135
|
-
you is automated, repeatable technical evidence for the measures a scanner can
|
|
136
|
-
honestly verify: the kind of artefact you can attach to a risk file, show an
|
|
137
|
-
auditor, or run in CI so a regression shows up before it ships.
|
|
138
|
-
|
|
139
|
-
| Art. 21(2) measure | What Penthera does | Coverage |
|
|
140
|
-
|--------------------|--------------------|----------|
|
|
141
|
-
| **(a)** Risk analysis & information-security policy | Findings, severity, and baseline history feed your risk analysis | Evidence |
|
|
142
|
-
| **(b)** Incident handling | Report scaffolding (on the roadmap) | Planned |
|
|
143
|
-
| **(c)** Business continuity, backup, crisis management | Organisational; outside a scanner's reach | Out of scope |
|
|
144
|
-
| **(d)** Supply-chain security | Known-CVE checks on JS dependencies (Retire.js); leaked third-party credentials (secret scan) | Partial |
|
|
145
|
-
| **(e)** Security in acquisition, development & maintenance; **vulnerability handling** | The core: black- + white-box scanning mapped to OWASP WSTG, SARIF → GitHub, baseline regression, scan-and-fix loop | **Strong** |
|
|
146
|
-
| **(f)** Assessing the effectiveness of measures | Baseline diff + re-scan-to-verify is a repeatable effectiveness check | Partial |
|
|
147
|
-
| **(g)** Cyber hygiene & training | Remediation playbook + secure-defaults guidance (guidance, not a training programme) | Partial |
|
|
148
|
-
| **(h)** Cryptography & encryption | TLS protocol/cipher/certificate audit, HSTS, cookie `Secure` (transport layer only) | Partial |
|
|
149
|
-
| **(i)** HR security, **access control**, asset management | Access control tested: JWT, IDOR/BOLA, OAuth redirect, client-side-auth, trust-boundary mapping | Partial |
|
|
150
|
-
| **(j)** Multi-factor authentication & secure communications | MFA probe (on the roadmap) | Planned |
|
|
151
|
-
|
|
152
|
-
**Coverage key:** *Strong* = automated technical testing · *Partial* = part of the
|
|
153
|
-
measure · *Evidence* = output feeds the measure, no direct test · *Planned* = on the
|
|
154
|
-
roadmap · *Out of scope* = organisational or physical.
|
|
155
|
-
|
|
156
|
-
In practice, Penthera today gives you solid automated evidence for the
|
|
157
|
-
secure-development and vulnerability-handling duty (e), which is the technical
|
|
158
|
-
heart of the zorgplicht, plus meaningful coverage of supply chain (d),
|
|
159
|
-
cryptography in transit (h), access control (i), and effectiveness testing (f).
|
|
160
|
-
That is not the whole duty of care, but it is a real, defensible start you can run
|
|
161
|
-
today and re-run on every deploy.
|
|
162
|
-
|
|
163
|
-
> **Not legal advice, not a certification, not a guarantee of compliance.**
|
|
164
|
-
> Penthera automates the technical-testing part of the duty of care. The
|
|
165
|
-
> directive's organisational duties (governance, risk-management policy,
|
|
166
|
-
> incident-notification processes, supply-chain contracts, staff training) need
|
|
167
|
-
> human process and, where it matters, review by a qualified advisor. For an
|
|
168
|
-
> authoritative reading, consult your national authority (the NCSC in the
|
|
169
|
-
> Netherlands, the CCB and its CyFun framework in Belgium) or a specialised jurist.
|
|
170
|
-
|
|
171
|
-
Generate this mapping for your own scan with `--framework nis2`. It adds a
|
|
172
|
-
per-run coverage table (which measures *this* scan actually exercised, driven by
|
|
173
|
-
the probes that ran) to the terminal, Markdown, and JSON reports:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
penthera https://myapp.com --framework nis2 -o reports/scan.json
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### Readiness report (clone → report in two commands)
|
|
180
|
-
|
|
181
|
-
Go further than the mapping: combine the scan with a short offline
|
|
182
|
-
self-assessment (the organisational measures a scanner can't test, like policies,
|
|
183
|
-
backups, training, and MFA) into a full NIS2 readiness report. Every Article 21
|
|
184
|
-
measure is marked `met / partial / gap / n-a`, with proportionality notes, your
|
|
185
|
-
incident-reporting deadlines, and provenance on every piece of evidence.
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
# 1. Create your self-assessment (offline, one-time). Fill in yes | partial | no | na.
|
|
189
|
-
penthera --assessment-init assessment.json
|
|
190
|
-
|
|
191
|
-
# 2. Scan + self-assessment → readiness report (writes reports/scan-readiness.md)
|
|
192
|
-
penthera https://myapp.com --repo . --readiness --assessment assessment.json -o reports/scan.json
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
The readiness report is **evidence and self-assessment tooling, not a
|
|
196
|
-
certification**. It is provenance-linked (`source, method, collected_at,
|
|
197
|
-
confidence`) and reproducible, and it lists exactly what only you can attest to.
|
|
198
|
-
Jurisdiction specifics live in `lib/jurisdictions/nl.json` (NL today; BE and
|
|
199
|
-
others are just added config).
|
|
200
|
-
|
|
201
|
-
### Answer a customer's security questionnaire
|
|
202
|
-
|
|
203
|
-
The questionnaire blocking your deal, drafted from evidence you already have:
|
|
204
|
-
|
|
205
|
-
```bash
|
|
206
|
-
# one question per line, pasted from the customer's form
|
|
207
|
-
penthera https://myapp.com --readiness --assessment assessment.json --questionnaire questions.txt
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
Each question is mapped to the Article 21 measure it belongs to and answered
|
|
211
|
-
from the scan and your self-assessment, with the backing evidence cited.
|
|
212
|
-
Anything Penthera can't map is marked `NEEDS HUMAN INPUT` instead of guessed.
|
|
213
|
-
Review every answer before you send it.
|
|
214
|
-
|
|
215
|
-
### Policy pack
|
|
216
|
-
|
|
217
|
-
Generate the proportionate written policies NIS2 expects, pre-filled from your
|
|
218
|
-
readiness gaps and the NL incident deadlines:
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
penthera --policy-pack ./policies --org "Your Company" --readiness --assessment assessment.json
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
Writes editable Markdown starting points: information security, access control,
|
|
225
|
-
incident response, backup/continuity, acceptable use, supplier security, and
|
|
226
|
-
vulnerability management. **Templates, not legal advice.** Keep them short and
|
|
227
|
-
used. A two-page policy that genuinely exists is what "proportionate" means.
|
|
228
|
-
|
|
229
|
-
### Incident-report helper
|
|
230
|
-
|
|
231
|
-
NIS2 has hard reporting deadlines (24h early warning, 72h notification, 1-month
|
|
232
|
-
final report). If something happens, get the timeline and draft reports:
|
|
233
|
-
|
|
234
|
-
```bash
|
|
235
|
-
penthera --incident-init incident.json # fill in what happened (set aware_at)
|
|
236
|
-
penthera --incident incident.json # writes incident-reports.md
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
It computes your three deadlines from when you became aware, flags anything
|
|
240
|
-
overdue, and drafts the early-warning, notification, and final report against
|
|
241
|
-
the required content, with `NEEDS INPUT` where you still have to fill in facts.
|
|
242
|
-
**These are drafts to help you meet the deadlines, not a substitute for your
|
|
243
|
-
authority's official form.**
|
|
244
|
-
|
|
245
|
-
### Software bill of materials (SBOM)
|
|
246
|
-
|
|
247
|
-
Emit a standard CycloneDX SBOM of your dependencies. It's what enterprises
|
|
248
|
-
increasingly require of suppliers, and direct evidence for supply-chain security
|
|
249
|
-
(measure d):
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
penthera --repo . --sbom sbom.cdx.json
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Parses `package-lock.json` / `package.json` / `requirements.txt` offline (no
|
|
256
|
-
network), with resolved versions and package URLs (purls).
|
|
257
|
-
|
|
258
|
-
### Remediation tracking (the audit loop)
|
|
259
|
-
|
|
260
|
-
Closing findings matters more than finding them. Track them over time:
|
|
261
|
-
time-to-fix, ageing of open items, and what changed since the last scan (evidence
|
|
262
|
-
for measure f, effectiveness):
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
penthera https://myapp.com --history reports/history.json -o reports/scan.json
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
Each run folds the current findings into a small history keyed by a **stable
|
|
269
|
-
fingerprint** (so a re-worded or re-counted finding isn't mistaken for a new
|
|
270
|
-
one), then reports open vs resolved, median time-to-fix, and ageing buckets.
|
|
271
|
-
Re-run on a cadence to watch the trend.
|
|
272
|
-
|
|
273
|
-
### Supplier rating (passive)
|
|
274
|
-
|
|
275
|
-
Assess your suppliers' public security posture for supply-chain risk (measure d):
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
printf 'supplier1.com\nsupplier2.com\n' > suppliers.txt
|
|
279
|
-
penthera --suppliers suppliers.txt
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
**Strictly passive and public-data-only.** One homepage GET (security headers),
|
|
283
|
-
a TLS handshake (certificate), and public DNS lookups (SPF/DMARC/MX) per domain.
|
|
284
|
-
No endpoint discovery, no auth probes, no intrusive testing. You get a
|
|
285
|
-
red/amber/green rating per supplier. It's a screening aid for your own vendor
|
|
286
|
-
risk assessment, **not** an authorised penetration test of the supplier.
|
|
287
|
-
|
|
288
|
-
Because the mapping targets the NIS2 directive itself, it applies across the
|
|
289
|
-
national transpositions; jurisdiction-specific profiles (NL, BE) are on the roadmap.
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
## Ethical use & authorization
|
|
294
|
-
|
|
295
|
-
Penthera sends HTTP requests to the targets you give it. Some modes (`--deep`,
|
|
296
|
-
`--fuzz`, `--all`) send attack payloads designed to find vulnerabilities. Use it
|
|
297
|
-
responsibly.
|
|
298
|
-
|
|
299
|
-
**You may use Penthera when:**
|
|
300
|
-
|
|
301
|
-
- You **own** the target (your app, your server, your project).
|
|
302
|
-
- You have **written authorization** from the system owner (email, ticket, signed scope).
|
|
303
|
-
- You scan **localhost** or private lab environments you control.
|
|
304
|
-
- You use it for **defensive security**: research, coursework, CI hardening, pre-release audits.
|
|
305
|
-
|
|
306
|
-
**You must not use Penthera to:**
|
|
307
|
-
|
|
308
|
-
- Scan systems you do not own or lack explicit permission to test.
|
|
309
|
-
- Probe government, healthcare, financial, or third-party production systems without authorization.
|
|
310
|
-
- Exfiltrate data, disrupt services, or bypass access controls.
|
|
311
|
-
- Use findings to attack, extort, or harm anyone.
|
|
312
|
-
|
|
313
|
-
> Before scanning any URL that is not localhost, confirm you have permission.
|
|
314
|
-
> **When in doubt, do not scan.**
|
|
315
|
-
|
|
316
|
-
Unauthorized security testing may violate computer-misuse laws (for example the US
|
|
317
|
-
CFAA, the UK Computer Misuse Act, and EU national equivalents) and can result in
|
|
318
|
-
criminal prosecution, civil liability, IP blocking, account termination, and
|
|
319
|
-
academic or professional penalties.
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## Disclaimer
|
|
324
|
-
|
|
325
|
-
Penthera is provided for legitimate security research and defensive testing of
|
|
326
|
-
systems you own or are authorized to test, and for that purpose only.
|
|
327
|
-
|
|
328
|
-
- It is a research and self-assessment tool. Scan your own apps to find and fix
|
|
329
|
-
weaknesses before attackers do.
|
|
330
|
-
- The same capabilities that harden a system can cause harm if pointed at someone
|
|
331
|
-
else's. Use it carefully and lawfully.
|
|
332
|
-
- The author does not condone unauthorized or malicious use, and accepts no
|
|
333
|
-
liability for any damage, loss, or legal consequence arising from use or misuse
|
|
334
|
-
of this software.
|
|
335
|
-
- The software is provided "as is", without warranty of any kind. See [LICENSE](LICENSE) (MIT).
|
|
336
|
-
- You are solely responsible for ensuring every scan you run is authorized and
|
|
337
|
-
legal in your jurisdiction.
|
|
338
|
-
|
|
339
|
-
By using Penthera you accept these terms.
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
## Install
|
|
344
|
-
|
|
345
|
-
The [one-line installer](#run-it) is the fastest path. To set it up manually:
|
|
346
|
-
|
|
347
|
-
```bash
|
|
348
|
-
git clone https://github.com/danoszz/penthera.git
|
|
349
|
-
cd penthera
|
|
350
|
-
npm install
|
|
351
|
-
npm link # exposes `penthera` and `penthera-scan` globally
|
|
352
|
-
penthera --version
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
Requirements: Node.js 18+ and npm. Optional: nuclei-templates for `--nuclei`, and
|
|
356
|
-
Docker. To run it in a container:
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
docker build -t penthera .
|
|
360
|
-
docker run --rm penthera https://your-app.example
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
162
|
## Quick start
|
|
366
163
|
|
|
367
164
|
```bash
|
|
@@ -476,19 +273,100 @@ Fixes come from a [remediation playbook](skills/penthera/references/remediation.
|
|
|
476
273
|
|
|
477
274
|
---
|
|
478
275
|
|
|
276
|
+
## Compliance: NIS2 and the cyberwetgeving
|
|
277
|
+
|
|
278
|
+
Shipping in the EU? NIS2 (the Cyberbeveiligingswet in the Netherlands, the
|
|
279
|
+
NIS2-wet in Belgium) puts a duty of care on in-scope organisations. Penthera
|
|
280
|
+
turns the technical, testable part of that duty into repeatable evidence, and
|
|
281
|
+
helps with the paperwork around it. Offline, no accounts.
|
|
282
|
+
|
|
283
|
+
| Command | What you get |
|
|
284
|
+
|---------|--------------|
|
|
285
|
+
| `--framework nis2` | Per-run Article 21(2) coverage table in every report |
|
|
286
|
+
| `--readiness --assessment a.json` | Full readiness report: every measure marked met / partial / gap |
|
|
287
|
+
| `--questionnaire questions.txt` | Customer security questionnaire drafted from your evidence |
|
|
288
|
+
| `--policy-pack ./policies` | Proportionate policy templates, prefilled from your gaps |
|
|
289
|
+
| `--incident incident.json` | 24h / 72h / 1-month incident report drafts and deadlines |
|
|
290
|
+
| `--sbom sbom.cdx.json` | CycloneDX software bill of materials |
|
|
291
|
+
| `--history history.json` | Time-to-fix, ageing, and drift across scans |
|
|
292
|
+
| `--suppliers suppliers.txt` | Passive red/amber/green rating of your suppliers |
|
|
293
|
+
|
|
294
|
+
**Full guide, the measure-by-measure coverage table, and the limits:**
|
|
295
|
+
[docs/compliance-nis2.md](docs/compliance-nis2.md).
|
|
296
|
+
|
|
297
|
+
> Readiness tooling, not a certification and not legal advice.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
479
301
|
## CI integration
|
|
480
302
|
|
|
481
303
|
```yaml
|
|
482
304
|
# Scan a staging URL on a schedule and upload results to GitHub Security.
|
|
483
|
-
|
|
484
|
-
-
|
|
485
|
-
- uses: github/codeql-action/upload-sarif@v3
|
|
305
|
+
- run: npx penthera@1.2.0 "$PENTEST_URL" --profile standard --sarif reports/scan.sarif
|
|
306
|
+
- uses: github/codeql-action/upload-sarif@v4
|
|
486
307
|
with:
|
|
487
308
|
sarif_file: reports/scan.sarif
|
|
488
309
|
```
|
|
489
310
|
|
|
490
|
-
|
|
491
|
-
|
|
311
|
+
Copy the full workflow from
|
|
312
|
+
[`docs/examples/github-actions-scan.yml`](docs/examples/github-actions-scan.yml)
|
|
313
|
+
into your app's repo. Pin the Penthera version so a scheduled run never picks up
|
|
314
|
+
code you have not reviewed.
|
|
315
|
+
|
|
316
|
+
Penthera's own CI runs the full test suite on Node 22 and 24, self-scans a mock
|
|
317
|
+
vulnerable API on every push, and runs CodeQL and OpenSSF Scorecard.
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Ethical use & authorization
|
|
322
|
+
|
|
323
|
+
Penthera sends HTTP requests to the targets you give it. Some modes (`--deep`,
|
|
324
|
+
`--fuzz`, `--all`) send attack payloads designed to find vulnerabilities. Use it
|
|
325
|
+
responsibly.
|
|
326
|
+
|
|
327
|
+
**You may use Penthera when:**
|
|
328
|
+
|
|
329
|
+
- You **own** the target (your app, your server, your project).
|
|
330
|
+
- You have **written authorization** from the system owner (email, ticket, signed scope).
|
|
331
|
+
- You scan **localhost** or private lab environments you control.
|
|
332
|
+
- You use it for **defensive security**: research, coursework, CI hardening, pre-release audits.
|
|
333
|
+
|
|
334
|
+
**You must not use Penthera to:**
|
|
335
|
+
|
|
336
|
+
- Scan systems you do not own or lack explicit permission to test.
|
|
337
|
+
- Probe government, healthcare, financial, or third-party production systems without authorization.
|
|
338
|
+
- Exfiltrate data, disrupt services, or bypass access controls.
|
|
339
|
+
- Use findings to attack, extort, or harm anyone.
|
|
340
|
+
|
|
341
|
+
> Before scanning any URL that is not localhost, confirm you have permission.
|
|
342
|
+
> **When in doubt, do not scan.**
|
|
343
|
+
|
|
344
|
+
Unauthorized security testing may violate computer-misuse laws (for example the US
|
|
345
|
+
CFAA, the UK Computer Misuse Act, and EU national equivalents) and can result in
|
|
346
|
+
criminal prosecution, civil liability, IP blocking, account termination, and
|
|
347
|
+
academic or professional penalties.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Install
|
|
352
|
+
|
|
353
|
+
The [one-line installer](#run-it) is the fastest path. To set it up manually:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
git clone https://github.com/danoszz/penthera.git
|
|
357
|
+
cd penthera
|
|
358
|
+
npm install
|
|
359
|
+
npm link # exposes `penthera` and `penthera-scan` globally
|
|
360
|
+
penthera --version
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Requirements: Node.js 22+ and npm. Optional: nuclei-templates for `--nuclei`, and
|
|
364
|
+
Docker. To run it in a container:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
docker build -t penthera .
|
|
368
|
+
docker run --rm penthera https://your-app.example
|
|
369
|
+
```
|
|
492
370
|
|
|
493
371
|
---
|
|
494
372
|
|
|
@@ -513,6 +391,10 @@ npm run pentest:mock # offline tests against a local mock vuln API
|
|
|
513
391
|
npm run mock-server # start the mock API on port 8765
|
|
514
392
|
```
|
|
515
393
|
|
|
394
|
+
See the [roadmap](ROADMAP.md) for what is next, including auditing the skills,
|
|
395
|
+
MCP servers, and plugins in your AI toolchain, and what is deliberately not
|
|
396
|
+
planned.
|
|
397
|
+
|
|
516
398
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for the project layout, how to add a probe
|
|
517
399
|
or template, the test matrix, and the release and publishing checklist.
|
|
518
400
|
|
|
@@ -520,7 +402,7 @@ or template, the test matrix, and the release and publishing checklist.
|
|
|
520
402
|
|
|
521
403
|
## Status
|
|
522
404
|
|
|
523
|
-
**v1.
|
|
405
|
+
**v1.2, production-ready.** URL, repo, and machine scanning, NIS2 readiness tooling, scan profiles,
|
|
524
406
|
Markdown, JSON, and SARIF reports, session-aware auth, JWT, IDOR, OAuth, and
|
|
525
407
|
header probes, adaptive knowledge-graph probing, a plugins and templates API,
|
|
526
408
|
Docker, CI, and the Agent Skill are all shipped. See the [CHANGELOG](CHANGELOG.md)
|
|
@@ -555,6 +437,26 @@ You are responsible for ensuring you are authorized to scan any target. See [Eth
|
|
|
555
437
|
|
|
556
438
|
---
|
|
557
439
|
|
|
440
|
+
## Disclaimer
|
|
441
|
+
|
|
442
|
+
Penthera is provided for legitimate security research and defensive testing of
|
|
443
|
+
systems you own or are authorized to test, and for that purpose only.
|
|
444
|
+
|
|
445
|
+
- It is a research and self-assessment tool. Scan your own apps to find and fix
|
|
446
|
+
weaknesses before attackers do.
|
|
447
|
+
- The same capabilities that harden a system can cause harm if pointed at someone
|
|
448
|
+
else's. Use it carefully and lawfully.
|
|
449
|
+
- The author does not condone unauthorized or malicious use, and accepts no
|
|
450
|
+
liability for any damage, loss, or legal consequence arising from use or misuse
|
|
451
|
+
of this software.
|
|
452
|
+
- The software is provided "as is", without warranty of any kind. See [LICENSE](LICENSE) (MIT).
|
|
453
|
+
- You are solely responsible for ensuring every scan you run is authorized and
|
|
454
|
+
legal in your jurisdiction.
|
|
455
|
+
|
|
456
|
+
By using Penthera you accept these terms.
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
558
460
|
## License & disclosure
|
|
559
461
|
|
|
560
462
|
MIT. See [LICENSE](LICENSE). Report vulnerabilities in Penthera itself via
|
package/SECURITY.md
CHANGED
|
@@ -2,21 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
## Supported versions
|
|
4
4
|
|
|
5
|
+
Security fixes land on the latest minor release only. Upgrade to get them.
|
|
6
|
+
|
|
5
7
|
| Version | Supported |
|
|
6
8
|
| ------- | --------- |
|
|
7
|
-
| 1.
|
|
8
|
-
| < 1.
|
|
9
|
+
| 1.2.x | Yes |
|
|
10
|
+
| < 1.2 | No |
|
|
9
11
|
|
|
10
12
|
## Reporting a vulnerability
|
|
11
13
|
|
|
12
14
|
If you find a security issue in **Penthera itself** (not a finding produced by
|
|
13
15
|
scanning a target), please report it privately:
|
|
14
16
|
|
|
15
|
-
1. Open a [GitHub Security Advisory](https://github.com/danoszz/penthera/security/advisories/new)
|
|
16
|
-
|
|
17
|
+
1. Open a [GitHub Security Advisory](https://github.com/danoszz/penthera/security/advisories/new)
|
|
18
|
+
(preferred: it keeps the report private and lets us credit you), or
|
|
19
|
+
2. Email the maintainer via the address on the [GitHub profile](https://github.com/danoszz)
|
|
20
|
+
with a clear description and reproduction steps.
|
|
21
|
+
|
|
22
|
+
Please do **not** open public issues for undisclosed vulnerabilities.
|
|
23
|
+
|
|
24
|
+
**What to expect.** Penthera is maintained part-time, but security reports come
|
|
25
|
+
first:
|
|
26
|
+
|
|
27
|
+
- Acknowledgement within 3 working days.
|
|
28
|
+
- An initial assessment (accepted, needs more info, or out of scope) within 10
|
|
29
|
+
working days.
|
|
30
|
+
- A fix or mitigation for accepted issues as fast as severity warrants, followed
|
|
31
|
+
by a release, a GitHub advisory, and credit to you unless you prefer otherwise.
|
|
32
|
+
|
|
33
|
+
**In scope:** the CLI, the scanner engine (`lib/`, `src/`), the Agent Skill
|
|
34
|
+
(`skills/penthera/`), the installer (`install.sh`), and the published npm package
|
|
35
|
+
and its build pipeline. Examples: code execution from a malicious scan target or
|
|
36
|
+
repo, a skill instruction that bypasses the authorization gate, a supply-chain
|
|
37
|
+
weakness in our release workflow.
|
|
17
38
|
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
**Safe harbor.** Good-faith research on Penthera's own code, done on your own
|
|
40
|
+
machine, is welcome and we will not pursue action against it. This does not
|
|
41
|
+
cover scanning third-party systems: the authorization rules below still apply.
|
|
20
42
|
|
|
21
43
|
## Responsible use
|
|
22
44
|
|