hullproof 0.0.0-stage → 0.5.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.
Files changed (363) hide show
  1. package/LICENSE +222 -0
  2. package/NOTICE +32 -0
  3. package/README.md +313 -2
  4. package/checks/db.firebase-rules-not-open.json +24 -0
  5. package/checks/db.rls-every-table.json +25 -0
  6. package/checks/log.no-credential-in-logs.json +30 -0
  7. package/checks/secrets.no-env-file-committed.json +31 -0
  8. package/checks/secrets.no-secret-in-public-env.json +37 -0
  9. package/checks/storage.firebase-rules-not-open.json +22 -0
  10. package/checks/supply.no-untrusted-event-in-run.json +23 -0
  11. package/checks/web.cors-no-reflected-origin.json +31 -0
  12. package/detectors/ai.json +25 -0
  13. package/detectors/auth.json +27 -0
  14. package/detectors/ci.json +19 -0
  15. package/detectors/containers.json +8 -0
  16. package/detectors/data_stores.json +38 -0
  17. package/detectors/frameworks.json +94 -0
  18. package/detectors/hosting.json +44 -0
  19. package/detectors/iac.json +43 -0
  20. package/detectors/languages.json +48 -0
  21. package/detectors/mobile.json +22 -0
  22. package/detectors/package_managers.json +39 -0
  23. package/detectors/payments.json +19 -0
  24. package/detectors/runtimes.json +17 -0
  25. package/dist/checks/code/admin-role.js +46 -0
  26. package/dist/checks/code/owner-filter.js +91 -0
  27. package/dist/checks/code/shared.js +84 -0
  28. package/dist/checks/code/webhook-verify.js +77 -0
  29. package/dist/checks/context.js +64 -0
  30. package/dist/checks/map/config-checks.js +74 -0
  31. package/dist/checks/map/entry-checks.js +97 -0
  32. package/dist/checks/map/shared.js +44 -0
  33. package/dist/checks/ops.js +307 -0
  34. package/dist/checks/pro-map.js +1 -0
  35. package/dist/checks/run.js +92 -0
  36. package/dist/checks/types.js +1 -0
  37. package/dist/ci/comment.js +44 -0
  38. package/dist/ci/sarif-check.js +157 -0
  39. package/dist/ci/sarif.js +61 -0
  40. package/dist/cli.js +358 -0
  41. package/dist/commands/ci.js +115 -0
  42. package/dist/commands/git.js +58 -0
  43. package/dist/commands/hooks.js +30 -0
  44. package/dist/commands/hunt-pro.js +1 -0
  45. package/dist/commands/hunt.js +86 -0
  46. package/dist/commands/map.js +33 -0
  47. package/dist/commands/mcp.js +17 -0
  48. package/dist/commands/pack.js +48 -0
  49. package/dist/commands/prove-pro.js +1 -0
  50. package/dist/commands/prove.js +173 -0
  51. package/dist/commands/report-gate.js +92 -0
  52. package/dist/commands/scan.js +158 -0
  53. package/dist/confirm/agreement.js +18 -0
  54. package/dist/confirm/chain.js +84 -0
  55. package/dist/confirm/confirm.js +112 -0
  56. package/dist/confirm/honesty.js +75 -0
  57. package/dist/confirm/lead.js +92 -0
  58. package/dist/confirm/merge.js +88 -0
  59. package/dist/confirm/query.js +145 -0
  60. package/dist/confirm/rule.js +86 -0
  61. package/dist/confirm/store.js +42 -0
  62. package/dist/confirm/summary.js +6 -0
  63. package/dist/confirm/synthesis.js +28 -0
  64. package/dist/discover/detectors.js +50 -0
  65. package/dist/discover/discover.js +270 -0
  66. package/dist/discover/extract.js +282 -0
  67. package/dist/discover/git.js +40 -0
  68. package/dist/discover/kit-files.js +47 -0
  69. package/dist/discover/walk.js +110 -0
  70. package/dist/env.js +57 -0
  71. package/dist/gate/gate.js +173 -0
  72. package/dist/hooks/install.js +153 -0
  73. package/dist/hooks/run.js +112 -0
  74. package/dist/map/analyze.js +201 -0
  75. package/dist/map/build.js +253 -0
  76. package/dist/map/candidates.js +49 -0
  77. package/dist/map/cblocks.js +77 -0
  78. package/dist/map/config.js +291 -0
  79. package/dist/map/dotnet.js +242 -0
  80. package/dist/map/entry.js +78 -0
  81. package/dist/map/expo.js +190 -0
  82. package/dist/map/go.js +292 -0
  83. package/dist/map/js-express.js +143 -0
  84. package/dist/map/js-misc.js +295 -0
  85. package/dist/map/js-next.js +292 -0
  86. package/dist/map/laravel.js +389 -0
  87. package/dist/map/lex-more.js +305 -0
  88. package/dist/map/lex.js +425 -0
  89. package/dist/map/light-index.js +191 -0
  90. package/dist/map/light-profiles.js +324 -0
  91. package/dist/map/light.js +574 -0
  92. package/dist/map/local-vocab.js +27 -0
  93. package/dist/map/mobile.js +326 -0
  94. package/dist/map/py-django.js +281 -0
  95. package/dist/map/py.js +391 -0
  96. package/dist/map/rails.js +391 -0
  97. package/dist/map/repo.js +178 -0
  98. package/dist/map/rust.js +312 -0
  99. package/dist/map/spring.js +207 -0
  100. package/dist/map/taint.js +96 -0
  101. package/dist/map/touches.js +355 -0
  102. package/dist/map/vocab.js +88 -0
  103. package/dist/mapping/controls.js +34 -0
  104. package/dist/mapping/dependency-policy.js +44 -0
  105. package/dist/mapping/map.js +44 -0
  106. package/dist/mapping/maps/gitleaks.json +12 -0
  107. package/dist/mapping/maps/osv-scanner.json +7 -0
  108. package/dist/mapping/maps/trivy.json +13 -0
  109. package/dist/mcp/confine.js +59 -0
  110. package/dist/mcp/protocol.js +140 -0
  111. package/dist/mcp/schema.js +43 -0
  112. package/dist/mcp/server.js +37 -0
  113. package/dist/mcp/tools.js +238 -0
  114. package/dist/packs/coverage.js +79 -0
  115. package/dist/packs/manifest.js +36 -0
  116. package/dist/packs/validate.js +271 -0
  117. package/dist/prove/container.js +276 -0
  118. package/dist/prove/exec-main.js +20 -0
  119. package/dist/prove/executor.js +149 -0
  120. package/dist/prove/local.js +131 -0
  121. package/dist/prove/probes.js +65 -0
  122. package/dist/prove/recipe.js +278 -0
  123. package/dist/prove/run.js +136 -0
  124. package/dist/prove/runner.js +1 -0
  125. package/dist/prove/safety.js +126 -0
  126. package/dist/prove/spec.js +357 -0
  127. package/dist/prove/store.js +65 -0
  128. package/dist/report/build.js +297 -0
  129. package/dist/report/entry-points.js +75 -0
  130. package/dist/report/hunt-section.js +71 -0
  131. package/dist/report/kit.js +41 -0
  132. package/dist/report/load.js +35 -0
  133. package/dist/report/messages.js +273 -0
  134. package/dist/report/prove-section.js +65 -0
  135. package/dist/report/report.js +156 -0
  136. package/dist/report/surface.js +21 -0
  137. package/dist/report/test-code.js +51 -0
  138. package/dist/report/tiers.js +44 -0
  139. package/dist/scanners/common.js +162 -0
  140. package/dist/scanners/gitleaks.js +90 -0
  141. package/dist/scanners/index.js +113 -0
  142. package/dist/scanners/osv-scanner.js +77 -0
  143. package/dist/scanners/run-targets.js +34 -0
  144. package/dist/scanners/secret-noise.js +89 -0
  145. package/dist/scanners/semgrep.js +142 -0
  146. package/dist/scanners/trivy.js +65 -0
  147. package/dist/scanners/types.js +1 -0
  148. package/dist/types/check.js +1 -0
  149. package/dist/types/codemap.js +1 -0
  150. package/dist/types/findings.js +5 -0
  151. package/dist/types/hunt.js +1 -0
  152. package/dist/types/index.js +1 -0
  153. package/dist/types/prove.js +1 -0
  154. package/dist/types/results.js +2 -0
  155. package/dist/types/scan.js +1 -0
  156. package/dist/types/stack.js +5 -0
  157. package/dist/util.js +71 -0
  158. package/dist/version.js +2 -0
  159. package/package.json +46 -4
  160. package/packs/android/fixture-result.json +43 -0
  161. package/packs/android/pack.json +56 -0
  162. package/packs/dotnet/fixture-result.json +62 -0
  163. package/packs/dotnet/pack.json +88 -0
  164. package/packs/expo/answer-key.json +51 -0
  165. package/packs/expo/fixture-result.json +62 -0
  166. package/packs/expo/pack.json +79 -0
  167. package/packs/firebase/answer-key.json +27 -0
  168. package/packs/firebase/fixture-result.json +43 -0
  169. package/packs/firebase/pack.json +58 -0
  170. package/packs/go/answer-key.json +101 -0
  171. package/packs/go/fixture-result.json +64 -0
  172. package/packs/go/pack.json +99 -0
  173. package/packs/ios/fixture-result.json +43 -0
  174. package/packs/ios/pack.json +55 -0
  175. package/packs/laravel/answer-key.json +84 -0
  176. package/packs/laravel/fixture-result.json +60 -0
  177. package/packs/laravel/pack.json +91 -0
  178. package/packs/node-ts/answer-key.json +220 -0
  179. package/packs/node-ts/fixture-result.json +114 -0
  180. package/packs/node-ts/pack.json +134 -0
  181. package/packs/python/answer-key.json +195 -0
  182. package/packs/python/fixture-result.json +119 -0
  183. package/packs/python/pack.json +121 -0
  184. package/packs/rails/answer-key.json +84 -0
  185. package/packs/rails/fixture-result.json +60 -0
  186. package/packs/rails/pack.json +78 -0
  187. package/packs/rust/fixture-result.json +43 -0
  188. package/packs/rust/pack.json +69 -0
  189. package/packs/spring/fixture-result.json +63 -0
  190. package/packs/spring/pack.json +103 -0
  191. package/packs/supabase/answer-key.json +52 -0
  192. package/packs/supabase/fixture-result.json +58 -0
  193. package/packs/supabase/pack.json +60 -0
  194. package/rules/gitleaks.toml +256 -0
  195. package/rules/semgrep/api-route-no-auth.yaml +31 -0
  196. package/rules/semgrep/cors-reflect-origin.yaml +48 -0
  197. package/rules/semgrep/eval-or-new-function.yaml +185 -0
  198. package/rules/semgrep/log-session-token.yaml +48 -0
  199. package/rules/semgrep/math-random-tokens.yaml +24 -0
  200. package/rules/semgrep/next-public-secret-name.yaml +32 -0
  201. package/rules/semgrep/postgrest-filter-injection.yaml +78 -0
  202. package/rules/semgrep/raw-sql-concat.yaml +42 -0
  203. package/rules/semgrep/read-by-id-no-owner.yaml +49 -0
  204. package/rules/semgrep/server-action-no-auth.yaml +26 -0
  205. package/rules/semgrep/sql-variants.yaml +99 -0
  206. package/rules/semgrep/ssrf-unguarded-url.yaml +137 -0
  207. package/rules/semgrep/subprocess-injection.yaml +163 -0
  208. package/rules/semgrep/taint-go.yaml +333 -0
  209. package/rules/semgrep/taint-java.yaml +317 -0
  210. package/rules/semgrep/taint-javascript.yaml +412 -0
  211. package/rules/semgrep/taint-php.yaml +361 -0
  212. package/rules/semgrep/taint-python.yaml +414 -0
  213. package/rules/semgrep/tool-endpoint-admin-client.yaml +86 -0
  214. package/rules/semgrep/user-metadata-authz.yaml +22 -0
  215. package/rules/semgrep/verify-result-unused.yaml +62 -0
  216. package/rules/semgrep/webhook-parse-before-verify.yaml +29 -0
  217. package/rules/test-artifact-ids.json +4 -0
  218. package/rules/tiers.json +427 -0
  219. package/schemas/check-results.schema.json +55 -0
  220. package/schemas/check.schema.json +41 -0
  221. package/schemas/codemap.schema.json +216 -0
  222. package/schemas/findings.schema.json +1048 -0
  223. package/schemas/hunt-output.schema.json +46 -0
  224. package/schemas/hunt-result.schema.json +58 -0
  225. package/schemas/results.schema.json +17 -0
  226. package/schemas/scan-hits.schema.json +32 -0
  227. package/schemas/scan-meta.schema.json +25 -0
  228. package/schemas/stack.schema.json +93 -0
  229. package/src/checks/README.md +32 -0
  230. package/src/checks/code/admin-role.ts +49 -0
  231. package/src/checks/code/owner-filter.ts +95 -0
  232. package/src/checks/code/shared.ts +66 -0
  233. package/src/checks/code/webhook-verify.ts +75 -0
  234. package/src/checks/context.ts +72 -0
  235. package/src/checks/map/config-checks.ts +79 -0
  236. package/src/checks/map/entry-checks.ts +116 -0
  237. package/src/checks/map/shared.ts +63 -0
  238. package/src/checks/ops.ts +280 -0
  239. package/src/checks/pro-map.ts +4 -0
  240. package/src/checks/run.ts +80 -0
  241. package/src/checks/types.ts +12 -0
  242. package/src/ci/comment.ts +52 -0
  243. package/src/ci/sarif-check.ts +100 -0
  244. package/src/ci/sarif.ts +72 -0
  245. package/src/cli.ts +273 -0
  246. package/src/commands/ci.ts +104 -0
  247. package/src/commands/git.ts +59 -0
  248. package/src/commands/hooks.ts +27 -0
  249. package/src/commands/hunt-pro.ts +4 -0
  250. package/src/commands/hunt.ts +68 -0
  251. package/src/commands/map.ts +27 -0
  252. package/src/commands/mcp.ts +18 -0
  253. package/src/commands/pack.ts +34 -0
  254. package/src/commands/prove-pro.ts +4 -0
  255. package/src/commands/prove.ts +126 -0
  256. package/src/commands/report-gate.ts +75 -0
  257. package/src/commands/scan.ts +156 -0
  258. package/src/confirm/agreement.ts +23 -0
  259. package/src/confirm/chain.ts +67 -0
  260. package/src/confirm/confirm.ts +107 -0
  261. package/src/confirm/honesty.ts +65 -0
  262. package/src/confirm/lead.ts +76 -0
  263. package/src/confirm/merge.ts +89 -0
  264. package/src/confirm/query.ts +126 -0
  265. package/src/confirm/rule.ts +76 -0
  266. package/src/confirm/store.ts +42 -0
  267. package/src/confirm/summary.ts +9 -0
  268. package/src/confirm/synthesis.ts +33 -0
  269. package/src/discover/detectors.ts +71 -0
  270. package/src/discover/discover.ts +253 -0
  271. package/src/discover/extract.ts +235 -0
  272. package/src/discover/git.ts +31 -0
  273. package/src/discover/kit-files.ts +37 -0
  274. package/src/discover/walk.ts +88 -0
  275. package/src/env.ts +51 -0
  276. package/src/gate/gate.ts +169 -0
  277. package/src/hooks/install.ts +142 -0
  278. package/src/hooks/run.ts +121 -0
  279. package/src/map/analyze.ts +219 -0
  280. package/src/map/build.ts +206 -0
  281. package/src/map/candidates.ts +47 -0
  282. package/src/map/cblocks.ts +55 -0
  283. package/src/map/config.ts +207 -0
  284. package/src/map/dotnet.ts +205 -0
  285. package/src/map/entry.ts +80 -0
  286. package/src/map/expo.ts +171 -0
  287. package/src/map/go.ts +271 -0
  288. package/src/map/js-express.ts +135 -0
  289. package/src/map/js-misc.ts +221 -0
  290. package/src/map/js-next.ts +282 -0
  291. package/src/map/laravel.ts +327 -0
  292. package/src/map/lex-more.ts +152 -0
  293. package/src/map/lex.ts +274 -0
  294. package/src/map/light-index.ts +134 -0
  295. package/src/map/light-profiles.ts +363 -0
  296. package/src/map/light.ts +484 -0
  297. package/src/map/local-vocab.ts +30 -0
  298. package/src/map/mobile.ts +263 -0
  299. package/src/map/py-django.ts +239 -0
  300. package/src/map/py.ts +329 -0
  301. package/src/map/rails.ts +291 -0
  302. package/src/map/repo.ts +150 -0
  303. package/src/map/rust.ts +256 -0
  304. package/src/map/spring.ts +185 -0
  305. package/src/map/taint.ts +86 -0
  306. package/src/map/touches.ts +296 -0
  307. package/src/map/vocab.ts +106 -0
  308. package/src/mapping/controls.ts +47 -0
  309. package/src/mapping/dependency-policy.ts +55 -0
  310. package/src/mapping/map.ts +59 -0
  311. package/src/mapping/maps/gitleaks.json +12 -0
  312. package/src/mapping/maps/osv-scanner.json +7 -0
  313. package/src/mapping/maps/trivy.json +13 -0
  314. package/src/mcp/confine.ts +44 -0
  315. package/src/mcp/protocol.ts +144 -0
  316. package/src/mcp/schema.ts +35 -0
  317. package/src/mcp/server.ts +32 -0
  318. package/src/mcp/tools.ts +235 -0
  319. package/src/packs/coverage.ts +98 -0
  320. package/src/packs/manifest.ts +97 -0
  321. package/src/packs/validate.ts +204 -0
  322. package/src/prove/container.ts +237 -0
  323. package/src/prove/exec-main.ts +16 -0
  324. package/src/prove/executor.ts +130 -0
  325. package/src/prove/local.ts +100 -0
  326. package/src/prove/probes.ts +68 -0
  327. package/src/prove/recipe.ts +215 -0
  328. package/src/prove/run.ts +124 -0
  329. package/src/prove/runner.ts +28 -0
  330. package/src/prove/safety.ts +98 -0
  331. package/src/prove/spec.ts +256 -0
  332. package/src/prove/store.ts +48 -0
  333. package/src/report/build.ts +304 -0
  334. package/src/report/entry-points.ts +78 -0
  335. package/src/report/hunt-section.ts +67 -0
  336. package/src/report/kit.ts +59 -0
  337. package/src/report/load.ts +49 -0
  338. package/src/report/messages.ts +270 -0
  339. package/src/report/prove-section.ts +61 -0
  340. package/src/report/report.ts +160 -0
  341. package/src/report/surface.ts +32 -0
  342. package/src/report/test-code.ts +56 -0
  343. package/src/report/tiers.ts +50 -0
  344. package/src/scanners/common.ts +149 -0
  345. package/src/scanners/gitleaks.ts +89 -0
  346. package/src/scanners/index.ts +103 -0
  347. package/src/scanners/osv-scanner.ts +90 -0
  348. package/src/scanners/run-targets.ts +35 -0
  349. package/src/scanners/secret-noise.ts +80 -0
  350. package/src/scanners/semgrep.ts +139 -0
  351. package/src/scanners/trivy.ts +66 -0
  352. package/src/scanners/types.ts +98 -0
  353. package/src/types/check.ts +52 -0
  354. package/src/types/codemap.ts +142 -0
  355. package/src/types/findings.ts +107 -0
  356. package/src/types/hunt.ts +97 -0
  357. package/src/types/index.ts +10 -0
  358. package/src/types/prove.ts +83 -0
  359. package/src/types/results.ts +15 -0
  360. package/src/types/scan.ts +63 -0
  361. package/src/types/stack.ts +61 -0
  362. package/src/util.ts +59 -0
  363. package/src/version.ts +2 -0
package/LICENSE ADDED
@@ -0,0 +1,222 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+
205
+
206
+ =======================================================================
207
+ Notice for this project (appendix style, see "How to apply the Apache License to your work" above)
208
+ =======================================================================
209
+
210
+ Copyright 2026 Rare Phronesis Limited
211
+
212
+ Licensed under the Apache License, Version 2.0 (the "License");
213
+ you may not use this file except in compliance with the License.
214
+ You may obtain a copy of the License at
215
+
216
+ http://www.apache.org/licenses/LICENSE-2.0
217
+
218
+ Unless required by applicable law or agreed to in writing, software
219
+ distributed under the License is distributed on an "AS IS" BASIS,
220
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
221
+ See the License for the specific language governing permissions and
222
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,32 @@
1
+ Hullproof Engine
2
+ Copyright 2026 Rare Phronesis Limited
3
+
4
+ This product is licensed under the Apache License, Version 2.0. The full text is in the LICENSE file.
5
+
6
+ Hullproof is an independent project. It is not affiliated with or endorsed by Semgrep, Gitleaks, OSV, Trivy, OWASP or any other organisation or vendor named in this repository. The Apache License 2.0 does not give you rights to the Hullproof name.
7
+
8
+ External scanners
9
+
10
+ The engine calls these programs when they are installed on your machine. It does not bundle, copy, modify or install any of them, and it does not copy their rule sets or databases. You get each one from its own project and use it under its own licence.
11
+
12
+ 1. Semgrep (the open source command line program). Licence: LGPL-2.1-only. https://semgrep.dev and https://github.com/semgrep/semgrep
13
+ 2. Gitleaks. Licence: MIT. https://github.com/gitleaks/gitleaks
14
+ 3. OSV Scanner. Licence: Apache-2.0. https://github.com/google/osv-scanner
15
+ 4. Trivy. Licence: Apache-2.0. https://github.com/aquasecurity/trivy
16
+
17
+ Licences are as listed by the Homebrew formula for each program on 2026-10-11. Check the project itself for the current terms.
18
+
19
+ Rules in this repository
20
+
21
+ 1. The files in `rules/semgrep/` named taint-go, taint-java, taint-javascript, taint-php and taint-python were written for this engine from the CWE definitions named in each rule. No rule from the Semgrep registry was copied or used as a base.
22
+ 2. The other Semgrep rule files in `rules/semgrep/` were written for Hullproof and are copied from the Hullproof Free kit (https://github.com/jt247/hullproof-free), which is Apache-2.0 and has the same owner.
23
+ 3. `rules/gitleaks.toml` is copied from the same kit. It extends the default Gitleaks rules (MIT, the Gitleaks authors) and adds secret shapes for the default stack of Hullproof.
24
+ 4. The Trivy and OSV Scanner mapping tables in `src/mapping/maps/` were built by running each tool and reading its own output. Their rule ids are facts about those tools, kept here so a hit can be mapped to a Hullproof requirement.
25
+
26
+ Benchmark material
27
+
28
+ The benchmark files in `bench/` describe runs on public vulnerable projects and on the Hullproof demo repository (https://github.com/jt247/hullproof-demo). No code from those projects is included in this repository. The project names and licences are listed in the benchmark files themselves.
29
+
30
+ The Hullproof requirements
31
+
32
+ The requirement texts and the controls file are not part of this repository. They live in the Hullproof Free kit, which carries its own licences (see its LICENSING.md).
package/README.md CHANGED
@@ -1,3 +1,314 @@
1
- # Temporary Holding Version
1
+ # Hullproof Engine
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Hullproof Engine reads a repository built with AI coding tools, works out what the app is made of, runs proven scanners and executable checks against it, and writes a report and a release gate result. The same commit, the same engine and the same tool versions give the same bytes, every run.
4
+
5
+ It is made for people who build apps with AI coding tools and want a repeatable answer to one question: what does this repository show, before I ship it?
6
+
7
+ It is not a general purpose scanner, and it does not wrap a language model. No model runs anywhere in it. It is a deterministic engine in five steps:
8
+
9
+ 1. Discover the stack. It finds the languages, frameworks, data stores, auth and payment providers, AI providers, hosting, cloud and CI setup from the files, and records the file and line that proved each one. What it sees and cannot name is listed as unknown. It does not guess.
10
+ 2. Map the code. It lists every entry point it can find (HTTP routes, webhooks, server actions, jobs, AI tools and similar), with the file and line of each, what protects it (a session read, a role check, an owner filter, a signature check, a rate limit, a schema) and which data stores and outbound calls it touches. Each fact carries a confidence. Where it cannot read a language, the report says the map is incomplete for it.
11
+ 3. Run the scanners you already have installed (Semgrep, Gitleaks, OSV Scanner and Trivy) and its own executable checks, which read the repository files and the code map and say exactly what they saw and where.
12
+ 4. Map every result to a Hullproof requirement ID, using the requirements in the Hullproof Free kit.
13
+ 5. Write a report in plain English and a release gate result. A requirement that nothing settled is listed as NOT ASSESSED with what would settle it. It is never reported as a pass.
14
+
15
+ The engine is open under the Apache License 2.0. Release 0.5.0 comes as a zip on the GitHub releases page of this repository.
16
+
17
+ **The one stop for everything is the Hullproof Free repository, https://github.com/jt247/hullproof-free.** It holds this engine in its `engine/` folder, the kit in `kit/`, the upload pack in `pack/`, setup instructions written for an AI tool (`AI-SETUP.md`) and the Free zip. Clone that one repository and you have everything. This repository holds only the engine.
18
+
19
+ ## Requirements
20
+
21
+ 1. Node 22.18 or later. Node runs the TypeScript source directly, so there is no build step and nothing to install to run the engine. It has no runtime dependencies.
22
+ 2. Git, and a repository with at least one commit. Results are tied to the commit.
23
+ 3. The Hullproof Free kit from https://github.com/jt247/hullproof-free. The engine reads the requirement IDs and severities from the kit's controls file, runs the kit's release gate, and checks its own findings record with the kit's validator. The engine does not copy any of these files.
24
+ 4. Any of these scanners that you want used: Semgrep, Gitleaks, OSV Scanner and Trivy. The engine detects what is on your machine and never installs anything. A scanner that is missing is listed in the report as not run, and the requirements it would have settled stay NOT ASSESSED. The versions the engine was tested with are Semgrep 1.176.x, Gitleaks 8.30.x, OSV Scanner 2.6.x and Trivy 0.75.x. A different version still runs, and the report marks it as not a tested version.
25
+
26
+ ## Quick start
27
+
28
+ Get the engine and the Free kit outside the project you want to check. The simplest way is the Free repository, which holds both:
29
+
30
+ ```
31
+ git clone https://github.com/jt247/hullproof-free.git
32
+ ```
33
+
34
+ Then, from the root of your project:
35
+
36
+ ```
37
+ ENGINE=/path/to/hullproof-free/engine
38
+ KIT=/path/to/hullproof-free/kit
39
+
40
+ node $ENGINE/src/cli.ts discover .
41
+ node $ENGINE/src/cli.ts map .
42
+ node $ENGINE/src/cli.ts scan . --kit $KIT --edition free --rule-pack $KIT/tools/hullproof/rules
43
+ node $ENGINE/src/cli.ts report .
44
+ node $ENGINE/src/cli.ts gate .
45
+ ```
46
+
47
+ Or in one step, which also writes the SARIF file and a pull request comment (see CI below): `node $ENGINE/src/cli.ts ci . --kit $KIT --edition free`.
48
+
49
+ If you cloned this repository on its own, set `ENGINE` to it and clone `hullproof-free` beside it for the kit.
50
+
51
+ What each command does:
52
+
53
+ 1. `discover` writes `.hullproof/stack.json`. It only reads files. It runs no program and uses no network.
54
+ 2. `map` writes `.hullproof/codemap.json`, the entry points of the repository and what protects each one. It needs no kit and no scanner, and `scan` runs it for you.
55
+ 3. `scan` runs discovery, the code map, the scanners and the checks, and writes everything for the current commit to `.hullproof/<commit>/`. It refuses a repository whose git configuration could run code. The `--rule-pack` option adds the Semgrep rules of the Free kit to the rules the engine carries itself. Leave it out and only the engine's own rules run.
56
+ 4. `report` writes `report.md` in that folder.
57
+ 5. `gate` applies the release gate and prints NOT READY, READY WITH ACCEPTED RISK or READY.
58
+
59
+ `report` and `gate` find the kit the scan used, so `--kit` is only needed on `scan`. Add `.hullproof/` to your `.gitignore`, because the report lists failures that someone could exploit.
60
+
61
+ A scan of files alone ends NOT READY on every project. Most BLOCKER and CRITICAL requirements are settled by evidence that is not in the code, such as a provider dashboard export or a test against the running app. The gate section below says how that evidence is supplied.
62
+
63
+ You can also copy the kit into your project, the way the Free kit's own install does (`cp -Rn path/to/hullproof-free/kit/. .`). The engine then finds it without `--kit`. Kit files in your project that are still byte for byte what the kit's manifest says are left out of the scan, because they hold planted test samples; the list is taken from the kit given with `--kit` (or `HULLPROOF_KIT`), never from a manifest inside the scanned project, and a file you changed is scanned. The scan log says how many files were left out. If the engine finds the kit only inside the project itself, it leaves nothing out, and keeping the kit in a separate folder gives a cleaner report.
64
+
65
+ ## How the engine finds the kit
66
+
67
+ In this order:
68
+
69
+ 1. The `--kit` option.
70
+ 2. The `HULLPROOF_KIT` environment variable.
71
+ 3. The scanned repository itself, when the kit is installed in it.
72
+ 4. A folder called `hullproof-free/kit` next to the engine folder.
73
+
74
+ A folder counts as a kit when it holds `docs/hullproof/security-controls.json`. `--edition free|pro` picks which requirements are in scope. With the Free kit use `free`. `--stage LAUNCH|GROWTH|SCALE` picks the stage, and the default is `docs/security/STAGE.md` in your project, else LAUNCH.
75
+
76
+ ## What it writes
77
+
78
+ `scan` writes these files to `.hullproof/<commit>/` (or to `--out DIR/<commit>/`):
79
+
80
+ | File | What it holds |
81
+ |---|---|
82
+ | `stack.json` | The discovered stack, with evidence |
83
+ | `scan/<tool>.json` and `.meta.json` | Each scanner's hits mapped to requirement IDs, and how the scanner was run |
84
+ | `checks.json` | The result of every executable check |
85
+ | `codemap.json` | The code map: entry points, gates, Supabase and Firebase maps, and which languages were not fully read |
86
+ | `results.json` | One row per requirement in scope, in the form the kit's gate reads |
87
+ | `report.findings.md` | The findings record, validated with the kit's validator before the scan ends |
88
+ | `surface.json`, `scan.json` | What was covered, and the run settings |
89
+ | `report.md` | The report (written by `report`) |
90
+
91
+ Every file except `run.json` and `scan/run.json` is byte identical for the same commit, engine, kit files and tool versions. Tool paths and times live only in the two `run.json` files.
92
+
93
+ The report lists findings by severity with the fix in plain words, then what could not run and why, then every requirement that nothing settled, as NOT ASSESSED, with what settles it.
94
+
95
+ ## The code map
96
+
97
+ `codemap.json` is written by `hullproof map` and by `scan`. It holds:
98
+
99
+ 1. Every entry point the engine found, with its kind (HTTP route, webhook, server action, page, AI tool, job, GraphQL resolver, RPC procedure, message consumer), framework, file and line, method and path, and a confidence.
100
+ 2. What protects each one: a session read, a role check, an owner filter, a signature check, a rate limit, a schema, an audit record. Each protection says where it sits (the handler, a wrapper, the router, a middleware or guard, or a global setting), what matched, whether a failed check stops the request, and a confidence of high, medium or low.
101
+ 3. The data stores each entry point reads and writes (SQL, Prisma, Mongoose, Supabase, Django and SQLAlchemy models and others), and its outbound calls (HTTP, AI models, email, payments, processes and redirects), with whether the value comes from the request.
102
+ 4. The Supabase tables from the migration SQL (row level security, policies, grants, columns) and the Firebase rules.
103
+ 5. A coverage table: for each language, whether an extractor read it (`mapped`), read it with a framework it does not know (`partly mapped`), or has no extractor yet (`not mapped`). A language that is not mapped gives no entry points, and the report says the map is incomplete for it instead of saying nothing.
104
+
105
+ The extractors are TypeScript written for this engine (no parser library, no runtime dependency). They cover:
106
+
107
+ 1. Node and TypeScript: Next.js route handlers, pages and server actions, Express and the Koa, Fastify and Hono style, NestJS, tRPC, cron jobs and queue workers, Supabase edge functions.
108
+ 2. Python: Flask, FastAPI, Django and REST framework, Celery and scheduler jobs.
109
+ 3. Go: net/http (including the `GET /path` patterns), chi, gin, echo, fiber and gorilla/mux, with groups, `Use`, `With`, `Route` and `Mount` followed in order.
110
+ 4. Ruby on Rails: `config/routes.rb` (resources, namespaces, scopes, member and collection routes, devise's `authenticate` blocks, mounted engines) joined to the controller actions, with the `before_action` filters each action runs, inherited from parent controllers and included concerns, minus `skip_before_action`.
111
+ 5. PHP and Laravel: `routes/*.php` (verbs, `match`, resources, groups, prefixes, `controller()` groups, closures and invokable controllers) joined to the controller methods, with route, group and controller middleware, policies, form requests and the api throttle group.
112
+ 6. Expo and React Native: Expo Router screens and API routes, the deep links in `app.json` and `app.config`, deep links handled with `Linking`, and the sign in guards in the layouts above each screen. A layout guard is a client side redirect and says so in the map; it is not a server check.
113
+ 7. Java and Spring: `@RestController` and `@Controller` classes with `@RequestMapping` and the verb mappings, joined to `@PreAuthorize`, `@Secured` and `@RolesAllowed` (counted as enforced only when `@EnableMethodSecurity` or `@EnableGlobalMethodSecurity` is in the project), the Spring Security filter chain rules (`authorizeHttpRequests` and `authorizeRequests`, first matching rule wins), the sign in default of the security starter, and what the handler body does.
114
+ 8. C# and ASP.NET Core: controllers (`[Route]`, the `[HttpGet]` family, `[controller]` tokens) and minimal APIs (`MapGet` and the others, `MapGroup`), with `[Authorize]` (roles and policies), `[AllowAnonymous]`, `RequireAuthorization` and a fallback policy.
115
+ 9. Kotlin and Android, Swift and iOS: the configuration files, not the source. `AndroidManifest.xml` (exported activities, services, receivers and providers, their permissions, deep links, the debuggable, backup and cleartext flags), the network security configuration, `Info.plist` (App Transport Security, URL schemes), the entitlements (associated domains) and secrets written into these files and into `strings.xml`. Exported components and deep links are entry points (kind `ipc` and `deep_link`). What a handler does with an incoming intent or URL is not read.
116
+ 10. Rust: `Cargo.toml` (dependency sources, release profile, lockfile) and the routes of axum (`Router::new()` chains with `route`, `nest`, `merge`, `layer` and `route_layer`) and actix web (the attribute macros), with the layers and extractor types that protect them. Handler bodies are not read.
117
+
118
+ Names the vocabulary does not know: a project can list its own sign in and role helpers in `.hullproof/kit.local.json` (`{"auth_helpers": ["requireMember"], "role_helpers": ["isBillingAdmin"]}`). A call, decorator, filter or middleware with one of those names counts as a session read or a role check with medium confidence, in every language above. `codemap.json` copies the names it used, and it lists the names that look like sign in helpers and were not recognised (`config.auth_helper_candidates`) so you know what to add.
119
+
120
+ The checks that read the map are named `check.map.*`. They decide requirements a file can settle, for example that every route that changes data has a session read, that every webhook checks its signature before it uses the event, that every admin route has a role check, and that no update by id leaves out the owner. They start as leads: the report lists them with their evidence under the leads, and they never fail a requirement or hold the gate until `rules/tiers.json` records a measured precision of 0.80 or better for them. A tier entry can also carry `needs_judged`, a number of judged findings it must reach first, and the report then says how many it has and how many it needs.
121
+
122
+ The report has a section "Entry points and what protects them" with the coverage table and one row per entry point.
123
+
124
+ ## Stack coverage
125
+
126
+ The engine does not cover every stack equally, and the report and this table say how deep it goes for each one. Every stack gets level L0. The other levels are earned: a pack declares a level, and the engine refuses to list a pack whose recorded result on its fixture app does not support that level (`hullproof pack validate`). The table below is generated from the packs and their recorded results, not typed by hand. A test keeps it equal to the generator output.
127
+
128
+ <!-- pack-coverage:start -->
129
+ | Level | What it means |
130
+ |---|---|
131
+ | L0 Generic | Secrets, dependencies, infrastructure and cloud configuration, and the generic rules. Runs on any stack. |
132
+ | L1 Detected | The stack is recognised and its configuration files are checked. |
133
+ | L2 Mapped | Entry points and what protects them are written to the code map. |
134
+ | L3 Checked | Executable checks and stack rules, measured on a fixture with a blind answer key. |
135
+ | L4 Provable | A start recipe, so the proof sandbox can run the app and prove a flaw. |
136
+
137
+ | Stack | Level | Higher level for | Measured on | Not covered |
138
+ |---|---|---|---|---|
139
+ | Node and TypeScript | L3 Checked | L4 for Express with SQLite | flaws on a demo app, counted over all its stacks with a blind answer key, route sample on 2 real apps | Planted flaws were not measured on a real application. Routes that a library creates at run time and socket.io handlers are not read. A handler that passes the request to a helper which checks a secret is not followed. |
140
+ | Python | L3 Checked | L4 for Flask with SQLite | flaws on a synthetic app with a blind answer key, route sample on 2 real apps | Flask, FastAPI and Django are read; other Python frameworks are not. Planted flaws were not measured on a real application. A view that dispatches by method to decorated functions shows no protection. |
141
+ | Supabase | L3 Checked | none | flaws on a demo app, counted over all its stacks with a blind answer key, map on a synthetic app | Policies and grants are read from migration files, not from a live database. |
142
+ | .NET and ASP.NET Core | L2 Mapped | none | flaws on a synthetic app with a blind answer key, route sample on 1 real app | Conventional routing (MapControllerRoute) is not read. Planted flaws were not measured on a real application. |
143
+ | Expo and React Native | L2 Mapped | none | flaws on a synthetic app, no blind key, route sample on 1 real app | Planted flaws were not measured on a real application. The one real app has 8 screens. A layout guard is a client side redirect. |
144
+ | Firebase | L2 Mapped | none | flaws on a synthetic app, no blind key | Rules are read from files, not from a live project. |
145
+ | Go | L2 Mapped | none | flaws on a synthetic app, no blind key, route sample on 1 real app | Planted flaws were not measured on a real application. Routes that a Go library builds at run time are not read. |
146
+ | Java and Spring | L2 Mapped | none | flaws on a synthetic app with a blind answer key, route sample on 1 real app | Routes built in code (RouterFunction) and Kotlin Spring apps are not read. Planted flaws were not measured on a real application. |
147
+ | Kotlin and Android | L2 Mapped | none | flaws on a synthetic app with a blind answer key | Kotlin and Java source is not read, so what a handler does with an incoming intent is not in the map. |
148
+ | PHP and Laravel | L2 Mapped | none | flaws on a synthetic app, no blind key, route sample on 1 real app | Planted flaws were not measured on a real application. |
149
+ | Ruby on Rails | L2 Mapped | none | flaws on a synthetic app, no blind key, route sample on 1 real app | Planted flaws were not measured on a real application. A filter that only looks a user up is told apart from one that blocks a guest by reading its body, which other shapes of filter may defeat. |
150
+ | Rust | L2 Mapped | none | flaws on a synthetic app with a blind answer key | Handler bodies are not read, so data store and outbound call checks stay silent for Rust. |
151
+ | Swift and iOS | L2 Mapped | none | flaws on a synthetic app with a blind answer key | Swift source is not read, so what a handler does with an incoming URL is not in the map. |
152
+ <!-- pack-coverage:end -->
153
+
154
+ How to read it: each level was measured on the fixture named in the last column. A synthetic app was written for this engine, its answer key sits in the repository, and the result only shows that the extractor reads what the author expected. A blind answer key was written before the run and kept apart from the engine, which is the evidence that a level of L3 needs. False findings are counted on the fixed copy of the app where there is one, and judged by hand on the planted app where there is none (the demo). A route sample on real apps means that a seeded sample of the route registrations of real open source applications was found in the map, with the same bytes in three runs, to the standard `docs/PACK-GUIDE.md` sets. It tests the map and says nothing about whether flaws are found, because a real application has no planted flaws to count. Stacks with no such entry have not been tried on a real application yet. `hullproof pack table` prints the same table with the measured figures, and `docs/PACK-GUIDE.md` explains how a pack is built and measured.
155
+
156
+ ## Confirming leads that a model proposed
157
+
158
+ The engine can take leads that a model proposed and decide what each one is worth. `hullproof hunt --replay` reads saved model answers from `.hullproof/<commit>/hunt/`. It drops every lead that cites code that is not in the repository, and it tries to confirm each remaining lead with one of two kinds of evidence a machine can run again: a query over the code map, or a Semgrep rule that must match the cited lines and must not match a safe sample. Only a confirmed lead becomes a finding, and it carries its evidence. Every other lead is listed in the report and can never change the gate verdict. The number of runs that raised a lead only orders the list. The same saved answers give the same bytes.
159
+
160
+ Nothing in this repository calls a model. The format of the saved files is in `docs/INTERFACES.md`.
161
+
162
+ ## Proving a finding in a sandbox
163
+
164
+ `hullproof prove` runs a test against a copy of the app inside a container and keeps the request and response transcripts as evidence. The test is a spec: data in a small step language, never code. A spec first runs a positive control, a request that is allowed to work, so a broken setup cannot pass for a result. Then it runs the attack steps. A flaw counts as proven only when the control passed and the attack got through in 3 runs out of 3. A proven flaw is a finding with the transcripts attached and enters the gate like any other confirmed finding. Anything else stays a lead with its reason, and an app the sandbox cannot start is reported as not provable here, never as passed.
165
+
166
+ Nothing runs without `--allow-run` and the owner's typed confirmation. The command accepts no address and never sends a request outside the sandbox. The container runs as a non root user with a read only root filesystem, no capabilities, no host mounts, limits on memory, processor and processes, and no network while tests run. No `.env` file or key is copied in; the app gets generated dummy values. The build phase can reach the package registry and installs from the lockfile with install scripts off; `--allow-install-scripts` turns them on for apps with native modules and prints a warning, because those scripts are third party code. Start recipes exist for a Node app on Express and for a Python app on Flask, each with a local SQLite file. A Python app installs from a pinned `requirements.txt` with wheels only. A container runtime that speaks the docker command line is needed (Colima, Docker Desktop or Podman). `hullproof prove --self-test` runs escape attempts against your runtime. `hullproof prove --replay` rebuilds the result from the saved transcripts with no sandbox. The spec language and the files are in `docs/INTERFACES.md`.
167
+
168
+ ## Exit codes
169
+
170
+ | Code | Meaning |
171
+ |---|---|
172
+ | 0 | Done. For `gate`: READY or READY WITH ACCEPTED RISK |
173
+ | 1 | Open items. For `gate`: NOT READY |
174
+ | 2 | Bad input, a refused run, or a problem in the records |
175
+
176
+ ## The gate and the owner file
177
+
178
+ `gate` applies conditions G-1 to G-8 of the Hullproof standard on top of the kit's own checklist gate. Evidence that no file settles goes in an owner file:
179
+
180
+ ```json
181
+ {
182
+ "audit_report": "docs/security/reports/AUDIT.md",
183
+ "rollback": "docs/security/ROLLBACK.md",
184
+ "results": [{"id": "SEC-DB-007", "result": "PASS", "notes": "anon query test, 2026-10-09"}],
185
+ "acceptances": [{"id": "SEC-DB-007", "owner": "...", "approver": "...", "compensating_control": "...", "effective": "2026-10-01", "expires": "2026-12-01"}]
186
+ }
187
+ ```
188
+
189
+ ```
190
+ node $ENGINE/src/cli.ts gate . --owner owner.json
191
+ ```
192
+
193
+ An owner row never overrides a FAIL that the engine found. An acceptance follows the kit's limits: a CRITICAL requirement for at most 90 days and at most 3 per release, never a BLOCKER, never a protected class, and the approver is not the owner.
194
+
195
+ ## How much a rule is trusted: leads and findings
196
+
197
+ Every Semgrep rule has a tier in `rules/tiers.json`, with the measurement behind it: how many hits were judged, how many were real, on which benchmark and when.
198
+
199
+ 1. A gate rule's hit is a finding. It fails its requirements and can hold the release gate.
200
+ 2. A lead rule's hit is listed in the report under "Leads from rules still being measured". It never fails a requirement and never holds the gate. Read the code at each place it names.
201
+
202
+ A rule becomes a lead when at least 3 of its hits were judged and the share that were real (its precision) came out below 0.80. It moves up to gate when a later measurement reaches 0.80 or more. A rule with fewer than 3 judged hits keeps its default. The engine's own taint rules (`taint-*.yaml`) start as leads until they are measured. The rules copied from the Free kit start as gate.
203
+
204
+ Two kinds of finding are never leads: secrets (any Gitleaks hit, and any rule mapped to a secrets requirement), because a live key is a leak wherever it is committed, including in test files, except a hit that is an example value (a placeholder, a published example key, or a shapeless match in documentation, fixture data, an example env file, a lockfile, vendored or generated code or a migration), which is reported as an example value and does not fail a requirement; and the engine's own checks that read files, with one exception: the checks that read the code map (`check.map.*`) are leads until they are measured.
205
+
206
+ Hits in test, fixture, spec, mock and example paths are kept, marked as test code and reported apart. They do not fail a requirement, with the same exception for secrets (a secret in a test file still fails).
207
+
208
+ ## Running it in CI, in a commit hook and from an AI tool
209
+
210
+ One command sits under all three: `hullproof ci`. It runs discovery, the code map, the scanners, the checks and the gate with no model and no container, and writes four files for the commit: `findings.json`, `report.md`, `results.sarif` (SARIF 2.1.0) and `pr-comment.md`. It exits 0 when nothing at or above `--fail-on` (default `blocker`) failed, 1 when something did, and 2 on bad input. The same commit gives the same four files, byte for byte.
211
+
212
+ ```
213
+ hullproof ci . --kit $KIT
214
+ ```
215
+
216
+ 1. **GitHub Actions.** The Hullproof Action runs the command in a container with pinned scanners and fails the check on a blocking finding. It can send the SARIF file to code scanning and add one summary comment to a pull request. Pull requests from forks get a read only token and no secrets, so for them the upload and the comment are skipped and the exit code is unchanged. Use the `pull_request` event, never a checkout of a pull request head under `pull_request_target`.
217
+ 2. **Other CI systems.** `ci-templates/` holds templates for GitHub Actions, GitLab CI, CircleCI, Bitbucket Pipelines and Azure Pipelines. Only the GitHub Actions one has run on its CI system. The others are checked for YAML syntax and expected keys only.
218
+ 3. **Pre-commit hook.** `hullproof hooks install` adds a git pre-commit hook, a Husky entry or a pre-commit framework entry, whichever your repository uses. The check looks at the staged files only. It blocks a commit on a secret or a BLOCKER finding in them, runs on your machine and sends nothing anywhere. An engine error never blocks a commit, and `git commit --no-verify` skips the check. `hullproof hooks uninstall` removes it.
219
+ 4. **MCP server.** `hullproof mcp` serves the scan results to an AI tool over the Model Context Protocol on standard input and output. The tools are `list_requirements`, `get_requirement`, `get_checklist`, `get_gate_verdict`, `get_findings`, `get_report` and `explain_finding`, all read only. `run_scan` exists only when you start the server with `--allow-run`, and it writes only under `.hullproof/`. The server makes no network call, reads nothing outside the repository folder, and labels text that comes from your repository as data. It speaks protocol revision 2026-07-28 and the revisions 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. Add it to a tool with the command `hullproof` and the argument `mcp`.
220
+
221
+ ## Installing the package
222
+
223
+ The package runs from compiled JavaScript in `dist/`, built by `npm pack` or `npm run build` from the TypeScript sources. It has no runtime dependencies. From npm, the package is named `hullproof`:
224
+
225
+ ```
226
+ npm install --global hullproof
227
+ hullproof --version
228
+ hullproof ci . --kit path/to/hullproof-free/kit --edition free
229
+ ```
230
+
231
+ Or run it without installing it: `npx hullproof ci . --kit path/to/hullproof-free/kit --edition free`. The package holds the engine and not the kit, so you still need the kit (clone the Free repository or unzip its release zip) and pass it with `--kit`. From a tarball you build yourself:
232
+
233
+ ```
234
+ npm pack
235
+ npm install --global ./hullproof-0.5.0.tgz
236
+ hullproof version
237
+ ```
238
+
239
+ Node refuses to run TypeScript files that sit inside `node_modules`, which is why the package carries the compiled build and the repository checkout runs the sources directly. Both give the same output.
240
+
241
+ ## Honest limits
242
+
243
+ 1. The engine does not certify an app. It tells you what the repository shows. A clean report means the checks it ran found nothing, and the report lists the requirements it could not assess.
244
+ 2. A scan of files alone cannot reach READY. The gate needs the evidence only an owner can supply.
245
+ 3. Findings come from pattern matching. Some are false alarms and some real problems are missed. Treat each finding as a place to look, and use the check step in the report to confirm it.
246
+ 4. Coverage depends on what is installed. Without Semgrep and Gitleaks most code and secret checks do not run. OSV Scanner sends package names to osv.dev, so it runs only when you pass `--allow-network`. The engine uses the network for nothing else.
247
+ 5. Discovery names a stack only when it has evidence in the files. Anything else stays in `unknown`.
248
+ 6. The Semgrep taint rules cover SQL injection, XSS, command injection, path traversal and SSRF in Python, JavaScript and TypeScript, Java, PHP and Go. They are leads until measured, and the benchmark files show where they are weak.
249
+ 7. The code map comes from pattern reading, not from a parser or from running the app. It misses routes that are registered in loops, built from strings or generated, resources created at run time by a library (for example Juice Shop's generated model endpoints), protections applied by a gateway or a platform setting, and anything in a language without an extractor. Treat each cell in the entry point table as a place to look.
250
+ 8. With the Free kit the engine maps results to the Free requirements only. A scanner hit that maps to no Free requirement is kept as an unmapped observation.
251
+ 9. It was developed and tested on macOS.
252
+
253
+ ## Reading the benchmark files
254
+
255
+ The `bench/` folder holds the scorer and the results of every measurement made so far. This README gives no detection figures on purpose. The numbers sit in the files, each with its limits, and a number is only meaningful with its limits beside it.
256
+
257
+ 1. `bench/BASELINE-2026-10-10.md`: the first scored baseline. Audit outputs for the Hullproof demo app, a repository with 30 planted flaws, scored against its answer key with `bench/score.ts`.
258
+ 2. `bench/STABILITY-2026-10-10.md`: the same measurement repeated, to show how much model audits and the deterministic scan vary from run to run.
259
+ 3. `bench/PHASE1-DEMO-SCORE.md`: this engine on the demo. The checks were written while reading the demo and its answer key, so this is an upper estimate of what they catch on an app they have not seen.
260
+ 4. `bench/PHASE1-INDEPENDENT-2026-10-10.md`: this engine on public vulnerable projects and datasets that the checks were not written for. This is the file to read for an honest view. Its limits section matters.
261
+ 5. `bench/CVE-SUBSET-2026-10-10.md`: the engine on the vulnerable and the fixed commit of 25 public CVEs, to see whether it flags the vulnerable code and stops flagging it after the fix.
262
+ 6. `bench/results/`: the scorer's output behind the first two files.
263
+ 7. `bench/PHASE2-MEASURED-2026-10-11.md` and `bench/PHASE2-ENTRYPOINTS.md`: the code map measured on the demo, Juice Shop and BenchmarkPython, with the hand counts, the seeded samples and the hand checked findings. Read its limits before any number.
264
+
265
+ Some rows in these files come from runs that also used the Pro edition's additional rules (not published), which are not part of this repository. Each file says which run used what. Some runs used a private copy of the demo answer key that lists a requirement ID for every flaw. The published `DEMO-ANSWER-KEY.md` in https://github.com/jt247/hullproof-demo hides the IDs of the Pro flaws, so a rerun with the published key matches those flaws by the patterns in `bench/keys/demo-classes.json` and can score differently. To score a scan yourself:
266
+
267
+ ```
268
+ node $ENGINE/bench/score.ts --key DEMO-ANSWER-KEY.md --classes $ENGINE/bench/keys/demo-classes.json .hullproof/<commit>/report.findings.md
269
+ ```
270
+
271
+ The matching rules are in `docs/SCORING.md`. The raw audit outputs of the baseline runs are not published.
272
+
273
+ ## Tests
274
+
275
+ ```
276
+ npm install
277
+ npm test
278
+ npm run typecheck
279
+ ```
280
+
281
+ `npm install` adds two development dependencies only, `typescript` and `@types/node`, for the type check. The tests run the discovery on small fixture projects for many stacks, the executable checks on pass and fail fixtures, the scanner adapters, the report and gate, and the scorer. Tests that need a kit read it from `HULLPROOF_KIT` or from a `hullproof-free` folder next to the engine folder. Tests that need a scanner skip themselves when it is not installed.
282
+
283
+ ## Licences
284
+
285
+ 1. The engine code, its rules and its checks: Apache License 2.0 (`LICENSE`), copyright Rare Phronesis Limited.
286
+ 2. The external scanners are called, not bundled. Semgrep is LGPL-2.1, Gitleaks is MIT, OSV Scanner and Trivy are Apache-2.0. `NOTICE` lists them, with where the rules in `rules/` come from.
287
+ 3. The Hullproof requirements and the controls file are in the Free kit, under the licences in its `LICENSING.md`.
288
+
289
+ ## Roadmap
290
+
291
+ 1. Model assisted hunting, as a separate step on top of this deterministic base, so the base report never changes because a model ran.
292
+ 2. Proof sandbox recipes for more stacks than Node on Express and Python on Flask.
293
+ 3. Signed build provenance for the npm package. It needs a publish from a CI system, and the first release was published from a person's machine.
294
+
295
+ ## Layout
296
+
297
+ | Path | What it is |
298
+ |---|---|
299
+ | `src/cli.ts` | The `hullproof` command |
300
+ | `src/discover/`, `detectors/` | File listing, manifest and import readers, and the detector rules as data |
301
+ | `src/map/` | The code map: text helpers, extractors per language, the protection vocabulary, and the Supabase and Firebase readers |
302
+ | `src/scanners/`, `src/mapping/` | Scanner adapters and the mapping to requirement IDs |
303
+ | `src/checks/`, `checks/` | Executable checks, as code and as JSON; `src/checks/map/` holds the checks that read the code map |
304
+ | `src/report/`, `src/gate/`, `src/commands/` | The report, the records and the release gate |
305
+ | `src/prove/` | The proof sandbox: spec language, step executor, start recipes, container backend, safety rules and evidence |
306
+ | `src/ci/`, `src/hooks/`, `src/mcp/` | The `ci` outputs (SARIF, pull request comment), the pre-commit hook, and the MCP server |
307
+ | `ci-templates/` | CI templates for five systems |
308
+ | `schemas/` | JSON schemas for every file the engine writes |
309
+ | `rules/` | Semgrep rules, the Gitleaks configuration and the rule tiers |
310
+ | `docs/` | The file formats and how the scorer matches findings |
311
+ | `test/` | Tests and synthetic fixture projects |
312
+ | `bench/` | The scorer and the benchmark files |
313
+
314
+ See `CONTRIBUTING.md` to work on the engine and `SECURITY.md` to report a vulnerability.
@@ -0,0 +1,24 @@
1
+ {
2
+ "id": "check.db.firebase-rules-not-open",
3
+ "sec_ids": [
4
+ "SEC-DB-001"
5
+ ],
6
+ "applies_when": {},
7
+ "op": "regex_absent",
8
+ "params": {
9
+ "files": [
10
+ "**/firestore.rules",
11
+ "**/database.rules.json",
12
+ "**/*.firestore.rules"
13
+ ],
14
+ "pattern": "allow\\s+[\\w\\s,]+:\\s*if\\s+true\\s*;|allow\\s+[\\w\\s,]+\\s*;|\"\\.(?:read|write)\"\\s*:\\s*(?:true|\"true\")|request\\.time\\s*<\\s*timestamp\\.date",
15
+ "note": "database rule open to every caller (Firebase)",
16
+ "not_applicable_reason": "no Firestore or Realtime Database rules file"
17
+ },
18
+ "on_true": "NOT ASSESSED: NEEDS DYNAMIC TEST",
19
+ "on_false": "FAIL",
20
+ "fixtures": {
21
+ "pass": "test/fixtures/checks/firebase-rules-not-open/pass",
22
+ "fail": "test/fixtures/checks/firebase-rules-not-open/fail"
23
+ }
24
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "check.db.rls-every-table",
3
+ "sec_ids": [
4
+ "SEC-DB-001"
5
+ ],
6
+ "applies_when": {},
7
+ "op": "sql_every_table_has",
8
+ "params": {
9
+ "files": [
10
+ "supabase/migrations/**/*.sql",
11
+ "**/migrations/**/*.sql",
12
+ "supabase/schema.sql",
13
+ "**/schema.sql"
14
+ ],
15
+ "schemas": [
16
+ "public"
17
+ ]
18
+ },
19
+ "on_true": "NOT ASSESSED: NEEDS DYNAMIC TEST",
20
+ "on_false": "FAIL",
21
+ "fixtures": {
22
+ "pass": "test/fixtures/checks/rls-every-table/pass",
23
+ "fail": "test/fixtures/checks/rls-every-table/fail"
24
+ }
25
+ }