@r_masseater/h56m 0.0.0 → 0.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/LICENSE ADDED
@@ -0,0 +1,87 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 masseater
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ @tanstack/eslint-plugin-start
26
+
27
+ MIT License
28
+
29
+ Copyright (c) 2021-present Tanner Linsley
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining a copy
32
+ of this software and associated documentation files (the "Software"), to deal
33
+ in the Software without restriction, including without limitation the rights
34
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35
+ copies of the Software, and to permit persons to whom the Software is
36
+ furnished to do so, subject to the following conditions:
37
+
38
+ The above copyright notice and this permission notice shall be included in all
39
+ copies or substantial portions of the Software.
40
+
41
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
+ SOFTWARE.
48
+
49
+ ---
50
+
51
+ @typescript-eslint/utils
52
+
53
+ MIT License
54
+
55
+ Copyright (c) 2019 typescript-eslint and other contributors
56
+
57
+ Permission is hereby granted, free of charge, to any person obtaining a copy
58
+ of this software and associated documentation files (the "Software"), to deal
59
+ in the Software without restriction, including without limitation the rights
60
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
61
+ copies of the Software, and to permit persons to whom the Software is
62
+ furnished to do so, subject to the following conditions:
63
+
64
+ The above copyright notice and this permission notice shall be included in all
65
+ copies or substantial portions of the Software.
66
+
67
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
68
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
69
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
70
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
71
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
72
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
73
+ SOFTWARE.
74
+
75
+ ---
76
+
77
+ globals
78
+
79
+ MIT License
80
+
81
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
82
+
83
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
84
+
85
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
86
+
87
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,79 @@
1
1
  # @r_masseater/h56m
2
2
 
3
- This version only reserves the name. Use a later version.
3
+ <img src="logo.svg" alt="h56m logo" width="256">
4
+
5
+ A secret scanner written in Rust and configured from `vite.config.ts`.
6
+
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 [@r_masseater/h56m-presets](https://www.npmjs.com/package/@r_masseater/h56m-presets)
11
+ or a TOML file of your own. It scans the commits a branch adds, the staged changes, a
12
+ tree, or any text. It does not call the services the secrets belong to.
13
+
14
+ ```ts
15
+ import "@r_masseater/h56m/vite";
16
+ import { betterleaks } from "@r_masseater/h56m-presets";
17
+ import { defineConfig } from "vite-plus";
18
+
19
+ export default defineConfig({
20
+ h56m: {
21
+ extend: { path: betterleaks, disabledRules: ["generic-api-key"] },
22
+ filter: 'matchesAny(attributes["path"], [`^fixtures/`])',
23
+ rules: [{ id: "my-token", regex: "\\b(my_[A-Za-z0-9]{20})\\b", keywords: ["my_"] }],
24
+ },
25
+ });
26
+ ```
27
+
28
+ Run `h56m` to scan the commits since the default branch, or `h56m --staged`
29
+ to scan the index. Call `makeDetector` to scan text from code.
30
+
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
+ ## Comparison
40
+
41
+ Measured on 2026-11-19 on linux x64, 4 CPUs with [lint-bench](https://github.com/masseater/masseater.dev/tree/main/tools/lint-bench), which keeps the full results in [results.md](https://github.com/masseater/masseater.dev/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.
42
+
43
+ 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.
44
+
45
+ ### masseater.dev
46
+
47
+ | Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
48
+ | ----------- | ----------------------------------- | ------ | --------------- | -------- | -------- | ------------ | --------- | ----------- |
49
+ | Betterleaks | 2.0.0-rc.9 | 369 ms | 328 ms ± 29 ms | 82 MB | 1 | 1 | 0 | 0 |
50
+ | gitleaks | 8.30.1 | 805 ms | 652 ms ± 25 ms | 63 MB | 1 | | | |
51
+ | **h56m** | workspace, h56m-presets betterleaks | 1.03 s | 740 ms ± 19 ms | 254 MB | 1 | | | |
52
+ | Kingfisher | 2.19.1 | 9.10 s | 740 ms ± 20 ms | 178 MB | 0 | | | |
53
+ | TruffleHog | 3.99.9 | 5.96 s | 9.89 s ± 477 ms | 185 MB | 0 | | | |
54
+
55
+ - h56m: Commits from the base to HEAD, Betterleaks default rules, no live validation
56
+ - Betterleaks: Commits from the base to HEAD, Betterleaks default rules, no live validation
57
+ - gitleaks: Commits from the base to HEAD, gitleaks default rules
58
+ - TruffleHog: Commits from the base to HEAD, all detectors, --no-verification
59
+ - Kingfisher: Commits from the base to HEAD, default rules, --no-validate
60
+
61
+ ### nodejs/node
62
+
63
+ | Tool | Version | Cold | Warm | Peak RSS | Findings | Same as ours | Only ours | Only theirs |
64
+ | ----------- | ----------------------------------- | ------- | ---------------- | -------- | -------- | ------------ | --------- | ----------- |
65
+ | Betterleaks | 2.0.0-rc.9 | 722 ms | 674 ms ± 23 ms | 387 MB | 0 | 0 | 0 | 0 |
66
+ | gitleaks | 8.30.1 | 1.31 s | 1.18 s ± 51 ms | 72 MB | 3 | | | |
67
+ | Kingfisher | 2.19.1 | 9.92 s | 1.36 s ± 41 ms | 204 MB | 0 | | | |
68
+ | **h56m** | workspace, h56m-presets betterleaks | 2.19 s | 1.96 s ± 36 ms | 436 MB | 0 | | | |
69
+ | TruffleHog | 3.99.9 | 14.07 s | 30.49 s ± 1.67 s | 185 MB | 0 | | | |
70
+
71
+ - h56m: Commits from the base to HEAD, Betterleaks default rules, no live validation
72
+ - Betterleaks: Commits from the base to HEAD, Betterleaks default rules, no live validation
73
+ - gitleaks: Commits from the base to HEAD, gitleaks default rules
74
+ - TruffleHog: Commits from the base to HEAD, all detectors, --no-verification
75
+ - Kingfisher: Commits from the base to HEAD, default rules, --no-validate
76
+
77
+ ## Agent skills
78
+
79
+ The package ships TanStack Intent skills for coding agents. Load one with `vp exec intent load @r_masseater/h56m#<skill>`.