@emilia-protocol/gate 0.11.0 → 0.13.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 (419) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +252 -0
  3. package/action-control-manifest.js +3 -268
  4. package/action-escrow-custodian.js +3 -394
  5. package/action-escrow-evidence.js +3 -858
  6. package/action-escrow-package.js +3 -1668
  7. package/action-escrow-postgres.js +3 -337
  8. package/action-escrow-state.js +3 -396
  9. package/action-escrow-verifiers.js +3 -331
  10. package/action-escrow.js +3 -2447
  11. package/action-packs.js +3 -140
  12. package/adapters/_kit.js +3 -104
  13. package/adapters/aws.js +3 -108
  14. package/adapters/cloudflare.js +3 -54
  15. package/adapters/gcp.js +3 -70
  16. package/adapters/github.js +3 -109
  17. package/adapters/jira.js +3 -55
  18. package/adapters/k8s.js +3 -70
  19. package/adapters/linear.js +3 -55
  20. package/adapters/salesforce.js +3 -55
  21. package/adapters/stripe.js +3 -81
  22. package/adapters/supabase.js +3 -121
  23. package/adapters/terraform.js +3 -59
  24. package/adapters/vercel.js +3 -84
  25. package/aec-execution.js +3 -312
  26. package/breakglass.js +3 -582
  27. package/capability-receipt.js +4 -0
  28. package/cf1-conformance.js +3 -106
  29. package/challenge-store.js +3 -69
  30. package/control-plane.js +3 -340
  31. package/coverage.js +3 -721
  32. package/demo.mjs +1 -1
  33. package/deployment-attestation.js +3 -247
  34. package/dist/action-control-manifest.d.ts +82 -0
  35. package/dist/action-control-manifest.d.ts.map +1 -0
  36. package/dist/action-control-manifest.js +422 -0
  37. package/dist/action-control-manifest.js.map +1 -0
  38. package/dist/action-escrow-custodian.d.ts +74 -0
  39. package/dist/action-escrow-custodian.d.ts.map +1 -0
  40. package/dist/action-escrow-custodian.js +363 -0
  41. package/dist/action-escrow-custodian.js.map +1 -0
  42. package/dist/action-escrow-evidence.d.ts +130 -0
  43. package/dist/action-escrow-evidence.d.ts.map +1 -0
  44. package/dist/action-escrow-evidence.js +1012 -0
  45. package/dist/action-escrow-evidence.js.map +1 -0
  46. package/dist/action-escrow-package.d.ts +10 -0
  47. package/dist/action-escrow-package.d.ts.map +1 -0
  48. package/dist/action-escrow-package.js +1583 -0
  49. package/dist/action-escrow-package.js.map +1 -0
  50. package/dist/action-escrow-postgres.d.ts +62 -0
  51. package/dist/action-escrow-postgres.d.ts.map +1 -0
  52. package/dist/action-escrow-postgres.js +339 -0
  53. package/dist/action-escrow-postgres.js.map +1 -0
  54. package/dist/action-escrow-state.d.ts +141 -0
  55. package/dist/action-escrow-state.d.ts.map +1 -0
  56. package/dist/action-escrow-state.js +413 -0
  57. package/dist/action-escrow-state.js.map +1 -0
  58. package/dist/action-escrow-verifiers.d.ts +65 -0
  59. package/dist/action-escrow-verifiers.d.ts.map +1 -0
  60. package/dist/action-escrow-verifiers.js +421 -0
  61. package/dist/action-escrow-verifiers.js.map +1 -0
  62. package/dist/action-escrow.d.ts +112 -0
  63. package/dist/action-escrow.d.ts.map +1 -0
  64. package/dist/action-escrow.js +2661 -0
  65. package/dist/action-escrow.js.map +1 -0
  66. package/dist/action-packs.d.ts +54 -0
  67. package/dist/action-packs.d.ts.map +1 -0
  68. package/dist/action-packs.js +143 -0
  69. package/dist/action-packs.js.map +1 -0
  70. package/dist/adapters/_kit.d.ts +50 -0
  71. package/dist/adapters/_kit.d.ts.map +1 -0
  72. package/dist/adapters/_kit.js +98 -0
  73. package/dist/adapters/_kit.js.map +1 -0
  74. package/dist/adapters/aws.d.ts +158 -0
  75. package/dist/adapters/aws.d.ts.map +1 -0
  76. package/dist/adapters/aws.js +136 -0
  77. package/dist/adapters/aws.js.map +1 -0
  78. package/dist/adapters/cloudflare.d.ts +116 -0
  79. package/dist/adapters/cloudflare.d.ts.map +1 -0
  80. package/dist/adapters/cloudflare.js +75 -0
  81. package/dist/adapters/cloudflare.js.map +1 -0
  82. package/dist/adapters/gcp.d.ts +139 -0
  83. package/dist/adapters/gcp.d.ts.map +1 -0
  84. package/dist/adapters/gcp.js +69 -0
  85. package/dist/adapters/gcp.js.map +1 -0
  86. package/dist/adapters/github.d.ts +123 -0
  87. package/dist/adapters/github.d.ts.map +1 -0
  88. package/dist/adapters/github.js +105 -0
  89. package/dist/adapters/github.js.map +1 -0
  90. package/dist/adapters/jira.d.ts +109 -0
  91. package/dist/adapters/jira.d.ts.map +1 -0
  92. package/dist/adapters/jira.js +54 -0
  93. package/dist/adapters/jira.js.map +1 -0
  94. package/dist/adapters/k8s.d.ts +139 -0
  95. package/dist/adapters/k8s.d.ts.map +1 -0
  96. package/dist/adapters/k8s.js +69 -0
  97. package/dist/adapters/k8s.js.map +1 -0
  98. package/dist/adapters/linear.d.ts +109 -0
  99. package/dist/adapters/linear.d.ts.map +1 -0
  100. package/dist/adapters/linear.js +54 -0
  101. package/dist/adapters/linear.js.map +1 -0
  102. package/dist/adapters/salesforce.d.ts +109 -0
  103. package/dist/adapters/salesforce.d.ts.map +1 -0
  104. package/dist/adapters/salesforce.js +54 -0
  105. package/dist/adapters/salesforce.js.map +1 -0
  106. package/dist/adapters/stripe.d.ts +116 -0
  107. package/dist/adapters/stripe.d.ts.map +1 -0
  108. package/dist/adapters/stripe.js +77 -0
  109. package/dist/adapters/stripe.js.map +1 -0
  110. package/dist/adapters/supabase.d.ts +127 -0
  111. package/dist/adapters/supabase.d.ts.map +1 -0
  112. package/dist/adapters/supabase.js +112 -0
  113. package/dist/adapters/supabase.js.map +1 -0
  114. package/dist/adapters/terraform.d.ts +109 -0
  115. package/dist/adapters/terraform.d.ts.map +1 -0
  116. package/dist/adapters/terraform.js +58 -0
  117. package/dist/adapters/terraform.js.map +1 -0
  118. package/dist/adapters/vercel.d.ts +114 -0
  119. package/dist/adapters/vercel.d.ts.map +1 -0
  120. package/dist/adapters/vercel.js +81 -0
  121. package/dist/adapters/vercel.js.map +1 -0
  122. package/dist/aec-execution.d.ts +107 -0
  123. package/dist/aec-execution.d.ts.map +1 -0
  124. package/dist/aec-execution.js +334 -0
  125. package/dist/aec-execution.js.map +1 -0
  126. package/dist/breakglass.d.ts +205 -0
  127. package/dist/breakglass.d.ts.map +1 -0
  128. package/dist/breakglass.js +627 -0
  129. package/dist/breakglass.js.map +1 -0
  130. package/dist/capability-receipt.d.ts +601 -0
  131. package/dist/capability-receipt.d.ts.map +1 -0
  132. package/dist/capability-receipt.js +1177 -0
  133. package/dist/capability-receipt.js.map +1 -0
  134. package/dist/cf1-conformance.d.ts +83 -0
  135. package/dist/cf1-conformance.d.ts.map +1 -0
  136. package/dist/cf1-conformance.js +94 -0
  137. package/dist/cf1-conformance.js.map +1 -0
  138. package/dist/challenge-store.d.ts +20 -0
  139. package/dist/challenge-store.d.ts.map +1 -0
  140. package/dist/challenge-store.js +62 -0
  141. package/dist/challenge-store.js.map +1 -0
  142. package/dist/control-plane.d.ts +136 -0
  143. package/dist/control-plane.d.ts.map +1 -0
  144. package/dist/control-plane.js +349 -0
  145. package/dist/control-plane.js.map +1 -0
  146. package/dist/coverage.d.ts +156 -0
  147. package/dist/coverage.d.ts.map +1 -0
  148. package/dist/coverage.js +768 -0
  149. package/dist/coverage.js.map +1 -0
  150. package/dist/deployment-attestation.d.ts +93 -0
  151. package/dist/deployment-attestation.d.ts.map +1 -0
  152. package/dist/deployment-attestation.js +262 -0
  153. package/dist/deployment-attestation.js.map +1 -0
  154. package/dist/eg1-conformance.d.ts +286 -0
  155. package/dist/eg1-conformance.d.ts.map +1 -0
  156. package/dist/eg1-conformance.js +379 -0
  157. package/dist/eg1-conformance.js.map +1 -0
  158. package/dist/enterprise.d.ts +88 -0
  159. package/dist/enterprise.d.ts.map +1 -0
  160. package/dist/enterprise.js +194 -0
  161. package/dist/enterprise.js.map +1 -0
  162. package/dist/evidence-postgres.d.ts +123 -0
  163. package/dist/evidence-postgres.d.ts.map +1 -0
  164. package/dist/evidence-postgres.js +343 -0
  165. package/dist/evidence-postgres.js.map +1 -0
  166. package/dist/evidence.d.ts +113 -0
  167. package/dist/evidence.d.ts.map +1 -0
  168. package/dist/evidence.js +369 -0
  169. package/dist/evidence.js.map +1 -0
  170. package/dist/execution-binding.d.ts +49 -0
  171. package/dist/execution-binding.d.ts.map +1 -0
  172. package/dist/execution-binding.js +243 -0
  173. package/dist/execution-binding.js.map +1 -0
  174. package/dist/formal-runtime-map.d.ts +42 -0
  175. package/dist/formal-runtime-map.d.ts.map +1 -0
  176. package/dist/formal-runtime-map.js +23 -0
  177. package/dist/formal-runtime-map.js.map +1 -0
  178. package/dist/index.d.ts +1002 -0
  179. package/dist/index.d.ts.map +1 -0
  180. package/dist/index.js +1736 -0
  181. package/dist/index.js.map +1 -0
  182. package/dist/key-registry.d.ts +60 -0
  183. package/dist/key-registry.d.ts.map +1 -0
  184. package/dist/key-registry.js +144 -0
  185. package/dist/key-registry.js.map +1 -0
  186. package/dist/mcp.d.ts +53 -0
  187. package/dist/mcp.d.ts.map +1 -0
  188. package/dist/mcp.js +112 -0
  189. package/dist/mcp.js.map +1 -0
  190. package/dist/metering.d.ts +80 -0
  191. package/dist/metering.d.ts.map +1 -0
  192. package/dist/metering.js +227 -0
  193. package/dist/metering.js.map +1 -0
  194. package/dist/metrics.d.ts +68 -0
  195. package/dist/metrics.d.ts.map +1 -0
  196. package/dist/metrics.js +242 -0
  197. package/dist/metrics.js.map +1 -0
  198. package/dist/network-witness.d.ts +167 -0
  199. package/dist/network-witness.d.ts.map +1 -0
  200. package/dist/network-witness.js +520 -0
  201. package/dist/network-witness.js.map +1 -0
  202. package/dist/protocol-state.d.ts +141 -0
  203. package/dist/protocol-state.d.ts.map +1 -0
  204. package/dist/protocol-state.js +106 -0
  205. package/dist/protocol-state.js.map +1 -0
  206. package/dist/receipt-program.d.ts +59 -0
  207. package/dist/receipt-program.d.ts.map +1 -0
  208. package/dist/receipt-program.js +1053 -0
  209. package/dist/receipt-program.js.map +1 -0
  210. package/dist/reliance-kernel.d.ts +66 -0
  211. package/dist/reliance-kernel.d.ts.map +1 -0
  212. package/dist/reliance-kernel.js +103 -0
  213. package/dist/reliance-kernel.js.map +1 -0
  214. package/dist/reliance-packet.d.ts +67 -0
  215. package/dist/reliance-packet.d.ts.map +1 -0
  216. package/dist/reliance-packet.js +176 -0
  217. package/dist/reliance-packet.js.map +1 -0
  218. package/dist/remedy-program-postgres.d.ts +37 -0
  219. package/dist/remedy-program-postgres.d.ts.map +1 -0
  220. package/dist/remedy-program-postgres.js +291 -0
  221. package/dist/remedy-program-postgres.js.map +1 -0
  222. package/dist/remedy-program-receipt.d.ts +97 -0
  223. package/dist/remedy-program-receipt.d.ts.map +1 -0
  224. package/dist/remedy-program-receipt.js +817 -0
  225. package/dist/remedy-program-receipt.js.map +1 -0
  226. package/dist/remedy-program.d.ts +76 -0
  227. package/dist/remedy-program.d.ts.map +1 -0
  228. package/dist/remedy-program.js +1346 -0
  229. package/dist/remedy-program.js.map +1 -0
  230. package/dist/reports/art14.d.ts +101 -0
  231. package/dist/reports/art14.d.ts.map +1 -0
  232. package/dist/reports/art14.js +340 -0
  233. package/dist/reports/art14.js.map +1 -0
  234. package/dist/reports/assurance-package.d.ts +197 -0
  235. package/dist/reports/assurance-package.d.ts.map +1 -0
  236. package/dist/reports/assurance-package.js +313 -0
  237. package/dist/reports/assurance-package.js.map +1 -0
  238. package/dist/reports/auditor-workpaper.d.ts +194 -0
  239. package/dist/reports/auditor-workpaper.d.ts.map +1 -0
  240. package/dist/reports/auditor-workpaper.js +545 -0
  241. package/dist/reports/auditor-workpaper.js.map +1 -0
  242. package/dist/reports/external-verification.d.ts +76 -0
  243. package/dist/reports/external-verification.d.ts.map +1 -0
  244. package/dist/reports/external-verification.js +209 -0
  245. package/dist/reports/external-verification.js.map +1 -0
  246. package/dist/reports/reperform.d.ts +122 -0
  247. package/dist/reports/reperform.d.ts.map +1 -0
  248. package/dist/reports/reperform.js +432 -0
  249. package/dist/reports/reperform.js.map +1 -0
  250. package/dist/reports/underwriter.d.ts +127 -0
  251. package/dist/reports/underwriter.d.ts.map +1 -0
  252. package/dist/reports/underwriter.js +348 -0
  253. package/dist/reports/underwriter.js.map +1 -0
  254. package/dist/retention.d.ts +88 -0
  255. package/dist/retention.d.ts.map +1 -0
  256. package/dist/retention.js +90 -0
  257. package/dist/retention.js.map +1 -0
  258. package/dist/roster.d.ts +113 -0
  259. package/dist/roster.d.ts.map +1 -0
  260. package/dist/roster.js +261 -0
  261. package/dist/roster.js.map +1 -0
  262. package/dist/runtime-monitor.d.ts +132 -0
  263. package/dist/runtime-monitor.d.ts.map +1 -0
  264. package/dist/runtime-monitor.js +197 -0
  265. package/dist/runtime-monitor.js.map +1 -0
  266. package/dist/settlement.d.ts +68 -0
  267. package/dist/settlement.d.ts.map +1 -0
  268. package/dist/settlement.js +306 -0
  269. package/dist/settlement.js.map +1 -0
  270. package/dist/siem.d.ts +261 -0
  271. package/dist/siem.d.ts.map +1 -0
  272. package/dist/siem.js +247 -0
  273. package/dist/siem.js.map +1 -0
  274. package/dist/store-postgres.d.ts +107 -0
  275. package/dist/store-postgres.d.ts.map +1 -0
  276. package/dist/store-postgres.js +152 -0
  277. package/dist/store-postgres.js.map +1 -0
  278. package/dist/store.d.ts +95 -0
  279. package/dist/store.d.ts.map +1 -0
  280. package/dist/store.js +202 -0
  281. package/dist/store.js.map +1 -0
  282. package/dist/strict-json.d.ts +14 -0
  283. package/dist/strict-json.d.ts.map +1 -0
  284. package/dist/strict-json.js +132 -0
  285. package/dist/strict-json.js.map +1 -0
  286. package/dist/trust-program-adapters.d.ts +122 -0
  287. package/dist/trust-program-adapters.d.ts.map +1 -0
  288. package/dist/trust-program-adapters.js +802 -0
  289. package/dist/trust-program-adapters.js.map +1 -0
  290. package/dist/trust-program-postgres.d.ts +41 -0
  291. package/dist/trust-program-postgres.d.ts.map +1 -0
  292. package/dist/trust-program-postgres.js +346 -0
  293. package/dist/trust-program-postgres.js.map +1 -0
  294. package/dist/trust-program-revocation.d.ts +206 -0
  295. package/dist/trust-program-revocation.d.ts.map +1 -0
  296. package/dist/trust-program-revocation.js +600 -0
  297. package/dist/trust-program-revocation.js.map +1 -0
  298. package/dist/trust-program.d.ts +197 -0
  299. package/dist/trust-program.d.ts.map +1 -0
  300. package/dist/trust-program.js +1351 -0
  301. package/dist/trust-program.js.map +1 -0
  302. package/dist/witness-postgres.d.ts +43 -0
  303. package/dist/witness-postgres.d.ts.map +1 -0
  304. package/dist/witness-postgres.js +92 -0
  305. package/dist/witness-postgres.js.map +1 -0
  306. package/dist/zk-range-proof.d.ts +78 -0
  307. package/dist/zk-range-proof.d.ts.map +1 -0
  308. package/dist/zk-range-proof.js +228 -0
  309. package/dist/zk-range-proof.js.map +1 -0
  310. package/eg1-conformance.js +3 -404
  311. package/enterprise.js +3 -180
  312. package/ep-assure.mjs +1 -0
  313. package/evidence-postgres.js +3 -356
  314. package/evidence.js +4 -360
  315. package/execution-binding.js +3 -212
  316. package/formal-runtime-map.js +4 -0
  317. package/index.js +4 -1249
  318. package/key-registry.js +3 -134
  319. package/mcp.js +3 -109
  320. package/metering.js +3 -226
  321. package/metrics.js +3 -231
  322. package/network-witness.js +3 -499
  323. package/package.json +31 -2
  324. package/receipt-program.js +4 -0
  325. package/reliance-kernel.js +3 -112
  326. package/reliance-packet.js +3 -175
  327. package/remedy-program-postgres.js +4 -0
  328. package/remedy-program-receipt.js +4 -0
  329. package/remedy-program.js +4 -0
  330. package/reports/art14.js +0 -0
  331. package/reports/assurance-package.js +2 -312
  332. package/reports/auditor-workpaper.js +3 -537
  333. package/reports/external-verification.js +3 -222
  334. package/reports/reperform.js +3 -424
  335. package/reports/underwriter.js +3 -339
  336. package/retention.js +3 -84
  337. package/roster.js +3 -264
  338. package/runtime-monitor.js +4 -0
  339. package/settlement.js +3 -299
  340. package/siem.js +3 -235
  341. package/src/action-control-manifest.ts +424 -0
  342. package/src/action-escrow-custodian.ts +427 -0
  343. package/src/action-escrow-evidence.ts +1178 -0
  344. package/src/action-escrow-package.ts +1821 -0
  345. package/src/action-escrow-postgres.ts +366 -0
  346. package/src/action-escrow-state.ts +498 -0
  347. package/src/action-escrow-verifiers.ts +484 -0
  348. package/src/action-escrow.ts +3039 -0
  349. package/src/action-packs.ts +170 -0
  350. package/src/adapters/_kit.ts +117 -0
  351. package/src/adapters/aws.ts +142 -0
  352. package/src/adapters/cloudflare.ts +78 -0
  353. package/src/adapters/gcp.ts +71 -0
  354. package/src/adapters/github.ts +110 -0
  355. package/src/adapters/jira.ts +56 -0
  356. package/src/adapters/k8s.ts +71 -0
  357. package/src/adapters/linear.ts +56 -0
  358. package/src/adapters/salesforce.ts +56 -0
  359. package/src/adapters/stripe.ts +82 -0
  360. package/src/adapters/supabase.ts +122 -0
  361. package/src/adapters/terraform.ts +60 -0
  362. package/src/adapters/vercel.ts +85 -0
  363. package/src/aec-execution.ts +354 -0
  364. package/src/breakglass.ts +647 -0
  365. package/src/capability-receipt.ts +1258 -0
  366. package/src/cf1-conformance.ts +120 -0
  367. package/src/challenge-store.ts +70 -0
  368. package/src/control-plane.ts +374 -0
  369. package/src/coverage.ts +832 -0
  370. package/src/deployment-attestation.ts +259 -0
  371. package/src/eg1-conformance.ts +471 -0
  372. package/src/enterprise.ts +195 -0
  373. package/src/evidence-postgres.ts +374 -0
  374. package/src/evidence.ts +367 -0
  375. package/src/execution-binding.ts +236 -0
  376. package/src/formal-runtime-map.ts +24 -0
  377. package/src/index.ts +2122 -0
  378. package/src/key-registry.ts +150 -0
  379. package/src/mcp.ts +120 -0
  380. package/src/metering.ts +237 -0
  381. package/src/metrics.ts +232 -0
  382. package/src/network-witness.ts +585 -0
  383. package/src/protocol-state.ts +143 -0
  384. package/src/protocol-state.typecheck.ts +94 -0
  385. package/src/receipt-program.ts +1105 -0
  386. package/src/reliance-kernel.ts +119 -0
  387. package/src/reliance-packet.ts +206 -0
  388. package/src/remedy-program-postgres.ts +367 -0
  389. package/src/remedy-program-receipt.ts +891 -0
  390. package/src/remedy-program.ts +1388 -0
  391. package/src/reports/art14.ts +361 -0
  392. package/src/reports/assurance-package.ts +330 -0
  393. package/src/reports/auditor-workpaper.ts +558 -0
  394. package/src/reports/external-verification.ts +232 -0
  395. package/src/reports/reperform.ts +441 -0
  396. package/src/reports/underwriter.ts +356 -0
  397. package/src/retention.ts +100 -0
  398. package/src/roster.ts +273 -0
  399. package/src/runtime-monitor.ts +217 -0
  400. package/src/settlement.ts +313 -0
  401. package/src/siem.ts +247 -0
  402. package/src/store-postgres.ts +167 -0
  403. package/src/store.ts +214 -0
  404. package/src/strict-json.ts +115 -0
  405. package/src/trust-program-adapters.ts +847 -0
  406. package/src/trust-program-postgres.ts +429 -0
  407. package/src/trust-program-revocation.ts +751 -0
  408. package/src/trust-program.ts +1460 -0
  409. package/src/witness-postgres.ts +106 -0
  410. package/src/zk-range-proof.ts +250 -0
  411. package/store-postgres.js +3 -161
  412. package/store.js +4 -198
  413. package/strict-json.js +3 -102
  414. package/trust-program-adapters.js +4 -0
  415. package/trust-program-postgres.js +4 -0
  416. package/trust-program-revocation.js +4 -0
  417. package/trust-program.js +4 -0
  418. package/witness-postgres.js +3 -96
  419. package/zk-range-proof.js +4 -0
@@ -0,0 +1,158 @@
1
+ /**
2
+ * @typedef {object} AwsIamClient
3
+ * @property {(input: {UserName: string, PolicyArn: string}) => any} attachUserPolicy
4
+ * @property {(input: {UserName: string}) => any} createAccessKey
5
+ * @property {(input: {UserName: string}) => any} deleteUser
6
+ */
7
+ /**
8
+ * @typedef {object} AwsEc2Client
9
+ * @property {(input: {GroupId: string, CidrIp: string, FromPort: number, ToPort: number, IpProtocol: string}) => any} authorizeSecurityGroupIngress
10
+ */
11
+ /** @typedef {{ iam: AwsIamClient, ec2: AwsEc2Client }} AwsClient */
12
+ export declare const AWS_ACTION_PACK: readonly (Readonly<{
13
+ id: "aws.iam.attach_policy";
14
+ label: "IAM attach policy";
15
+ action_type: "aws.iam.attach_policy";
16
+ risk: "critical";
17
+ receipt_required: true;
18
+ assurance_class: "quorum";
19
+ match: {
20
+ protocol: string;
21
+ tool: string;
22
+ };
23
+ why: "Grants permissions. Privilege escalation deserves the two-person rule.";
24
+ execution_binding: {
25
+ required_fields: string[];
26
+ };
27
+ }> | Readonly<{
28
+ id: "aws.iam.create_access_key";
29
+ label: "IAM create access key";
30
+ action_type: "aws.iam.create_access_key";
31
+ risk: "critical";
32
+ receipt_required: true;
33
+ assurance_class: "class_a";
34
+ match: {
35
+ protocol: string;
36
+ tool: string;
37
+ };
38
+ why: "Mints long-lived credentials. Bind the user to a named approval.";
39
+ execution_binding: {
40
+ required_fields: string[];
41
+ };
42
+ }> | Readonly<{
43
+ id: "aws.iam.delete_user";
44
+ label: "IAM delete user";
45
+ action_type: "aws.iam.delete_user";
46
+ risk: "high";
47
+ receipt_required: true;
48
+ assurance_class: "class_a";
49
+ match: {
50
+ protocol: string;
51
+ tool: string;
52
+ };
53
+ why: "Destroys an identity. Bind the target user.";
54
+ execution_binding: {
55
+ required_fields: string[];
56
+ };
57
+ }> | Readonly<{
58
+ id: "aws.ec2.authorize_ingress";
59
+ label: "Open security-group ingress";
60
+ action_type: "aws.ec2.authorize_ingress";
61
+ risk: "critical";
62
+ receipt_required: true;
63
+ assurance_class: "quorum";
64
+ match: {
65
+ protocol: string;
66
+ tool: string;
67
+ };
68
+ why: "Opens the network. Bind group/CIDR/port so 0.0.0.0/0:22 cannot slip through.";
69
+ execution_binding: {
70
+ required_fields: string[];
71
+ };
72
+ }>)[];
73
+ export declare const AWS_OPS: readonly string[];
74
+ /** @param {object[]} extraActions */
75
+ export declare function createAwsManifest(extraActions?: never[]): {
76
+ '@version': string;
77
+ actions: any[];
78
+ };
79
+ /**
80
+ * Guard a high-blast-radius AWS mutation behind the gate.
81
+ * @param {object} gate a gate built with createAwsManifest()
82
+ * @param {AwsClient} client { iam: {attachUserPolicy, createAccessKey, deleteUser}, ec2: {authorizeSecurityGroupIngress} }
83
+ * @param {{ op: string, params?: object, receipt?: any }} args { op, params, receipt }
84
+ * @throws Error{code:'EMILIA_RECEIPT_REQUIRED'} if refused — the call never reaches AWS
85
+ */
86
+ export declare function guardAwsMutation(gate: any, client: any, args: any): Promise<{
87
+ result: any;
88
+ reliance: any;
89
+ execution: any;
90
+ }>;
91
+ declare const _default: {
92
+ AWS_ACTION_PACK: readonly (Readonly<{
93
+ id: "aws.iam.attach_policy";
94
+ label: "IAM attach policy";
95
+ action_type: "aws.iam.attach_policy";
96
+ risk: "critical";
97
+ receipt_required: true;
98
+ assurance_class: "quorum";
99
+ match: {
100
+ protocol: string;
101
+ tool: string;
102
+ };
103
+ why: "Grants permissions. Privilege escalation deserves the two-person rule.";
104
+ execution_binding: {
105
+ required_fields: string[];
106
+ };
107
+ }> | Readonly<{
108
+ id: "aws.iam.create_access_key";
109
+ label: "IAM create access key";
110
+ action_type: "aws.iam.create_access_key";
111
+ risk: "critical";
112
+ receipt_required: true;
113
+ assurance_class: "class_a";
114
+ match: {
115
+ protocol: string;
116
+ tool: string;
117
+ };
118
+ why: "Mints long-lived credentials. Bind the user to a named approval.";
119
+ execution_binding: {
120
+ required_fields: string[];
121
+ };
122
+ }> | Readonly<{
123
+ id: "aws.iam.delete_user";
124
+ label: "IAM delete user";
125
+ action_type: "aws.iam.delete_user";
126
+ risk: "high";
127
+ receipt_required: true;
128
+ assurance_class: "class_a";
129
+ match: {
130
+ protocol: string;
131
+ tool: string;
132
+ };
133
+ why: "Destroys an identity. Bind the target user.";
134
+ execution_binding: {
135
+ required_fields: string[];
136
+ };
137
+ }> | Readonly<{
138
+ id: "aws.ec2.authorize_ingress";
139
+ label: "Open security-group ingress";
140
+ action_type: "aws.ec2.authorize_ingress";
141
+ risk: "critical";
142
+ receipt_required: true;
143
+ assurance_class: "quorum";
144
+ match: {
145
+ protocol: string;
146
+ tool: string;
147
+ };
148
+ why: "Opens the network. Bind group/CIDR/port so 0.0.0.0/0:22 cannot slip through.";
149
+ execution_binding: {
150
+ required_fields: string[];
151
+ };
152
+ }>)[];
153
+ AWS_OPS: readonly string[];
154
+ createAwsManifest: typeof createAwsManifest;
155
+ guardAwsMutation: typeof guardAwsMutation;
156
+ };
157
+ export default _default;
158
+ //# sourceMappingURL=aws.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws.d.ts","sourceRoot":"","sources":["../../src/adapters/aws.ts"],"names":[],"mappings":"AAuBA;;;;;GAKG;AACH;;;GAGG;AACH,oEAAoE;AAEpE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6B1B,CAAC;AA2DH,eAAO,MAAM,OAAO,mBAAc,CAAC;AAEnC,qCAAqC;AACrC,wBAAgB,iBAAiB,CAAC,YAAY,UAAK;;;EAElD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,wBAAiF"}
@@ -0,0 +1,136 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * EMILIA Gate — AWS System-of-Record adapter (IAM + network).
4
+ *
5
+ * "Install this before your agent can change cloud permissions or open the
6
+ * network." Wraps the high-blast-radius AWS operations — attach IAM policy,
7
+ * create access key, delete user, and open a security-group ingress — so they
8
+ * never reach AWS without a valid, sufficiently-assured, non-replayed receipt
9
+ * bound to THIS principal/policy/group. Privilege and network changes default
10
+ * to quorum (the two-person rule).
11
+ *
12
+ * import { IAMClient, EC2Client } from '@aws-sdk/...';
13
+ * import { createGate } from '@emilia-protocol/gate';
14
+ * import { createAwsManifest, guardAwsMutation } from '@emilia-protocol/gate/adapters/aws';
15
+ *
16
+ * const gate = createGate({ manifest: createAwsManifest(), trustedKeys: [ISSUER], store: sharedConsumptionStore });
17
+ * // client: { iam: { attachUserPolicy, createAccessKey, deleteUser }, ec2: { authorizeSecurityGroupIngress } }
18
+ * await guardAwsMutation(gate, client, {
19
+ * op: 'iam.attach_policy', params: { user: 'svc-bot', policy_arn: 'arn:aws:iam::aws:policy/AdministratorAccess' }, receipt,
20
+ * });
21
+ */
22
+ import { createAdapter, manifestFromPack } from './_kit.js';
23
+ /**
24
+ * @typedef {object} AwsIamClient
25
+ * @property {(input: {UserName: string, PolicyArn: string}) => any} attachUserPolicy
26
+ * @property {(input: {UserName: string}) => any} createAccessKey
27
+ * @property {(input: {UserName: string}) => any} deleteUser
28
+ */
29
+ /**
30
+ * @typedef {object} AwsEc2Client
31
+ * @property {(input: {GroupId: string, CidrIp: string, FromPort: number, ToPort: number, IpProtocol: string}) => any} authorizeSecurityGroupIngress
32
+ */
33
+ /** @typedef {{ iam: AwsIamClient, ec2: AwsEc2Client }} AwsClient */
34
+ export const AWS_ACTION_PACK = Object.freeze([
35
+ Object.freeze({
36
+ id: 'aws.iam.attach_policy', label: 'IAM attach policy', action_type: 'aws.iam.attach_policy',
37
+ risk: 'critical', receipt_required: true, assurance_class: 'quorum',
38
+ match: { protocol: 'aws', tool: 'attach_user_policy' },
39
+ why: 'Grants permissions. Privilege escalation deserves the two-person rule.',
40
+ execution_binding: { required_fields: ['action_type', 'user', 'policy_arn'] },
41
+ }),
42
+ Object.freeze({
43
+ id: 'aws.iam.create_access_key', label: 'IAM create access key', action_type: 'aws.iam.create_access_key',
44
+ risk: 'critical', receipt_required: true, assurance_class: 'class_a',
45
+ match: { protocol: 'aws', tool: 'create_access_key' },
46
+ why: 'Mints long-lived credentials. Bind the user to a named approval.',
47
+ execution_binding: { required_fields: ['action_type', 'user'] },
48
+ }),
49
+ Object.freeze({
50
+ id: 'aws.iam.delete_user', label: 'IAM delete user', action_type: 'aws.iam.delete_user',
51
+ risk: 'high', receipt_required: true, assurance_class: 'class_a',
52
+ match: { protocol: 'aws', tool: 'delete_user' },
53
+ why: 'Destroys an identity. Bind the target user.',
54
+ execution_binding: { required_fields: ['action_type', 'user'] },
55
+ }),
56
+ Object.freeze({
57
+ id: 'aws.ec2.authorize_ingress', label: 'Open security-group ingress', action_type: 'aws.ec2.authorize_ingress',
58
+ risk: 'critical', receipt_required: true, assurance_class: 'quorum',
59
+ match: { protocol: 'aws', tool: 'authorize_security_group_ingress' },
60
+ why: 'Opens the network. Bind group/CIDR/port so 0.0.0.0/0:22 cannot slip through.',
61
+ execution_binding: { required_fields: ['action_type', 'group_id', 'cidr', 'protocol', 'from_port', 'to_port'] },
62
+ }),
63
+ ]);
64
+ const OPS = {
65
+ 'iam.attach_policy': {
66
+ selector: { protocol: 'aws', tool: 'attach_user_policy' },
67
+ /** @param {{user: string, policy_arn: string}} p */
68
+ observed: (p) => ({ action_type: 'aws.iam.attach_policy', user: p.user, policy_arn: p.policy_arn }),
69
+ /**
70
+ * @param {AwsClient} client
71
+ * @param {{user: string, policy_arn: string}} p
72
+ */
73
+ perform: (client, p) => client.iam.attachUserPolicy({ UserName: p.user, PolicyArn: p.policy_arn }),
74
+ },
75
+ 'iam.create_access_key': {
76
+ selector: { protocol: 'aws', tool: 'create_access_key' },
77
+ /** @param {{user: string}} p */
78
+ observed: (p) => ({ action_type: 'aws.iam.create_access_key', user: p.user }),
79
+ /**
80
+ * @param {AwsClient} client
81
+ * @param {{user: string}} p
82
+ */
83
+ perform: (client, p) => client.iam.createAccessKey({ UserName: p.user }),
84
+ },
85
+ 'iam.delete_user': {
86
+ selector: { protocol: 'aws', tool: 'delete_user' },
87
+ /** @param {{user: string}} p */
88
+ observed: (p) => ({ action_type: 'aws.iam.delete_user', user: p.user }),
89
+ /**
90
+ * @param {AwsClient} client
91
+ * @param {{user: string}} p
92
+ */
93
+ perform: (client, p) => client.iam.deleteUser({ UserName: p.user }),
94
+ },
95
+ 'ec2.authorize_ingress': {
96
+ selector: { protocol: 'aws', tool: 'authorize_security_group_ingress' },
97
+ /** @param {{group_id: string, cidr: string, protocol?: string, from_port: number, to_port?: number}} p */
98
+ observed: (p) => ({
99
+ action_type: 'aws.ec2.authorize_ingress',
100
+ group_id: p.group_id,
101
+ cidr: p.cidr,
102
+ protocol: p.protocol ?? 'tcp',
103
+ from_port: p.from_port,
104
+ to_port: p.to_port ?? p.from_port,
105
+ }),
106
+ /**
107
+ * @param {AwsClient} client
108
+ * @param {{group_id: string, cidr: string, protocol: string, from_port: number, to_port: number}} p
109
+ */
110
+ perform: (client, p) => client.ec2.authorizeSecurityGroupIngress({
111
+ GroupId: p.group_id,
112
+ CidrIp: p.cidr,
113
+ FromPort: p.from_port,
114
+ ToPort: p.to_port,
115
+ IpProtocol: p.protocol,
116
+ }),
117
+ },
118
+ };
119
+ const adapter = createAdapter({ system: 'aws', ops: OPS });
120
+ export const AWS_OPS = adapter.OPS;
121
+ /** @param {object[]} extraActions */
122
+ export function createAwsManifest(extraActions = []) {
123
+ return manifestFromPack(AWS_ACTION_PACK, extraActions);
124
+ }
125
+ /**
126
+ * Guard a high-blast-radius AWS mutation behind the gate.
127
+ * @param {object} gate a gate built with createAwsManifest()
128
+ * @param {AwsClient} client { iam: {attachUserPolicy, createAccessKey, deleteUser}, ec2: {authorizeSecurityGroupIngress} }
129
+ * @param {{ op: string, params?: object, receipt?: any }} args { op, params, receipt }
130
+ * @throws Error{code:'EMILIA_RECEIPT_REQUIRED'} if refused — the call never reaches AWS
131
+ */
132
+ export function guardAwsMutation(gate, client, args) {
133
+ return adapter.guard(gate, client, /** @type {{ op: any, params: any, receipt: any }} */ (args));
134
+ }
135
+ export default { AWS_ACTION_PACK, AWS_OPS, createAwsManifest, guardAwsMutation };
136
+ //# sourceMappingURL=aws.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws.js","sourceRoot":"","sources":["../../src/adapters/aws.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE5D;;;;;GAKG;AACH;;;GAGG;AACH,oEAAoE;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,MAAM,CAAC,MAAM,CA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AE,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;AAEnC,qCAAqC;AACrC,MAAM,UAAU,iBAAiB,CAAC,YAAY,GAAG,EAAE;IACjD,OAAO,gBAAgB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI;IACjD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,qDAAqD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACnG,CAAC;AAED,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @typedef {object} CloudflareClient
3
+ * @property {(input: {zone: string, recordId: string}) => any} deleteDnsRecord
4
+ * @property {(input: {zone: string}) => any} deleteZone
5
+ * @property {(input: {zone: string, ruleId: string, enabled: boolean}) => any} setFirewallRule
6
+ */
7
+ export declare const CLOUDFLARE_ACTION_PACK: readonly (Readonly<{
8
+ id: "cloudflare.dns.delete";
9
+ label: "Delete DNS record";
10
+ action_type: "cloudflare.dns.delete";
11
+ risk: "high";
12
+ receipt_required: true;
13
+ assurance_class: "class_a";
14
+ match: {
15
+ protocol: string;
16
+ tool: string;
17
+ };
18
+ why: "Removing DNS can take a service offline or enable takeover. Bind zone+record.";
19
+ execution_binding: {
20
+ required_fields: string[];
21
+ };
22
+ }> | Readonly<{
23
+ id: "cloudflare.zone.delete";
24
+ label: "Delete zone";
25
+ action_type: "cloudflare.zone.delete";
26
+ risk: "critical";
27
+ receipt_required: true;
28
+ assurance_class: "quorum";
29
+ match: {
30
+ protocol: string;
31
+ tool: string;
32
+ };
33
+ why: "Deletes an entire zone. Quorum.";
34
+ execution_binding: {
35
+ required_fields: string[];
36
+ };
37
+ }> | Readonly<{
38
+ id: "cloudflare.firewall.disable";
39
+ label: "Disable firewall rule";
40
+ action_type: "cloudflare.firewall.disable";
41
+ risk: "critical";
42
+ receipt_required: true;
43
+ assurance_class: "quorum";
44
+ match: {
45
+ protocol: string;
46
+ tool: string;
47
+ };
48
+ why: "Disabling WAF/firewall opens the perimeter. Quorum + bind zone+rule.";
49
+ execution_binding: {
50
+ required_fields: string[];
51
+ };
52
+ }>)[];
53
+ export declare const CLOUDFLARE_OPS: readonly string[];
54
+ /** @param {object[]} extra */
55
+ export declare function createCloudflareManifest(extra?: never[]): {
56
+ '@version': string;
57
+ actions: any[];
58
+ };
59
+ export declare function guardCloudflareMutation(gate: any, client: any, args: any): Promise<{
60
+ result: any;
61
+ reliance: any;
62
+ execution: any;
63
+ }>;
64
+ declare const _default: {
65
+ CLOUDFLARE_ACTION_PACK: readonly (Readonly<{
66
+ id: "cloudflare.dns.delete";
67
+ label: "Delete DNS record";
68
+ action_type: "cloudflare.dns.delete";
69
+ risk: "high";
70
+ receipt_required: true;
71
+ assurance_class: "class_a";
72
+ match: {
73
+ protocol: string;
74
+ tool: string;
75
+ };
76
+ why: "Removing DNS can take a service offline or enable takeover. Bind zone+record.";
77
+ execution_binding: {
78
+ required_fields: string[];
79
+ };
80
+ }> | Readonly<{
81
+ id: "cloudflare.zone.delete";
82
+ label: "Delete zone";
83
+ action_type: "cloudflare.zone.delete";
84
+ risk: "critical";
85
+ receipt_required: true;
86
+ assurance_class: "quorum";
87
+ match: {
88
+ protocol: string;
89
+ tool: string;
90
+ };
91
+ why: "Deletes an entire zone. Quorum.";
92
+ execution_binding: {
93
+ required_fields: string[];
94
+ };
95
+ }> | Readonly<{
96
+ id: "cloudflare.firewall.disable";
97
+ label: "Disable firewall rule";
98
+ action_type: "cloudflare.firewall.disable";
99
+ risk: "critical";
100
+ receipt_required: true;
101
+ assurance_class: "quorum";
102
+ match: {
103
+ protocol: string;
104
+ tool: string;
105
+ };
106
+ why: "Disabling WAF/firewall opens the perimeter. Quorum + bind zone+rule.";
107
+ execution_binding: {
108
+ required_fields: string[];
109
+ };
110
+ }>)[];
111
+ CLOUDFLARE_OPS: readonly string[];
112
+ createCloudflareManifest: typeof createCloudflareManifest;
113
+ guardCloudflareMutation: typeof guardCloudflareMutation;
114
+ };
115
+ export default _default;
116
+ //# sourceMappingURL=cloudflare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../../src/adapters/cloudflare.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsBjC,CAAC;AAoCH,eAAO,MAAM,cAAc,mBAAc,CAAC;AAC1C,8BAA8B;AAC9B,wBAAgB,wBAAwB,CAAC,KAAK,UAAK;;;EAA6D;AAChH,wBAAgB,uBAAuB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACzG,wBAA6G"}
@@ -0,0 +1,75 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ /**
3
+ * EMILIA Gate — Cloudflare System-of-Record adapter.
4
+ * Guards DNS record delete, zone delete, and WAF/firewall disable so they never
5
+ * reach Cloudflare without a receipt bound to THIS zone. Client injected.
6
+ */
7
+ import { createAdapter, manifestFromPack } from './_kit.js';
8
+ /**
9
+ * @typedef {object} CloudflareClient
10
+ * @property {(input: {zone: string, recordId: string}) => any} deleteDnsRecord
11
+ * @property {(input: {zone: string}) => any} deleteZone
12
+ * @property {(input: {zone: string, ruleId: string, enabled: boolean}) => any} setFirewallRule
13
+ */
14
+ export const CLOUDFLARE_ACTION_PACK = Object.freeze([
15
+ Object.freeze({
16
+ id: 'cloudflare.dns.delete', label: 'Delete DNS record', action_type: 'cloudflare.dns.delete',
17
+ risk: 'high', receipt_required: true, assurance_class: 'class_a',
18
+ match: { protocol: 'cloudflare', tool: 'delete_dns_record' },
19
+ why: 'Removing DNS can take a service offline or enable takeover. Bind zone+record.',
20
+ execution_binding: { required_fields: ['action_type', 'zone', 'record_id'] },
21
+ }),
22
+ Object.freeze({
23
+ id: 'cloudflare.zone.delete', label: 'Delete zone', action_type: 'cloudflare.zone.delete',
24
+ risk: 'critical', receipt_required: true, assurance_class: 'quorum',
25
+ match: { protocol: 'cloudflare', tool: 'delete_zone' },
26
+ why: 'Deletes an entire zone. Quorum.',
27
+ execution_binding: { required_fields: ['action_type', 'zone'] },
28
+ }),
29
+ Object.freeze({
30
+ id: 'cloudflare.firewall.disable', label: 'Disable firewall rule', action_type: 'cloudflare.firewall.disable',
31
+ risk: 'critical', receipt_required: true, assurance_class: 'quorum',
32
+ match: { protocol: 'cloudflare', tool: 'set_firewall_rule' },
33
+ why: 'Disabling WAF/firewall opens the perimeter. Quorum + bind zone+rule.',
34
+ execution_binding: { required_fields: ['action_type', 'zone', 'rule_id'] },
35
+ }),
36
+ ]);
37
+ const OPS = {
38
+ 'dns.delete': {
39
+ selector: { protocol: 'cloudflare', tool: 'delete_dns_record' },
40
+ /** @param {{zone: string, record_id: string}} p */
41
+ observed: (p) => ({ action_type: 'cloudflare.dns.delete', zone: p.zone, record_id: p.record_id }),
42
+ /**
43
+ * @param {CloudflareClient} c
44
+ * @param {{zone: string, record_id: string}} p
45
+ */
46
+ perform: (c, p) => c.deleteDnsRecord({ zone: p.zone, recordId: p.record_id }),
47
+ },
48
+ 'zone.delete': {
49
+ selector: { protocol: 'cloudflare', tool: 'delete_zone' },
50
+ /** @param {{zone: string}} p */
51
+ observed: (p) => ({ action_type: 'cloudflare.zone.delete', zone: p.zone }),
52
+ /**
53
+ * @param {CloudflareClient} c
54
+ * @param {{zone: string}} p
55
+ */
56
+ perform: (c, p) => c.deleteZone({ zone: p.zone }),
57
+ },
58
+ 'firewall.disable': {
59
+ selector: { protocol: 'cloudflare', tool: 'set_firewall_rule' },
60
+ /** @param {{zone: string, rule_id: string}} p */
61
+ observed: (p) => ({ action_type: 'cloudflare.firewall.disable', zone: p.zone, rule_id: p.rule_id }),
62
+ /**
63
+ * @param {CloudflareClient} c
64
+ * @param {{zone: string, rule_id: string}} p
65
+ */
66
+ perform: (c, p) => c.setFirewallRule({ zone: p.zone, ruleId: p.rule_id, enabled: false }),
67
+ },
68
+ };
69
+ const adapter = createAdapter({ system: 'cloudflare', ops: OPS });
70
+ export const CLOUDFLARE_OPS = adapter.OPS;
71
+ /** @param {object[]} extra */
72
+ export function createCloudflareManifest(extra = []) { return manifestFromPack(CLOUDFLARE_ACTION_PACK, extra); }
73
+ export function guardCloudflareMutation(gate, client, args) { return adapter.guard(gate, client, args); }
74
+ export default { CLOUDFLARE_ACTION_PACK, CLOUDFLARE_OPS, createCloudflareManifest, guardCloudflareMutation };
75
+ //# sourceMappingURL=cloudflare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare.js","sourceRoot":"","sources":["../../src/adapters/cloudflare.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE5D;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,MAAM,CAAC,MAAM,CAAC;QACZ,EAAE,EAAE,uBAAuB,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,uBAAuB;QAC7F,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS;QAChE,KAAK,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC5D,GAAG,EAAE,+EAA+E;QACpF,iBAAiB,EAAE,EAAE,eAAe,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE;KAC7E,CAAC;IACF,MAAM,CAAC,MAAM,CAAC;QACZ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,MAAM,EAAE,IAAI,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACzG,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,139 @@
1
+ export declare const GCP_ACTION_PACK: readonly (Readonly<{
2
+ id: "gcp.iam.set_policy";
3
+ label: "GCP IAM set policy";
4
+ action_type: "gcp.iam.set_policy";
5
+ risk: "critical";
6
+ receipt_required: true;
7
+ assurance_class: "quorum";
8
+ match: {
9
+ protocol: string;
10
+ tool: string;
11
+ };
12
+ why: "Grants cloud permissions. Bind resource+member+role; quorum.";
13
+ execution_binding: {
14
+ required_fields: string[];
15
+ };
16
+ }> | Readonly<{
17
+ id: "gcp.sa_key.create";
18
+ label: "GCP service-account key create";
19
+ action_type: "gcp.sa_key.create";
20
+ risk: "critical";
21
+ receipt_required: true;
22
+ assurance_class: "class_a";
23
+ match: {
24
+ protocol: string;
25
+ tool: string;
26
+ };
27
+ why: "Mints long-lived cloud credentials. Bind the service account.";
28
+ execution_binding: {
29
+ required_fields: string[];
30
+ };
31
+ }> | Readonly<{
32
+ id: "gcp.project.delete";
33
+ label: "GCP project delete";
34
+ action_type: "gcp.project.delete";
35
+ risk: "critical";
36
+ receipt_required: true;
37
+ assurance_class: "quorum";
38
+ match: {
39
+ protocol: string;
40
+ tool: string;
41
+ };
42
+ why: "Deletes an entire project. Quorum.";
43
+ execution_binding: {
44
+ required_fields: string[];
45
+ };
46
+ }> | Readonly<{
47
+ id: "gcp.storage.bucket_delete";
48
+ label: "GCP bucket delete";
49
+ action_type: "gcp.storage.bucket_delete";
50
+ risk: "high";
51
+ receipt_required: true;
52
+ assurance_class: "class_a";
53
+ match: {
54
+ protocol: string;
55
+ tool: string;
56
+ };
57
+ why: "Destroys a storage bucket and its objects. Bind the bucket.";
58
+ execution_binding: {
59
+ required_fields: string[];
60
+ };
61
+ }>)[];
62
+ export declare const GCP_OPS: readonly string[];
63
+ export declare function createGcpManifest(extraActions?: never[]): {
64
+ '@version': string;
65
+ actions: any[];
66
+ };
67
+ export declare function guardGcpMutation(gate: any, client: any, args: any): Promise<{
68
+ result: any;
69
+ reliance: any;
70
+ execution: any;
71
+ }>;
72
+ declare const _default: {
73
+ GCP_ACTION_PACK: readonly (Readonly<{
74
+ id: "gcp.iam.set_policy";
75
+ label: "GCP IAM set policy";
76
+ action_type: "gcp.iam.set_policy";
77
+ risk: "critical";
78
+ receipt_required: true;
79
+ assurance_class: "quorum";
80
+ match: {
81
+ protocol: string;
82
+ tool: string;
83
+ };
84
+ why: "Grants cloud permissions. Bind resource+member+role; quorum.";
85
+ execution_binding: {
86
+ required_fields: string[];
87
+ };
88
+ }> | Readonly<{
89
+ id: "gcp.sa_key.create";
90
+ label: "GCP service-account key create";
91
+ action_type: "gcp.sa_key.create";
92
+ risk: "critical";
93
+ receipt_required: true;
94
+ assurance_class: "class_a";
95
+ match: {
96
+ protocol: string;
97
+ tool: string;
98
+ };
99
+ why: "Mints long-lived cloud credentials. Bind the service account.";
100
+ execution_binding: {
101
+ required_fields: string[];
102
+ };
103
+ }> | Readonly<{
104
+ id: "gcp.project.delete";
105
+ label: "GCP project delete";
106
+ action_type: "gcp.project.delete";
107
+ risk: "critical";
108
+ receipt_required: true;
109
+ assurance_class: "quorum";
110
+ match: {
111
+ protocol: string;
112
+ tool: string;
113
+ };
114
+ why: "Deletes an entire project. Quorum.";
115
+ execution_binding: {
116
+ required_fields: string[];
117
+ };
118
+ }> | Readonly<{
119
+ id: "gcp.storage.bucket_delete";
120
+ label: "GCP bucket delete";
121
+ action_type: "gcp.storage.bucket_delete";
122
+ risk: "high";
123
+ receipt_required: true;
124
+ assurance_class: "class_a";
125
+ match: {
126
+ protocol: string;
127
+ tool: string;
128
+ };
129
+ why: "Destroys a storage bucket and its objects. Bind the bucket.";
130
+ execution_binding: {
131
+ required_fields: string[];
132
+ };
133
+ }>)[];
134
+ GCP_OPS: readonly string[];
135
+ createGcpManifest: typeof createGcpManifest;
136
+ guardGcpMutation: typeof guardGcpMutation;
137
+ };
138
+ export default _default;
139
+ //# sourceMappingURL=gcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gcp.d.ts","sourceRoot":"","sources":["../../src/adapters/gcp.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6B1B,CAAC;AA0BH,eAAO,MAAM,OAAO,mBAAc,CAAC;AACnC,wBAAgB,iBAAiB,CAAC,YAAY,UAAK;;;EAA6D;AAChH,wBAAgB,gBAAgB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,IAAI,KAAA;;;;GAA+C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAClG,wBAAiF"}