penthera 1.4.0 → 1.6.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 +227 -0
- package/README.md +148 -575
- package/bin/scan.js +19 -0
- package/docs/commands/README.md +23 -0
- package/docs/commands/action.md +21 -0
- package/docs/commands/agents.md +38 -0
- package/docs/commands/deps.md +115 -0
- package/docs/commands/fix.md +53 -0
- package/docs/commands/hook.md +69 -0
- package/docs/commands/install.md +53 -0
- package/docs/commands/scan.md +100 -0
- package/docs/commands/skill.md +58 -0
- package/docs/compare/README.md +25 -0
- package/docs/compare/github.md +60 -0
- package/docs/compare/semgrep.md +54 -0
- package/docs/compare/snyk.md +62 -0
- package/docs/compare/socket.md +78 -0
- package/docs/compare/zap.md +59 -0
- package/docs/compliance-cra.md +141 -0
- package/docs/compliance-nis2.md +3 -1
- package/docs/dashboard.md +244 -0
- package/docs/evidence.md +8 -4
- package/docs/examples/github-actions-deps.yml +4 -4
- package/docs/examples/github-actions-scan.yml +4 -4
- package/docs/index.md +11 -2
- package/docs/internal-audit.md +83 -0
- package/docs/marketing.md +151 -0
- package/docs/plan.md +101 -0
- package/docs/privacy.md +38 -0
- package/docs/references.bib +10 -0
- package/docs/references.md +1 -0
- package/docs/research/socket-positioning-notes.md +183 -0
- package/docs/use-cases/README.md +14 -0
- package/docs/use-cases/agencies.md +71 -0
- package/docs/use-cases/ai-coding-teams.md +81 -0
- package/docs/use-cases/eu-sme-compliance.md +68 -0
- package/docs/use-cases/open-source-maintainers.md +75 -0
- package/docs/use-cases/solo-founder.md +65 -0
- package/lib/blackbox/email-dns.js +5 -0
- package/lib/compliance/cra.js +525 -0
- package/lib/compliance/questionnaire.js +4 -2
- package/lib/deps/capabilities.js +49 -12
- package/lib/deps/index.js +314 -30
- package/lib/deps/license.js +329 -0
- package/lib/deps/lockfile.js +29 -3
- package/lib/deps/popular-pypi.json +1 -0
- package/lib/deps/python/capabilities.js +447 -0
- package/lib/deps/python/index.js +234 -0
- package/lib/deps/python/lockfiles.js +359 -0
- package/lib/deps/python/source.js +396 -0
- package/lib/deps/python/toml.js +219 -0
- package/lib/deps/report.js +54 -6
- package/lib/deps/source.js +149 -24
- package/lib/deps/spdx.json +1 -0
- package/lib/deps/typosquat.js +24 -13
- package/lib/fix/apply.js +83 -19
- package/lib/hook/index.js +345 -0
- package/lib/hook/policy.js +62 -0
- package/lib/install/index.js +59 -18
- package/lib/install/policy.js +27 -7
- package/lib/jurisdictions/nl.json +9 -0
- package/lib/memory/repo-suppress.js +11 -3
- package/lib/references.json +77 -0
- package/lib/remediation/index.js +9 -0
- package/lib/retirejs.js +69 -17
- package/lib/rules/regex-guard.js +368 -0
- package/lib/templates.js +13 -6
- package/lib/tls.js +7 -0
- package/lib/whitebox/aibom.js +384 -0
- package/lib/whitebox/frameworks.js +8 -5
- package/lib/whitebox/sbom.js +45 -10
- package/lib/whitebox/secrets.js +31 -8
- package/package.json +8 -3
- package/skills/penthera/SKILL.md +55 -8
- package/src/cli/deps.js +81 -6
- package/src/cli/evidence.js +14 -4
- package/src/cli/hook.js +131 -0
- package/src/cli/install.js +14 -5
- package/src/cli/report-outputs.js +25 -2
- package/src/cli/ui.js +89 -0
- package/src/cli.js +81 -11
- package/src/report/audience.js +10 -10
- package/src/report/evidence.js +33 -14
- package/src/report/footer.js +11 -0
- package/src/report/markdown.js +6 -3
- package/src/report/md-escape.js +16 -0
- package/src/reporter.js +1 -0
- package/src/scan-url.js +5 -1
- package/src/ui/api/data.js +309 -0
- package/src/ui/api/demo.js +464 -0
- package/src/ui/api/routes.js +134 -0
- package/src/ui/api/runs.js +243 -0
- package/src/ui/api/summarize.js +451 -0
- package/src/ui/security.js +153 -0
- package/src/ui/server.js +186 -0
- package/src/ui/static/app.css +723 -0
- package/src/ui/static/favicon.svg +1 -0
- package/src/ui/static/index.html +57 -0
- package/src/ui/static/js/api.js +29 -0
- package/src/ui/static/js/app.js +138 -0
- package/src/ui/static/js/charts.js +207 -0
- package/src/ui/static/js/copy.js +79 -0
- package/src/ui/static/js/dom.js +120 -0
- package/src/ui/static/js/format.js +42 -0
- package/src/ui/static/js/theme.js +10 -0
- package/src/ui/static/js/typer.js +99 -0
- package/src/ui/static/js/views/ai.js +68 -0
- package/src/ui/static/js/views/deps.js +96 -0
- package/src/ui/static/js/views/evidence.js +115 -0
- package/src/ui/static/js/views/findings.js +165 -0
- package/src/ui/static/js/views/history.js +92 -0
- package/src/ui/static/js/views/overview.js +184 -0
- package/src/ui/static/js/views/run.js +349 -0
- package/src/ui/static/js/views/settings.js +67 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# How Socket positions itself: notes for Penthera's docs
|
|
2
|
+
|
|
3
|
+
*Read on 2026-10-19. Everything below is paraphrased; the few quoted words are
|
|
4
|
+
marked. Socket's pages change often, so treat numbers as a snapshot.*
|
|
5
|
+
|
|
6
|
+
[Socket](https://socket.dev) is a well-funded supply-chain security company and
|
|
7
|
+
one of the clearest communicators in the field. These notes look at how it
|
|
8
|
+
explains itself, so Penthera can learn from the craft without copying the claims
|
|
9
|
+
or picking a fight. Penthera is a complement to Socket, not a rival: Socket
|
|
10
|
+
watches the registries from the cloud; Penthera checks your app and your machine
|
|
11
|
+
offline.
|
|
12
|
+
|
|
13
|
+
## 1. The headline promise
|
|
14
|
+
|
|
15
|
+
- The hero line is about securing software at "AI speed", with a sub-line that
|
|
16
|
+
promises to stop malicious packages before they reach your code
|
|
17
|
+
([home](https://socket.dev/)). The tab title frames it as blocking zero-day
|
|
18
|
+
supply-chain attacks.
|
|
19
|
+
- The core argument is one contrast, repeated on nearly every page: a CVE
|
|
20
|
+
database lists accidental vulnerabilities after disclosure, while a malicious
|
|
21
|
+
package is intentional and has to be stopped before install. Socket claims the
|
|
22
|
+
second half that CVE scanners miss
|
|
23
|
+
([features](https://socket.dev/features),
|
|
24
|
+
[supply-chain attack prevention](https://socket.dev/use-case/supply-chain-attack-prevention)).
|
|
25
|
+
- AI is the urgency: coding agents pull in dependencies faster than people can
|
|
26
|
+
review them, so the attack surface grows
|
|
27
|
+
([features](https://socket.dev/features), [Series C post](https://socket.dev/blog/series-c)).
|
|
28
|
+
- A speed claim backs the promise: malicious packages flagged within minutes of
|
|
29
|
+
publication ([home](https://socket.dev/)).
|
|
30
|
+
|
|
31
|
+
**Takeaway.** One sentence of promise, one contrast that explains why existing
|
|
32
|
+
tools are not enough, and one reason it matters now. Penthera's equivalent: one
|
|
33
|
+
promise (check, vet, keep watching, on your machine), one contrast (rules you can
|
|
34
|
+
read versus a verdict from a service), and the same "now" (AI writes the code and
|
|
35
|
+
picks the packages).
|
|
36
|
+
|
|
37
|
+
## 2. Who they sell to
|
|
38
|
+
|
|
39
|
+
- **Buyers are security leaders.** The case-study quotes come from a CISO
|
|
40
|
+
(Anthropic), a head of security (Vercel), senior security engineers (MetaMask,
|
|
41
|
+
Drata) ([customers](https://socket.dev/customers)).
|
|
42
|
+
- **Developers are the way in.** The free GitHub app, the CLI and the `sfw`
|
|
43
|
+
firewall are the self-serve entry points, and comparison pages carry a wall of
|
|
44
|
+
developer tweets ([vs Snyk](https://socket.dev/compare/socket-vs-snyk)).
|
|
45
|
+
- **AI-native companies** are named prominently: Anthropic, Cursor, Replit,
|
|
46
|
+
Vercel and others ([Series C post](https://socket.dev/blog/series-c)).
|
|
47
|
+
- **Credibility from the team**: the founders present themselves as open-source
|
|
48
|
+
maintainers whose packages are downloaded at very large scale
|
|
49
|
+
([FAQ](https://socket.dev/faq)).
|
|
50
|
+
- **Pricing** is per developer seat ([pricing](https://socket.dev/pricing)):
|
|
51
|
+
a free plan for one seat with 1,000 scans a month and a lot included (GitHub
|
|
52
|
+
app, AI analysis, MCP server, install firewall); Team at $25 a seat a month
|
|
53
|
+
with a 5-seat minimum (adds reachability); Business at $50 with a 20-seat
|
|
54
|
+
minimum (adds SBOM, SSO, AI-model and Actions scanning); Enterprise on quote
|
|
55
|
+
(adds self-hosting options, other SCMs, and SAST, secrets and container scanning
|
|
56
|
+
under "Socket Basics").
|
|
57
|
+
- **Open source**: public OSI-licensed projects can get the Business plan free
|
|
58
|
+
as of August 2026
|
|
59
|
+
([announcement](https://socket.dev/blog/free-business-plan-upgrades-for-open-source)).
|
|
60
|
+
The pricing page still mentions the older free Team offer.
|
|
61
|
+
|
|
62
|
+
**Takeaway.** Socket speaks to the person who signs off and lets the developer
|
|
63
|
+
install it. Penthera has no buyer. Its audiences are people doing the work with
|
|
64
|
+
no security team behind them: a founder before launch, a team adopting coding
|
|
65
|
+
agents, a maintainer, a small EU company, an agency. So Penthera's use-case pages
|
|
66
|
+
are organised by situation, not by job title.
|
|
67
|
+
|
|
68
|
+
## 3. How use cases and comparisons are structured
|
|
69
|
+
|
|
70
|
+
**Comparison pages** ([Snyk](https://socket.dev/compare/socket-vs-snyk),
|
|
71
|
+
[Dependabot](https://socket.dev/compare/socket-vs-dependabot),
|
|
72
|
+
[Semgrep](https://socket.dev/compare/socket-vs-semgrep)) share one template:
|
|
73
|
+
|
|
74
|
+
1. "Socket vs X" with a benefit subtitle.
|
|
75
|
+
2. Two paragraphs placing the competitor in the "known vulnerabilities only" box.
|
|
76
|
+
3. Install and contact-sales buttons.
|
|
77
|
+
4. A feature table of 8 or 9 rows with checks and dashes.
|
|
78
|
+
5. A second row of buttons, then a tweet wall, then a footer call to action.
|
|
79
|
+
|
|
80
|
+
They concede little. Snyk gets checks for known vulnerabilities, licence
|
|
81
|
+
enforcement and an API; Dependabot only for known vulnerabilities. Categories
|
|
82
|
+
where the competitor is stronger (SAST depth, containers, IaC, DAST) do not
|
|
83
|
+
appear. There are no prices, benchmarks or third-party sources in the tables.
|
|
84
|
+
|
|
85
|
+
**Use-case pages** ([open source](https://socket.dev/use-case/open-source-security),
|
|
86
|
+
[SCA](https://socket.dev/use-case/sca),
|
|
87
|
+
[supply-chain attack prevention](https://socket.dev/use-case/supply-chain-attack-prevention))
|
|
88
|
+
mix an SEO definition ("what is SCA"), a problem framing, a feature checklist and
|
|
89
|
+
a live feed of recently blocked packages. The feed is the most persuasive
|
|
90
|
+
element: it shows the product working today.
|
|
91
|
+
|
|
92
|
+
There is no standalone "Why Socket" page; it is a menu that groups the case
|
|
93
|
+
studies and comparisons. The closest page is
|
|
94
|
+
[features](https://socket.dev/features).
|
|
95
|
+
|
|
96
|
+
**Takeaway.** Copy the shape (one page per audience, one per alternative, a
|
|
97
|
+
table that is quick to scan), not the tone. Penthera's comparison pages say
|
|
98
|
+
"use together", name where the other tool goes further, link every claim to the
|
|
99
|
+
vendor's own docs, and carry a last-checked date. That honesty is the
|
|
100
|
+
differentiator Penthera can afford and a funded vendor often cannot.
|
|
101
|
+
|
|
102
|
+
## 4. How they use proof
|
|
103
|
+
|
|
104
|
+
- **Big numbers** on the home page: about 11.6 million commits secured a month, 1.5 million repositories, 27,000
|
|
105
|
+
organisations, 10,000 attacks blocked a week ([home](https://socket.dev/)).
|
|
106
|
+
The same metric differs across pages (risk signals: 70, 80 or 85; unique threat
|
|
107
|
+
detections: 26,000 on [features](https://socket.dev/features) versus 300,000 on
|
|
108
|
+
the home page).
|
|
109
|
+
- **Logos and case studies.** The strongest one, Anthropic, gives an outcome:
|
|
110
|
+
most dependency reviews automated and hours saved each week per engineer
|
|
111
|
+
([Anthropic](https://socket.dev/case-study/anthropic)). Vercel and Drata
|
|
112
|
+
describe workflow and hygiene rather than numbers
|
|
113
|
+
([Vercel](https://socket.dev/case-study/vercel), [Drata](https://socket.dev/case-study/drata)).
|
|
114
|
+
MetaMask's engineer says openly that some false positives are an acceptable
|
|
115
|
+
price for early warning ([MetaMask](https://socket.dev/case-study/metamask)).
|
|
116
|
+
The Replit story was not retrievable (HTTP 403); its index card is about
|
|
117
|
+
reducing false positives.
|
|
118
|
+
- **Funding and badges**: total raised, a $1 billion valuation, SOC 2 Type 2, a
|
|
119
|
+
Fortune list, and an OpenAI early-access programme
|
|
120
|
+
([home](https://socket.dev/), [Series C post](https://socket.dev/blog/series-c)).
|
|
121
|
+
- **Research as proof**: threat write-ups with timestamps showing when the AI
|
|
122
|
+
scanner flagged an attack, plus downloadable indicators
|
|
123
|
+
([Rust crates post](https://socket.dev/blog/popular-rust-crates-compromised)).
|
|
124
|
+
- **No accuracy numbers.** No false-positive rate for malware verdicts is
|
|
125
|
+
published; false-positive language appears only for reachability cutting CVE
|
|
126
|
+
noise.
|
|
127
|
+
|
|
128
|
+
**Takeaway.** Penthera has no logos, no funding and no usage telemetry (by
|
|
129
|
+
design, it has no way to count users). What it can show is what a reader can
|
|
130
|
+
check: benchmark precision and recall with every miss listed, rule and test
|
|
131
|
+
counts generated from the code, a cited methodology, an OpenSSF Scorecard, and
|
|
132
|
+
2FA-approved releases with provenance. That is the "By the numbers" block in the
|
|
133
|
+
README, refreshed by `npm run docs:numbers`.
|
|
134
|
+
|
|
135
|
+
## 5. Calls to action
|
|
136
|
+
|
|
137
|
+
- Every page pairs a free self-serve action (install the GitHub app) with a sales
|
|
138
|
+
action (book a demo or contact sales) ([home](https://socket.dev/), compare and
|
|
139
|
+
use-case pages).
|
|
140
|
+
- Product pages lead with the install command
|
|
141
|
+
([CLI](https://socket.dev/features/cli),
|
|
142
|
+
[firewall](https://socket.dev/features/firewall)); every blog post ends with a
|
|
143
|
+
free firewall card.
|
|
144
|
+
- An urgency line: a phone number for teams under active attack.
|
|
145
|
+
|
|
146
|
+
**Takeaway.** Penthera has no sales step, so its call to action is the command
|
|
147
|
+
itself. The README opens with three `npx` commands that each take under a
|
|
148
|
+
minute and need no account.
|
|
149
|
+
|
|
150
|
+
## 6. What they leave unsaid
|
|
151
|
+
|
|
152
|
+
| Topic | What Socket's pages say | Room for Penthera |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| Offline use | No offline or air-gapped mode documented. Even self-hosted firewall modes check packages against Socket's API ([firewall free](https://docs.socket.dev/docs/socket-firewall-free), [pricing](https://socket.dev/pricing)). Only manifests and lockfiles are sent, not source ([FAQ](https://socket.dev/faq)) | Everything runs locally; `--offline` limits traffic to the named target |
|
|
155
|
+
| Deterministic verdicts | Static analysis first, then an LLM stage, then human review before a package is labelled known malware ([AI alert](https://socket.dev/alerts/gptMalware)). No claim of reproducible results | Same input, same output, with the rule and `file:line` for each finding |
|
|
156
|
+
| App and runtime security | No DAST or live-URL testing; first-party SAST and secrets only on Enterprise | URL and repo scans, fix recipes, verification |
|
|
157
|
+
| AI tooling | Covers it as packages: an MCP server for package lookups ([MCP guide](https://docs.socket.dev/docs/guide-to-socket-mcp)), firewall ecosystems that include agent skills and models ([firewall](https://socket.dev/features/firewall)), research on malicious MCP servers ([labs](https://socket.dev/labs)). Nothing found that audits a repo's own agent config | `penthera agents`: CLAUDE.md, `.mcp.json`, hooks, permissions, plugins, rule files |
|
|
158
|
+
| EU compliance | SBOM export (CycloneDX, SPDX, OpenVEX) on Business and up; no NIS2 or CRA page found; compliance messaging is SOC 2 and Vanta-style integrations | NIS2 readiness, CRA Article 14 drafts, SBOM and AI-BOM, signable evidence, free |
|
|
159
|
+
|
|
160
|
+
Two cautions. Socket does cover parts of AI tooling, and says so; Penthera's docs
|
|
161
|
+
should not claim it does not. And the AI-versus-rules point should be made
|
|
162
|
+
calmly: Socket's AI scanner once flagged Penthera itself as malware because the
|
|
163
|
+
repository contains real test payloads. That is a fair example of the trade-off,
|
|
164
|
+
not a gotcha. AI stages catch novel attacks that no rule anticipated; rules
|
|
165
|
+
explain themselves and do not misread intent. Running both is reasonable.
|
|
166
|
+
|
|
167
|
+
## 7. What Penthera's docs take from this
|
|
168
|
+
|
|
169
|
+
1. **A three-command "Try it in 60 seconds" block** near the top of the README,
|
|
170
|
+
as the call to action.
|
|
171
|
+
2. **Use-case pages by situation**, each with the problem, what to run, real
|
|
172
|
+
example output, and what Penthera does not do
|
|
173
|
+
([docs/use-cases/](../use-cases/README.md)).
|
|
174
|
+
3. **Comparison pages framed as "use together"**, with factual tables, where the
|
|
175
|
+
other tool goes further, links to the vendor's docs, and a last-checked date
|
|
176
|
+
([docs/compare/](../compare/README.md)).
|
|
177
|
+
4. **Proof without logos**: a short "By the numbers" block in the README, every
|
|
178
|
+
number checkable and refreshable.
|
|
179
|
+
5. **A shorter README** that points to per-command pages instead of carrying
|
|
180
|
+
every flag.
|
|
181
|
+
|
|
182
|
+
Things deliberately not copied: inflated or inconsistent numbers, tweet walls,
|
|
183
|
+
competitor tables that only list the author's strengths, and urgency language.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Use cases
|
|
2
|
+
|
|
3
|
+
Each page starts from a situation, not a feature: the problem, what to run, what
|
|
4
|
+
the output looks like, and what Penthera does not do for you.
|
|
5
|
+
|
|
6
|
+
| You are | Page |
|
|
7
|
+
|---|---|
|
|
8
|
+
| A solo founder or vibecoder about to launch | [Before launch](solo-founder.md) |
|
|
9
|
+
| A team adopting Claude Code or Cursor | [The AI-tooling supply chain](ai-coding-teams.md) |
|
|
10
|
+
| An open-source maintainer | [For maintainers](open-source-maintainers.md) |
|
|
11
|
+
| An EU SME with NIS2 or CRA duties | [Evidence for NIS2 and the CRA](eu-sme-compliance.md) |
|
|
12
|
+
| An agency shipping client apps | [A repeatable handover check](agencies.md) |
|
|
13
|
+
|
|
14
|
+
Using another security tool already? See [how Penthera fits with it](../compare/README.md).
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# A repeatable handover check: for agencies shipping client apps
|
|
2
|
+
|
|
3
|
+
## The problem
|
|
4
|
+
|
|
5
|
+
An agency ships many similar apps for clients who assume security was handled.
|
|
6
|
+
Each project has a different team, a different deadline and a launch date that
|
|
7
|
+
does not move. A security review by a person for every launch is too expensive,
|
|
8
|
+
and "we followed best practice" does not survive a client's procurement
|
|
9
|
+
questionnaire or an incident.
|
|
10
|
+
|
|
11
|
+
## What to run
|
|
12
|
+
|
|
13
|
+
The same three steps on every project, in CI or before handover:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx penthera https://preview.client.example --repo . --profile standard \
|
|
17
|
+
--sarif reports/scan.sarif -o reports/scan.json
|
|
18
|
+
npx penthera deps --license-policy permissive # dependency capabilities and licences
|
|
19
|
+
npx penthera agents # the agent config left in the repo
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
At handover, give the client a report written for them and a bundle they can
|
|
23
|
+
keep:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx penthera https://client.example --repo . --audience owner > security-summary.md
|
|
27
|
+
npx penthera https://client.example --repo . --audience auditor \
|
|
28
|
+
--evidence handover/2026-10-19 --sign-key ~/.ssh/agency_ed25519
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Pin the Penthera version in CI so every project is checked by the same rules,
|
|
32
|
+
and use `--baseline` to show only what is new since the last scan.
|
|
33
|
+
|
|
34
|
+
## What you get
|
|
35
|
+
|
|
36
|
+
The owner report is in plain language. From Penthera's own mock target:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
# Security summary
|
|
40
|
+
|
|
41
|
+
## In short
|
|
42
|
+
|
|
43
|
+
Penthera checked http://localhost:8765 and found **2 serious problems** to fix
|
|
44
|
+
this week, 5 moderate, 2 minor, 2 notes. The serious ones are things an attacker
|
|
45
|
+
could use today.
|
|
46
|
+
|
|
47
|
+
## What to do first
|
|
48
|
+
|
|
49
|
+
1. **Harden authentication and access control** (involved, a developer can do this). ...
|
|
50
|
+
2. **Remove the exposed file or interface from production** (quick, a developer can do this). ...
|
|
51
|
+
3. **Add a Content-Security-Policy header** (moderate, a developer can do this). ...
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The auditor version covers scope and method, every finding with its evidence and
|
|
55
|
+
confidence, the hosts contacted, and the probes that could not run. The evidence bundle hashes every file in a
|
|
56
|
+
signed manifest, so the client can check later that nothing was edited.
|
|
57
|
+
`--report-template` puts the same data into your own Markdown template.
|
|
58
|
+
[More on reports and evidence](../evidence.md).
|
|
59
|
+
|
|
60
|
+
## What it does not do
|
|
61
|
+
|
|
62
|
+
- It does not replace a penetration test where a contract or a regulator asks for
|
|
63
|
+
one. It makes that test cheaper, because the routine findings are already gone.
|
|
64
|
+
- It only scans what you point it at, with the client's permission. Get the scope
|
|
65
|
+
in writing.
|
|
66
|
+
- Fix recipes cover common JavaScript and TypeScript frameworks. Other stacks get
|
|
67
|
+
findings and guidance, not diffs.
|
|
68
|
+
- It does not monitor client production after handover yet. That is on the
|
|
69
|
+
[roadmap](../../ROADMAP.md).
|
|
70
|
+
|
|
71
|
+
[All use cases](README.md) · [Back to the README](../../README.md)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# The AI-tooling supply chain: for teams adopting Claude Code or Cursor
|
|
2
|
+
|
|
3
|
+
## The problem
|
|
4
|
+
|
|
5
|
+
A coding agent runs with your developer's permissions. What it can do is decided
|
|
6
|
+
by files that rarely get reviewed: `.mcp.json`, `.claude/settings.json`, hooks,
|
|
7
|
+
skills, plugins, `CLAUDE.md`, `AGENTS.md` and `.cursor/` rules. Some of these
|
|
8
|
+
arrive from a teammate's pull request, some from a marketplace, some from a
|
|
9
|
+
blog post. In 2025 and 2026 attackers used exactly these paths: skills with
|
|
10
|
+
instructions hidden from human reviewers, MCP servers launched with `npx -y` on
|
|
11
|
+
whatever version was latest, and npm worms that wrote to `~/.claude` and ran the
|
|
12
|
+
`claude` CLI on the victim's machine.
|
|
13
|
+
|
|
14
|
+
## What to run
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx penthera agents --home # this repo plus your user-level Claude Code, Cursor and Claude Desktop config
|
|
18
|
+
npx penthera agents ./some-skill # vet a downloaded skill before you install it
|
|
19
|
+
npx penthera agents --pin # record hashes in penthera.lock; later runs show what changed
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For a team, add the pre-commit hook so agent-config changes are checked before
|
|
23
|
+
they are committed, and the GitHub Action in `agents` mode on pull requests:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx penthera hook install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```yaml
|
|
30
|
+
- uses: danoszz/penthera@<release-commit-sha>
|
|
31
|
+
with:
|
|
32
|
+
mode: agents
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## What you get
|
|
36
|
+
|
|
37
|
+
From Penthera's own test fixture of a deliberately bad setup (abridged):
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
Grade F (0/100)
|
|
41
|
+
Found 1 skills · 4 MCP servers · 3 hooks · 0 plugins · 1 rule files
|
|
42
|
+
Lock none (run with --pin)
|
|
43
|
+
|
|
44
|
+
CRIT MCP server "installer" launches by downloading and running code
|
|
45
|
+
.mcp.json
|
|
46
|
+
CRIT SessionStart hook downloads and runs code
|
|
47
|
+
.claude/settings.json
|
|
48
|
+
HIGH Instructions hidden in an HTML comment
|
|
49
|
+
skills/helper/SKILL.md
|
|
50
|
+
HIGH Text addressed to a security scanner
|
|
51
|
+
skills/helper/SKILL.md
|
|
52
|
+
HIGH PreToolUse (*) hook auto-approves tool calls
|
|
53
|
+
.claude/settings.json
|
|
54
|
+
HIGH Permission allow-list grants `Bash(*)`
|
|
55
|
+
.claude/settings.json
|
|
56
|
+
MED MCP server "filesystem" runs an unpinned package via npx
|
|
57
|
+
.mcp.json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Each finding names the OWASP MCP Top 10 and Agentic Top 10 ids it maps to, and
|
|
61
|
+
the rule that fired is readable in [`lib/agents/`](../../lib/agents/). The audit
|
|
62
|
+
is offline and read-only: no model judges the skill, so a skill cannot talk its
|
|
63
|
+
way past it. [More on `penthera agents`](../commands/agents.md).
|
|
64
|
+
|
|
65
|
+
`penthera deps` also flags packages that write to `~/.claude`, `~/.cursor` or
|
|
66
|
+
`.mcp.json`, or run the `claude`, `gemini` or `q` CLIs, which is how the
|
|
67
|
+
s1ngularity attack used local AI tools. [More on `penthera deps`](../commands/deps.md).
|
|
68
|
+
|
|
69
|
+
## What it does not do
|
|
70
|
+
|
|
71
|
+
- It reads configuration and files on disk. It does not watch what an agent does
|
|
72
|
+
at run time, and it does not sandbox anything.
|
|
73
|
+
- It does not know whether a remote MCP server is trustworthy. It checks how the
|
|
74
|
+
server is launched and configured, not what the service behind it does.
|
|
75
|
+
- It does not check the registries for newly published malicious skills or
|
|
76
|
+
packages. A registry-watching service such as
|
|
77
|
+
[Socket](../compare/socket.md) covers that.
|
|
78
|
+
- Its rules cover the patterns in the [methodology](../METHODOLOGY.md). A new
|
|
79
|
+
trick needs a new rule and a release.
|
|
80
|
+
|
|
81
|
+
[All use cases](README.md) · [Back to the README](../../README.md)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Evidence for NIS2 and the CRA: for EU SMEs
|
|
2
|
+
|
|
3
|
+
## The problem
|
|
4
|
+
|
|
5
|
+
NIS2 puts a duty of care on in-scope organisations, written into national law
|
|
6
|
+
(the Cyberbeveiligingswet in the Netherlands, the NIS2-wet in Belgium). The
|
|
7
|
+
Cyber Resilience Act adds reporting duties for manufacturers of products with
|
|
8
|
+
digital elements, with deadlines measured in hours. Large customers now send
|
|
9
|
+
security questionnaires as part of procurement. A small company has to show
|
|
10
|
+
that it tests, fixes and records, without a compliance team or a budget for a
|
|
11
|
+
platform.
|
|
12
|
+
|
|
13
|
+
## What to run
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
penthera --assessment-init assessment.json # once: the organisational measures a scanner cannot test
|
|
17
|
+
penthera https://staging.example.com --repo . \
|
|
18
|
+
--framework nis2 --readiness --assessment assessment.json \
|
|
19
|
+
--sbom sbom.cdx.json --evidence evidence/2026-10-19 --sign-key ~/.ssh/id_ed25519
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
That run writes the scan, an Article 21(2) coverage table, a readiness report
|
|
23
|
+
with every measure marked met, partial, gap or not applicable, a CycloneDX SBOM,
|
|
24
|
+
and a hashed, SSH-signed evidence bundle an auditor can verify with standard
|
|
25
|
+
tools.
|
|
26
|
+
|
|
27
|
+
Around it:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
penthera --policy-pack ./policies --org "Your Company" --readiness --assessment assessment.json
|
|
31
|
+
penthera https://example.com --readiness --assessment assessment.json --questionnaire questions.txt
|
|
32
|
+
penthera --cra-init cra.json && penthera --cra cra.json # CRA Article 14 timeline and drafts
|
|
33
|
+
penthera --repo . --aibom aibom.cdx.json # CycloneDX 1.6 AI-BOM
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## What you get
|
|
37
|
+
|
|
38
|
+
The CRA helper prints the deadlines and writes draft reports, marking every fact
|
|
39
|
+
it still needs:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
CRA Article 14 report drafts written to cra-reports.md
|
|
43
|
+
Early warning (24 hours): n/a, set aware_at
|
|
44
|
+
Vulnerability notification (72 hours): n/a, set aware_at
|
|
45
|
+
Final report (14 days after a corrective or mitigating measure is available): ...
|
|
46
|
+
⚠️ No valid `aware_at` timestamp, so deadlines can't be computed. Set when you became aware (ISO 8601) and re-run.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The questionnaire helper answers each question from your scan and
|
|
50
|
+
self-assessment, cites the evidence, and marks anything it cannot map as
|
|
51
|
+
`NEEDS HUMAN INPUT` instead of guessing. Guides:
|
|
52
|
+
[NIS2](../compliance-nis2.md), [CRA](../compliance-cra.md),
|
|
53
|
+
[evidence bundles](../evidence.md).
|
|
54
|
+
|
|
55
|
+
## What it does not do
|
|
56
|
+
|
|
57
|
+
- It is readiness tooling, not a certification and not legal advice. Whether you
|
|
58
|
+
are in scope, and what is proportionate for you, is for you and your advisers
|
|
59
|
+
to decide.
|
|
60
|
+
- It covers the technical, testable part of the duty of care. Policies,
|
|
61
|
+
training, backups and MFA come from your self-assessment; Penthera records
|
|
62
|
+
what you attest, it cannot check it.
|
|
63
|
+
- It does not file anything. Reports to a CSIRT or ENISA are drafts for you to
|
|
64
|
+
review and submit.
|
|
65
|
+
- Jurisdiction details ship for the Netherlands today; other member states are
|
|
66
|
+
configuration still to be added.
|
|
67
|
+
|
|
68
|
+
[All use cases](README.md) · [Back to the README](../../README.md)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# For open-source maintainers
|
|
2
|
+
|
|
3
|
+
## The problem
|
|
4
|
+
|
|
5
|
+
Your project is someone else's dependency. A compromised maintainer account, a
|
|
6
|
+
malicious contributor pull request that bumps a lockfile, or a leaked publish
|
|
7
|
+
token can turn it into the attack. Most maintainers do this unpaid, without a
|
|
8
|
+
security budget, and many cannot send their dependency list or code to a vendor
|
|
9
|
+
service, or would rather not sign up for one.
|
|
10
|
+
|
|
11
|
+
## What to run
|
|
12
|
+
|
|
13
|
+
On every pull request that touches the lockfile, comment what the change lets
|
|
14
|
+
code do:
|
|
15
|
+
|
|
16
|
+
```yaml
|
|
17
|
+
- uses: danoszz/penthera@<release-commit-sha> # pin to a release commit
|
|
18
|
+
with:
|
|
19
|
+
mode: deps
|
|
20
|
+
fail-on: none
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The full workflow, with permissions and a paths filter, is in
|
|
24
|
+
[`docs/examples/pr-dependency-review.yml`](../examples/pr-dependency-review.yml).
|
|
25
|
+
The action runs Penthera from its own checkout: no install from npm and no
|
|
26
|
+
registry lookups. On pull requests from forks the token is read-only, so the
|
|
27
|
+
diff goes to the job summary instead of a comment.
|
|
28
|
+
|
|
29
|
+
Locally, before you cut a release:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx penthera deps --base origin/main # what changed in the tree since main
|
|
33
|
+
npx penthera --repo . # secrets, including AI provider keys
|
|
34
|
+
npx penthera agents # the agent config you ship (CLAUDE.md, .mcp.json, skills/)
|
|
35
|
+
npx penthera hook install # block secrets and risky config at commit time
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## What you get
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
▲ net-helper 1.0.0 → 1.1.0 + network, whole environment
|
|
42
|
+
node_modules/net-helper/index.js:3 const https = require('https');
|
|
43
|
+
node_modules/net-helper/index.js:5 const body = JSON.stringify(process.env);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
A patch release that starts reading the whole environment next to a network call
|
|
47
|
+
is the shape of most credential-stealing packages. The diff shows it with
|
|
48
|
+
`file:line` evidence, whether or not an advisory exists yet.
|
|
49
|
+
[More on `penthera deps`](../commands/deps.md) and [the action](../commands/action.md).
|
|
50
|
+
|
|
51
|
+
If your project ships agent skills or MCP configuration, `penthera agents` on
|
|
52
|
+
your own repo is a reasonable release check too: it is what your users' tools
|
|
53
|
+
will load.
|
|
54
|
+
|
|
55
|
+
## How Penthera handles its own releases
|
|
56
|
+
|
|
57
|
+
The same practices are worth copying. Penthera releases are published with npm
|
|
58
|
+
provenance through trusted publishing and are staged: each version waits on npm
|
|
59
|
+
until a maintainer approves it with 2FA. CI actions are pinned by SHA, CodeQL
|
|
60
|
+
runs on every push, and the
|
|
61
|
+
[OpenSSF Scorecard](https://scorecard.dev/viewer/?uri=github.com/danoszz/penthera)
|
|
62
|
+
is public. See [`.github/workflows/publish.yml`](../../.github/workflows/publish.yml).
|
|
63
|
+
|
|
64
|
+
## What it does not do
|
|
65
|
+
|
|
66
|
+
- Dependency analysis covers npm and Python. The install firewall and the
|
|
67
|
+
`--online` registry checks are npm only for now.
|
|
68
|
+
- It does not track CVEs in your dependencies. Keep Dependabot or a similar
|
|
69
|
+
service on for that ([how they fit](../compare/github.md)).
|
|
70
|
+
- It does not watch the registry for your package being republished by someone
|
|
71
|
+
else. Enable 2FA and trusted publishing on npm for that.
|
|
72
|
+
- A capability is what code *can* do, not proof of intent. Many good packages
|
|
73
|
+
use the network; the diff is there so a person can look.
|
|
74
|
+
|
|
75
|
+
[All use cases](README.md) · [Back to the README](../../README.md)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Before launch: for solo founders and vibecoders
|
|
2
|
+
|
|
3
|
+
## The problem
|
|
4
|
+
|
|
5
|
+
You built the app in weeks, much of it with an AI assistant. It works. You have
|
|
6
|
+
not had time to check the things that tend to go wrong in AI-written apps: an
|
|
7
|
+
API route that returns any user's data if you change the id, an OpenAI key in a
|
|
8
|
+
client bundle, a missing security header, a CORS policy of `*`, a login with no
|
|
9
|
+
rate limit. Nobody on the team does security, because there is no team.
|
|
10
|
+
|
|
11
|
+
## What to run
|
|
12
|
+
|
|
13
|
+
Start the app locally, then:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx penthera http://localhost:3000 --repo . # the running app and its source, together
|
|
17
|
+
npx penthera fix --plan --repo . # fixes for what it can fix, as diffs
|
|
18
|
+
npx penthera hook install # stop secrets at commit time from now on
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or ask your coding agent, with the [Agent Skill](../commands/skill.md)
|
|
22
|
+
installed: "scan my app on localhost:3000 and fix what you find".
|
|
23
|
+
|
|
24
|
+
Before you deploy, run the same scan against your preview URL. Only scan systems
|
|
25
|
+
you own.
|
|
26
|
+
|
|
27
|
+
## What you get
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Findings
|
|
31
|
+
|
|
32
|
+
HIGH IDOR/BOLA: GET /api/users/{user_id}
|
|
33
|
+
http://localhost:3000/api/users/1 → 200
|
|
34
|
+
HIGH OAuth open redirect
|
|
35
|
+
http://localhost:3000/api/oauth/callback?redirect_uri=... → 302
|
|
36
|
+
MED Missing Content-Security-Policy
|
|
37
|
+
MED No login rate limiting detected
|
|
38
|
+
http://localhost:3000/api/login → 401
|
|
39
|
+
LOW Missing X-Frame-Options
|
|
40
|
+
INFO Missing Referrer-Policy
|
|
41
|
+
|
|
42
|
+
──────────────────────────────────────────────────────────
|
|
43
|
+
2 high · 5 medium · 2 low · 2 info
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`penthera fix --plan` then prints a unified diff per fix it knows (security
|
|
47
|
+
headers, cookie flags, a CORS allowlist, a login rate limit, moving a
|
|
48
|
+
hardcoded secret to an environment variable) for Next.js, Express, Fastify and
|
|
49
|
+
Hono. Nothing is written until you apply a plan by id, and the repo is
|
|
50
|
+
re-scanned afterwards to confirm the finding is gone.
|
|
51
|
+
[More on fixes](../commands/fix.md).
|
|
52
|
+
|
|
53
|
+
## What it does not do
|
|
54
|
+
|
|
55
|
+
- It is not a penetration test by a person. It checks known classes of problem;
|
|
56
|
+
it will not find a flaw in your business logic, such as a coupon that can be
|
|
57
|
+
applied twice.
|
|
58
|
+
- It does not fix IDOR or auth design for you. It points at the route; the fix
|
|
59
|
+
is yours.
|
|
60
|
+
- It does not watch production yet. Scheduled checks are on the
|
|
61
|
+
[roadmap](../../ROADMAP.md).
|
|
62
|
+
- A clean scan is not proof of safety. Every finding has a confidence label, and
|
|
63
|
+
probes that could not run are listed as inconclusive rather than passed.
|
|
64
|
+
|
|
65
|
+
[All use cases](README.md) · [Back to the README](../../README.md)
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* live DNS.
|
|
14
14
|
*/
|
|
15
15
|
import { resolveTxt as dnsResolveTxt, resolveMx as dnsResolveMx } from "node:dns/promises";
|
|
16
|
+
import { currentEgress } from "../../src/utils/http.js";
|
|
16
17
|
|
|
17
18
|
const DEFAULT_RESOLVER = { resolveTxt: dnsResolveTxt, resolveMx: dnsResolveMx };
|
|
18
19
|
|
|
@@ -98,6 +99,10 @@ export function evaluateDmarc(txtRecords) {
|
|
|
98
99
|
* @param {object} opts - { resolver }
|
|
99
100
|
*/
|
|
100
101
|
export async function probeEmailDns(domain, opts = {}) {
|
|
102
|
+
// DNS queries go to resolvers, not the target: --offline forbids them.
|
|
103
|
+
if (currentEgress()?.offline) {
|
|
104
|
+
return { domain, spf: null, dmarc: null, dmarcPolicy: null, mxCount: 0, findings: [], skipped: "offline" };
|
|
105
|
+
}
|
|
101
106
|
const resolver = opts.resolver || DEFAULT_RESOLVER;
|
|
102
107
|
const findings = [];
|
|
103
108
|
|