@r_masseater/h56m 0.1.0 → 0.3.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/README.md +74 -6
- package/THIRD-PARTY-NOTICES.txt +2 -1248
- package/dist/cli-DTqDhoxm.mjs +38 -0
- package/dist/cli-DTqDhoxm.mjs.map +1 -0
- package/dist/cli.mjs +3 -35
- package/dist/cli.mjs.map +1 -1
- package/dist/{index-DiF7IoP4.d.mts → index-C3x2L0fZ.d.mts} +2 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/presets.d.mts +2 -0
- package/dist/presets.mjs +6 -0
- package/dist/presets.mjs.map +1 -0
- package/dist/{section-AeJ2zzPN.mjs → section-DHEBsrR8.mjs} +14 -6
- package/dist/section-DHEBsrR8.mjs.map +1 -0
- package/dist/vite.d.mts +1 -1
- package/logo.svg +7 -0
- package/package.json +30 -21
- package/presets/betterleaks.toml +12236 -0
- package/skills/scan-secrets/SKILL.md +4 -4
- package/skills/use-h56m-presets/SKILL.md +44 -0
- package/dist/section-AeJ2zzPN.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
# @r_masseater/h56m
|
|
2
2
|
|
|
3
|
+
<img src="logo.svg" alt="h56m logo" width="256">
|
|
4
|
+
|
|
3
5
|
A secret scanner written in Rust and configured from `vite.config.ts`.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
and reads settings in the Betterleaks format
|
|
7
|
-
|
|
7
|
+
Its matching engine follows [Betterleaks](https://github.com/betterleaks/betterleaks)
|
|
8
|
+
and reads settings in the Betterleaks format, including filters, components and
|
|
9
|
+
decoding of base64, hex, percent and unicode text. It has no rules of its own: extend
|
|
10
|
+
a preset from the `@r_masseater/h56m/presets` subpath
|
|
8
11
|
or a TOML file of your own. It scans the commits a branch adds, the staged changes, a
|
|
9
12
|
tree, or any text. It does not call the services the secrets belong to.
|
|
10
13
|
|
|
11
14
|
```ts
|
|
12
15
|
import "@r_masseater/h56m/vite";
|
|
13
|
-
import { betterleaks } from "@r_masseater/h56m
|
|
16
|
+
import { betterleaks } from "@r_masseater/h56m/presets";
|
|
14
17
|
import { defineConfig } from "vite-plus";
|
|
15
18
|
|
|
16
19
|
export default defineConfig({
|
|
@@ -25,8 +28,73 @@ export default defineConfig({
|
|
|
25
28
|
Run `h56m` to scan the commits since the default branch, or `h56m --staged`
|
|
26
29
|
to scan the index. Call `makeDetector` to scan text from code.
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
Encoded text is decoded up to five times, as the Betterleaks CLI does. Set
|
|
32
|
+
`maxDecodeDepth` to change that; `0` scans only the text as written.
|
|
33
|
+
|
|
34
|
+
The tests run every scan that the Betterleaks test suite makes and compare the
|
|
35
|
+
findings; `src/app/fixtures/` holds them.
|
|
36
|
+
|
|
37
|
+
The engine ports code from Betterleaks, which is under MIT, and embeds its word list, which is under CC-BY-SA-4.0. `THIRD-PARTY-NOTICES.txt` holds their notices.
|
|
38
|
+
|
|
39
|
+
## Presets
|
|
40
|
+
|
|
41
|
+
| Export | Rules |
|
|
42
|
+
| ------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `betterleaks` | The default configuration of [Betterleaks](https://github.com/betterleaks/betterleaks), at a pinned commit |
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import "@r_masseater/h56m/vite";
|
|
47
|
+
import { betterleaks } from "@r_masseater/h56m/presets";
|
|
48
|
+
import { defineConfig } from "vite-plus";
|
|
49
|
+
|
|
50
|
+
export default defineConfig({
|
|
51
|
+
h56m: { extend: { path: betterleaks, disabledRules: ["generic-api-key"] } },
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Each export is the absolute path of a TOML file in the Betterleaks format. The files are plain data,
|
|
56
|
+
so they need no native build of their own.
|
|
57
|
+
|
|
58
|
+
The Betterleaks rules are under the MIT license. `THIRD-PARTY-NOTICES.txt` holds the notice.
|
|
59
|
+
|
|
60
|
+
## Comparison
|
|
61
|
+
|
|
62
|
+
Measured on 2026-11-19 on linux x64, 4 CPUs with [lint-bench](https://github.com/masseater/ecosystems/tree/main/tools/lint-bench), which keeps the full results in [results.md](https://github.com/masseater/ecosystems/blob/main/tools/lint-bench/results/results.md). Cold runs drop the page cache and the tools' caches first. "Same as ours", "Only ours" and "Only theirs" compare findings by file, line and rule where both tools use the same rules.
|
|
63
|
+
|
|
64
|
+
h56m uses the Betterleaks rules and, like Betterleaks, scans only the lines each commit adds. Its findings match Betterleaks on both repositories. It runs 2 to 3 times slower than Betterleaks.
|
|
65
|
+
|
|
66
|
+
### masseater.dev
|
|
67
|
+
|
|
68
|
+
| Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
|
|
69
|
+
| ----------- | ----------------------------------- | ------ | --------------- | -------- | -------- | ------------ | --------- | ----------- |
|
|
70
|
+
| Betterleaks | 2.0.0-rc.9 | 369 ms | 328 ms ± 29 ms | 82 MB | 1 | 1 | 0 | 0 |
|
|
71
|
+
| gitleaks | 8.30.1 | 805 ms | 652 ms ± 25 ms | 63 MB | 1 | | | |
|
|
72
|
+
| **h56m** | workspace, h56m-presets betterleaks | 1.03 s | 740 ms ± 19 ms | 254 MB | 1 | | | |
|
|
73
|
+
| Kingfisher | 2.19.1 | 9.10 s | 740 ms ± 20 ms | 178 MB | 0 | | | |
|
|
74
|
+
| TruffleHog | 3.99.9 | 5.96 s | 9.89 s ± 477 ms | 185 MB | 0 | | | |
|
|
75
|
+
|
|
76
|
+
- h56m: Commits from the base to HEAD, Betterleaks default rules, no live validation
|
|
77
|
+
- Betterleaks: Commits from the base to HEAD, Betterleaks default rules, no live validation
|
|
78
|
+
- gitleaks: Commits from the base to HEAD, gitleaks default rules
|
|
79
|
+
- TruffleHog: Commits from the base to HEAD, all detectors, --no-verification
|
|
80
|
+
- Kingfisher: Commits from the base to HEAD, default rules, --no-validate
|
|
81
|
+
|
|
82
|
+
### nodejs/node
|
|
83
|
+
|
|
84
|
+
| Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
|
|
85
|
+
| ----------- | ----------------------------------- | ------- | ---------------- | -------- | -------- | ------------ | --------- | ----------- |
|
|
86
|
+
| Betterleaks | 2.0.0-rc.9 | 722 ms | 674 ms ± 23 ms | 387 MB | 0 | 0 | 0 | 0 |
|
|
87
|
+
| gitleaks | 8.30.1 | 1.31 s | 1.18 s ± 51 ms | 72 MB | 3 | | | |
|
|
88
|
+
| Kingfisher | 2.19.1 | 9.92 s | 1.36 s ± 41 ms | 204 MB | 0 | | | |
|
|
89
|
+
| **h56m** | workspace, h56m-presets betterleaks | 2.19 s | 1.96 s ± 36 ms | 436 MB | 0 | | | |
|
|
90
|
+
| TruffleHog | 3.99.9 | 14.07 s | 30.49 s ± 1.67 s | 185 MB | 0 | | | |
|
|
91
|
+
|
|
92
|
+
- h56m: Commits from the base to HEAD, Betterleaks default rules, no live validation
|
|
93
|
+
- Betterleaks: Commits from the base to HEAD, Betterleaks default rules, no live validation
|
|
94
|
+
- gitleaks: Commits from the base to HEAD, gitleaks default rules
|
|
95
|
+
- TruffleHog: Commits from the base to HEAD, all detectors, --no-verification
|
|
96
|
+
- Kingfisher: Commits from the base to HEAD, default rules, --no-validate
|
|
29
97
|
|
|
30
98
|
## Agent skills
|
|
31
99
|
|
|
32
|
-
The package ships
|
|
100
|
+
The package ships agent skills in `skills/`. Add `permissions: { "@r_masseater/h56m": { skills: true } }` to `pnpm-workspace.yaml` and `vp install` links them into the skill directories of your agents.
|