@prism-d1/cli 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/dist/assets/github-workflows/prism-agent-eval.yml +2 -1
  2. package/dist/assets/github-workflows/prism-eval-gate-kiro.yml +12 -2
  3. package/dist/assets/gitlab-workflows/prism-eval-gate.yml +8 -0
  4. package/dist/assets/infra/bin/app.ts +61 -37
  5. package/dist/assets/infra/lib/constructs/otel-collector-construct.ts +96 -0
  6. package/dist/assets/infra/lib/constructs/security-agent-construct.ts +35 -30
  7. package/dist/assets/infra/lib/dashboard-stack.ts +27 -0
  8. package/dist/assets/infra/lib/lambda/otel-receiver.ts +278 -8
  9. package/dist/assets/infra/lib/lambda/pricing/litellm-snapshot.json +3769 -0
  10. package/dist/assets/infra/lib/lambda/pricing/price-source.ts +56 -0
  11. package/dist/assets/infra/lib/lambda/pricing/price-table.ts +240 -0
  12. package/dist/assets/infra/lib/lambda/pricing/prices-key.ts +6 -0
  13. package/dist/assets/infra/lib/lambda/pricing/reprice.ts +108 -0
  14. package/dist/assets/infra/lib/lambda/pricing-refresh.ts +352 -0
  15. package/dist/assets/infra/lib/lambda/velocity-widget.ts +124 -1
  16. package/dist/assets/infra/lib/metrics-pipeline-stack.ts +2 -110
  17. package/dist/assets/infra/lib/security-agent-resources.ts +136 -0
  18. package/dist/assets/infra/lib/security-agent-stack.ts +69 -0
  19. package/dist/assets/infra/package.json +4 -1
  20. package/dist/assets/metric-hooks/prepare-commit-msg +3 -1
  21. package/dist/assets/pentest-cdk/bin/app.ts +12 -0
  22. package/dist/assets/pentest-cdk/cdk.json +7 -0
  23. package/dist/assets/pentest-cdk/lib/pentest-target-stack.ts +206 -0
  24. package/dist/assets/pentest-cdk/package.json +18 -0
  25. package/dist/assets/pentest-cdk/tsconfig.json +12 -0
  26. package/dist/src/codewatch/config.d.ts +17 -0
  27. package/dist/src/codewatch/config.d.ts.map +1 -0
  28. package/dist/src/codewatch/config.js +40 -0
  29. package/dist/src/codewatch/config.js.map +1 -0
  30. package/dist/src/codewatch/gitleaks.d.ts +49 -0
  31. package/dist/src/codewatch/gitleaks.d.ts.map +1 -0
  32. package/dist/src/codewatch/gitleaks.js +160 -0
  33. package/dist/src/codewatch/gitleaks.js.map +1 -0
  34. package/dist/src/codewatch/globalHooks.d.ts +52 -0
  35. package/dist/src/codewatch/globalHooks.d.ts.map +1 -0
  36. package/dist/src/codewatch/globalHooks.js +235 -0
  37. package/dist/src/codewatch/globalHooks.js.map +1 -0
  38. package/dist/src/codewatch/hooks.d.ts +38 -0
  39. package/dist/src/codewatch/hooks.d.ts.map +1 -0
  40. package/dist/src/codewatch/hooks.js +176 -0
  41. package/dist/src/codewatch/hooks.js.map +1 -0
  42. package/dist/src/codewatch/prepush.d.ts +37 -0
  43. package/dist/src/codewatch/prepush.d.ts.map +1 -0
  44. package/dist/src/codewatch/prepush.js +231 -0
  45. package/dist/src/codewatch/prepush.js.map +1 -0
  46. package/dist/src/codewatch/results.d.ts +210 -0
  47. package/dist/src/codewatch/results.d.ts.map +1 -0
  48. package/dist/src/codewatch/results.js +127 -0
  49. package/dist/src/codewatch/results.js.map +1 -0
  50. package/dist/src/codewatch/reviewers/claude.d.ts +9 -0
  51. package/dist/src/codewatch/reviewers/claude.d.ts.map +1 -0
  52. package/dist/src/codewatch/reviewers/claude.js +48 -0
  53. package/dist/src/codewatch/reviewers/claude.js.map +1 -0
  54. package/dist/src/codewatch/reviewers/index.d.ts +39 -0
  55. package/dist/src/codewatch/reviewers/index.d.ts.map +1 -0
  56. package/dist/src/codewatch/reviewers/index.js +97 -0
  57. package/dist/src/codewatch/reviewers/index.js.map +1 -0
  58. package/dist/src/codewatch/reviewers/kiro.d.ts +14 -0
  59. package/dist/src/codewatch/reviewers/kiro.d.ts.map +1 -0
  60. package/dist/src/codewatch/reviewers/kiro.js +32 -0
  61. package/dist/src/codewatch/reviewers/kiro.js.map +1 -0
  62. package/dist/src/codewatch/reviewers/types.d.ts +56 -0
  63. package/dist/src/codewatch/reviewers/types.d.ts.map +1 -0
  64. package/dist/src/codewatch/reviewers/types.js +91 -0
  65. package/dist/src/codewatch/reviewers/types.js.map +1 -0
  66. package/dist/src/codewatch/rules.d.ts +12 -0
  67. package/dist/src/codewatch/rules.d.ts.map +1 -0
  68. package/dist/src/codewatch/rules.js +27 -0
  69. package/dist/src/codewatch/rules.js.map +1 -0
  70. package/dist/src/commands/_top/dashboard.d.ts +17 -0
  71. package/dist/src/commands/_top/dashboard.d.ts.map +1 -0
  72. package/dist/src/commands/_top/dashboard.js +76 -0
  73. package/dist/src/commands/_top/dashboard.js.map +1 -0
  74. package/dist/src/commands/_top/version.d.ts +62 -0
  75. package/dist/src/commands/_top/version.d.ts.map +1 -0
  76. package/dist/src/commands/_top/version.js +175 -0
  77. package/dist/src/commands/_top/version.js.map +1 -0
  78. package/dist/src/commands/bedrock-protection/scan-account.d.ts.map +1 -1
  79. package/dist/src/commands/bedrock-protection/scan-account.js +2 -1
  80. package/dist/src/commands/bedrock-protection/scan-account.js.map +1 -1
  81. package/dist/src/commands/bedrock-protection/scan-org.d.ts.map +1 -1
  82. package/dist/src/commands/bedrock-protection/scan-org.js +16 -4
  83. package/dist/src/commands/bedrock-protection/scan-org.js.map +1 -1
  84. package/dist/src/commands/bootstrapper/install-eval-harness.d.ts.map +1 -1
  85. package/dist/src/commands/bootstrapper/install-eval-harness.js +15 -48
  86. package/dist/src/commands/bootstrapper/install-eval-harness.js.map +1 -1
  87. package/dist/src/commands/bootstrapper/install-git-hooks.d.ts +13 -0
  88. package/dist/src/commands/bootstrapper/install-git-hooks.d.ts.map +1 -1
  89. package/dist/src/commands/bootstrapper/install-git-hooks.js +28 -147
  90. package/dist/src/commands/bootstrapper/install-git-hooks.js.map +1 -1
  91. package/dist/src/commands/bootstrapper/setup-otel-sync.d.ts +12 -6
  92. package/dist/src/commands/bootstrapper/setup-otel-sync.d.ts.map +1 -1
  93. package/dist/src/commands/bootstrapper/setup-otel-sync.js +18 -443
  94. package/dist/src/commands/bootstrapper/setup-otel-sync.js.map +1 -1
  95. package/dist/src/commands/codewatch/pre-commit.d.ts +7 -0
  96. package/dist/src/commands/codewatch/pre-commit.d.ts.map +1 -0
  97. package/dist/src/commands/codewatch/pre-commit.js +30 -0
  98. package/dist/src/commands/codewatch/pre-commit.js.map +1 -0
  99. package/dist/src/commands/codewatch/pre-push.d.ts +16 -0
  100. package/dist/src/commands/codewatch/pre-push.d.ts.map +1 -0
  101. package/dist/src/commands/codewatch/pre-push.js +32 -0
  102. package/dist/src/commands/codewatch/pre-push.js.map +1 -0
  103. package/dist/src/commands/codewatch/report.d.ts +22 -0
  104. package/dist/src/commands/codewatch/report.d.ts.map +1 -0
  105. package/dist/src/commands/codewatch/report.js +64 -0
  106. package/dist/src/commands/codewatch/report.js.map +1 -0
  107. package/dist/src/commands/enable/codeburn.d.ts +59 -0
  108. package/dist/src/commands/enable/codeburn.d.ts.map +1 -0
  109. package/dist/src/commands/enable/codeburn.js +531 -0
  110. package/dist/src/commands/enable/codeburn.js.map +1 -0
  111. package/dist/src/commands/enable/codewatch.d.ts +15 -0
  112. package/dist/src/commands/enable/codewatch.d.ts.map +1 -0
  113. package/dist/src/commands/enable/codewatch.js +186 -0
  114. package/dist/src/commands/enable/codewatch.js.map +1 -0
  115. package/dist/src/commands/enable/security.d.ts +41 -0
  116. package/dist/src/commands/enable/security.d.ts.map +1 -0
  117. package/dist/src/commands/enable/security.js +130 -0
  118. package/dist/src/commands/enable/security.js.map +1 -0
  119. package/dist/src/commands/export/otel.d.ts +31 -0
  120. package/dist/src/commands/export/otel.d.ts.map +1 -0
  121. package/dist/src/commands/export/otel.js +52 -0
  122. package/dist/src/commands/export/otel.js.map +1 -0
  123. package/dist/src/commands/git/claude-session-context.d.ts.map +1 -1
  124. package/dist/src/commands/git/claude-session-context.js +2 -1
  125. package/dist/src/commands/git/claude-session-context.js.map +1 -1
  126. package/dist/src/commands/git/commit-trailers.js +1 -1
  127. package/dist/src/commands/git/commit-trailers.js.map +1 -1
  128. package/dist/src/commands/security/code-review.d.ts +22 -0
  129. package/dist/src/commands/security/code-review.d.ts.map +1 -0
  130. package/dist/src/commands/security/code-review.js +43 -0
  131. package/dist/src/commands/security/code-review.js.map +1 -0
  132. package/dist/src/commands/security/findings.d.ts +15 -0
  133. package/dist/src/commands/security/findings.d.ts.map +1 -0
  134. package/dist/src/commands/security/findings.js +31 -0
  135. package/dist/src/commands/security/findings.js.map +1 -0
  136. package/dist/src/commands/security/pentest.d.ts +18 -0
  137. package/dist/src/commands/security/pentest.d.ts.map +1 -0
  138. package/dist/src/commands/security/pentest.js +32 -0
  139. package/dist/src/commands/security/pentest.js.map +1 -0
  140. package/dist/src/commands/security/threat-model.d.ts +16 -0
  141. package/dist/src/commands/security/threat-model.d.ts.map +1 -0
  142. package/dist/src/commands/security/threat-model.js +24 -0
  143. package/dist/src/commands/security/threat-model.js.map +1 -0
  144. package/dist/src/commands/security/threats.d.ts +12 -0
  145. package/dist/src/commands/security/threats.d.ts.map +1 -0
  146. package/dist/src/commands/security/threats.js +23 -0
  147. package/dist/src/commands/security/threats.js.map +1 -0
  148. package/dist/src/commands/securityagent/setup.d.ts +19 -5
  149. package/dist/src/commands/securityagent/setup.d.ts.map +1 -1
  150. package/dist/src/commands/securityagent/setup.js +25 -189
  151. package/dist/src/commands/securityagent/setup.js.map +1 -1
  152. package/dist/src/commands/workshop/verify-setup.d.ts.map +1 -1
  153. package/dist/src/commands/workshop/verify-setup.js +5 -3
  154. package/dist/src/commands/workshop/verify-setup.js.map +1 -1
  155. package/dist/src/dashboard/codewatch.d.ts +106 -0
  156. package/dist/src/dashboard/codewatch.d.ts.map +1 -0
  157. package/dist/src/dashboard/codewatch.js +120 -0
  158. package/dist/src/dashboard/codewatch.js.map +1 -0
  159. package/dist/src/dashboard/commits.d.ts +96 -0
  160. package/dist/src/dashboard/commits.d.ts.map +1 -0
  161. package/dist/src/dashboard/commits.js +207 -0
  162. package/dist/src/dashboard/commits.js.map +1 -0
  163. package/dist/src/dashboard/page.d.ts +10 -0
  164. package/dist/src/dashboard/page.d.ts.map +1 -0
  165. package/dist/src/dashboard/page.js +470 -0
  166. package/dist/src/dashboard/page.js.map +1 -0
  167. package/dist/src/dashboard/payload.d.ts +114 -0
  168. package/dist/src/dashboard/payload.d.ts.map +1 -0
  169. package/dist/src/dashboard/payload.js +96 -0
  170. package/dist/src/dashboard/payload.js.map +1 -0
  171. package/dist/src/dashboard/report.d.ts +99 -0
  172. package/dist/src/dashboard/report.d.ts.map +1 -0
  173. package/dist/src/dashboard/report.js +300 -0
  174. package/dist/src/dashboard/report.js.map +1 -0
  175. package/dist/src/dashboard/repos.d.ts +58 -0
  176. package/dist/src/dashboard/repos.d.ts.map +1 -0
  177. package/dist/src/dashboard/repos.js +111 -0
  178. package/dist/src/dashboard/repos.js.map +1 -0
  179. package/dist/src/dashboard/security.d.ts +130 -0
  180. package/dist/src/dashboard/security.d.ts.map +1 -0
  181. package/dist/src/dashboard/security.js +144 -0
  182. package/dist/src/dashboard/security.js.map +1 -0
  183. package/dist/src/dashboard/server.d.ts +52 -0
  184. package/dist/src/dashboard/server.d.ts.map +1 -0
  185. package/dist/src/dashboard/server.js +163 -0
  186. package/dist/src/dashboard/server.js.map +1 -0
  187. package/dist/src/dashboard/setup.d.ts +67 -0
  188. package/dist/src/dashboard/setup.d.ts.map +1 -0
  189. package/dist/src/dashboard/setup.js +146 -0
  190. package/dist/src/dashboard/setup.js.map +1 -0
  191. package/dist/src/dashboard/usage.d.ts +43 -0
  192. package/dist/src/dashboard/usage.d.ts.map +1 -0
  193. package/dist/src/dashboard/usage.js +88 -0
  194. package/dist/src/dashboard/usage.js.map +1 -0
  195. package/dist/src/index.d.ts +1 -0
  196. package/dist/src/index.d.ts.map +1 -1
  197. package/dist/src/index.js +48 -2
  198. package/dist/src/index.js.map +1 -1
  199. package/dist/src/security/cfn-diff.d.ts +57 -0
  200. package/dist/src/security/cfn-diff.d.ts.map +1 -0
  201. package/dist/src/security/cfn-diff.js +112 -0
  202. package/dist/src/security/cfn-diff.js.map +1 -0
  203. package/dist/src/security/errors.d.ts +45 -0
  204. package/dist/src/security/errors.d.ts.map +1 -0
  205. package/dist/src/security/errors.js +116 -0
  206. package/dist/src/security/errors.js.map +1 -0
  207. package/dist/src/security/marker.d.ts +46 -0
  208. package/dist/src/security/marker.d.ts.map +1 -0
  209. package/dist/src/security/marker.js +120 -0
  210. package/dist/src/security/marker.js.map +1 -0
  211. package/dist/src/security/pentest-dockerfile.d.ts +8 -0
  212. package/dist/src/security/pentest-dockerfile.d.ts.map +1 -0
  213. package/dist/src/security/pentest-dockerfile.js +163 -0
  214. package/dist/src/security/pentest-dockerfile.js.map +1 -0
  215. package/dist/src/security/pentest.d.ts +233 -0
  216. package/dist/src/security/pentest.d.ts.map +1 -0
  217. package/dist/src/security/pentest.js +1057 -0
  218. package/dist/src/security/pentest.js.map +1 -0
  219. package/dist/src/security/repo.d.ts +25 -0
  220. package/dist/src/security/repo.d.ts.map +1 -0
  221. package/dist/src/security/repo.js +38 -0
  222. package/dist/src/security/repo.js.map +1 -0
  223. package/dist/src/security/review.d.ts +202 -0
  224. package/dist/src/security/review.d.ts.map +1 -0
  225. package/dist/src/security/review.js +706 -0
  226. package/dist/src/security/review.js.map +1 -0
  227. package/dist/src/security/setup.d.ts +193 -0
  228. package/dist/src/security/setup.d.ts.map +1 -0
  229. package/dist/src/security/setup.js +728 -0
  230. package/dist/src/security/setup.js.map +1 -0
  231. package/dist/src/security/threat-model.d.ts +133 -0
  232. package/dist/src/security/threat-model.d.ts.map +1 -0
  233. package/dist/src/security/threat-model.js +653 -0
  234. package/dist/src/security/threat-model.js.map +1 -0
  235. package/dist/src/utils/audit-bedrock.d.ts +1 -0
  236. package/dist/src/utils/audit-bedrock.d.ts.map +1 -1
  237. package/dist/src/utils/audit-bedrock.js +133 -0
  238. package/dist/src/utils/audit-bedrock.js.map +1 -1
  239. package/dist/src/utils/audit-org.d.ts +1 -0
  240. package/dist/src/utils/audit-org.d.ts.map +1 -1
  241. package/dist/src/utils/audit-org.js +155 -0
  242. package/dist/src/utils/audit-org.js.map +1 -1
  243. package/dist/src/utils/exec.d.ts +6 -0
  244. package/dist/src/utils/exec.d.ts.map +1 -1
  245. package/dist/src/utils/exec.js +12 -1
  246. package/dist/src/utils/exec.js.map +1 -1
  247. package/dist/src/utils/otel-sync-schedule.d.ts +41 -0
  248. package/dist/src/utils/otel-sync-schedule.d.ts.map +1 -0
  249. package/dist/src/utils/otel-sync-schedule.js +90 -0
  250. package/dist/src/utils/otel-sync-schedule.js.map +1 -0
  251. package/dist/src/utils/tool-check.d.ts +14 -0
  252. package/dist/src/utils/tool-check.d.ts.map +1 -0
  253. package/dist/src/utils/tool-check.js +42 -0
  254. package/dist/src/utils/tool-check.js.map +1 -0
  255. package/package.json +3 -2
@@ -0,0 +1,163 @@
1
+ /**
2
+ * The `dockerfile` app-type adapter for `prism-cli security pentest`.
3
+ *
4
+ * Builds the app image from the repo's Dockerfile and runs it on Fargate behind
5
+ * an internal ALB in a fresh private VPC, by synth/deploy of the shipped CDK
6
+ * app in commands/security/pentest-cdk (generalized from the proven spike).
7
+ * `plan` synths + diffs (no writes); `apply` deploys, reads the stack outputs,
8
+ * and uploads the repo-at-HEAD source zip for white-box testing. Teardown is
9
+ * not here: pentest.ts deletes the recorded stack with CloudFormation.
10
+ *
11
+ * Everything AWS/cdk runs through child processes here, so this file is only
12
+ * exercised on the real command path; the orchestration in pentest.ts is tested
13
+ * against a fake adapter.
14
+ */
15
+ import { execFileSync, spawnSync } from 'node:child_process';
16
+ import { existsSync, statSync } from 'node:fs';
17
+ import { join, relative, resolve, dirname } from 'node:path';
18
+ import { fileURLToPath } from 'node:url';
19
+ import { Abort, call } from './setup.js';
20
+ import { repoZipKey } from './repo.js';
21
+ import { getAssetPath } from '../utils/root.js';
22
+ const __dirname = dirname(fileURLToPath(import.meta.url));
23
+ const CDK_MAX_BUFFER = 64 * 1024 * 1024;
24
+ /** Hours until the environment's prism:expires-at tag; the env is disposable. */
25
+ const TTL_HOURS = 24;
26
+ /** The shipped CDK app dir: the built asset when present, else the source tree (dev/tsx). */
27
+ function assetDir() {
28
+ // Built: dist/assets/pentest-cdk, found the same way enable security finds
29
+ // its infra asset (walks up from this file). Dev/tsx: the source tree.
30
+ let built = null;
31
+ try {
32
+ built = getAssetPath(import.meta.url, 'pentest-cdk');
33
+ }
34
+ catch { /* not built */ }
35
+ const source = resolve(__dirname, '..', 'commands', 'security', 'pentest-cdk');
36
+ for (const d of [built, source])
37
+ if (d && existsSync(join(d, 'bin', 'app.ts')))
38
+ return d;
39
+ throw new Abort(`pentest CDK app not found (looked for dist/assets/pentest-cdk and ${source}); run npm run build`);
40
+ }
41
+ function cleanEnv(extra) {
42
+ const env = { ...process.env, ...extra };
43
+ for (const k of Object.keys(env))
44
+ if (k.startsWith('npm_'))
45
+ delete env[k];
46
+ return env;
47
+ }
48
+ /** Short, CFN-safe run id from the repo name plus a base36 timestamp. */
49
+ export function runSlug(repo, now) {
50
+ const name = (repo.id.split('/').pop() || 'app').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 24) || 'app';
51
+ return `${name}-${now.toString(36)}`;
52
+ }
53
+ export function dockerfileApp(opts) {
54
+ const dir = () => assetDir();
55
+ const profileArgs = opts.profile ? ['--profile', opts.profile] : [];
56
+ function ensureDeps(d) {
57
+ if (existsSync(join(d, 'node_modules', '.bin', 'cdk')))
58
+ return;
59
+ execFileSync('npm', ['install', '--no-audit', '--no-fund'], { cwd: d, stdio: 'inherit', env: cleanEnv({}) });
60
+ }
61
+ function cdkEnv(ctx) {
62
+ const acct = call(ctx, ['sts', 'get-caller-identity']).json?.Account;
63
+ return cleanEnv({ CDK_DEFAULT_ACCOUNT: String(acct || ''), CDK_DEFAULT_REGION: ctx.opts.region, AWS_DEFAULT_REGION: ctx.opts.region, AWS_REGION: ctx.opts.region, AWS_PAGER: '' });
64
+ }
65
+ const ctxArgs = (c) => Object.entries(c).flatMap(([k, v]) => ['-c', `${k}=${v}`]);
66
+ function context(repo, cfg, slug) {
67
+ const appDir = join(repo.root, cfg.path);
68
+ // DockerImageAsset takes the Dockerfile relative to the build context.
69
+ const dockerfile = relative(appDir, join(repo.root, cfg.dockerfile)) || 'Dockerfile';
70
+ const byType = (t) => cfg.actors.filter((a) => a.auth.providerType === t).map((a) => a.auth.value);
71
+ return {
72
+ slug, appDir, dockerfile, port: String(cfg.port), healthPath: cfg.healthPath, zoneName: `${slug}.prism.internal`, ttlHours: String(TTL_HOURS),
73
+ // JSON in context values: spawnSync passes argv without a shell, so no quoting is involved.
74
+ env: JSON.stringify(Object.fromEntries(cfg.env.map((e) => [e.name, e.value]))),
75
+ secrets: JSON.stringify(Object.fromEntries(cfg.secretEnv.map((e) => [e.name, e.secret]))),
76
+ actorSecrets: JSON.stringify(byType('SECRETS_MANAGER')),
77
+ actorLambdas: JSON.stringify(byType('AWS_LAMBDA')),
78
+ };
79
+ }
80
+ function plan(ctx, repo, cfg) {
81
+ const slug = runSlug(repo, ctx.deps.now().getTime());
82
+ const stack = `PrismPentest-${slug}`;
83
+ const host = `app.${slug}.prism.internal`;
84
+ const d = dir();
85
+ ensureDeps(d);
86
+ const env = cdkEnv(ctx);
87
+ const bin = join(d, 'node_modules', '.bin', 'cdk');
88
+ const ctxA = ctxArgs(context(repo, cfg, slug));
89
+ const synth = spawnSync(bin, ['synth', '--quiet', ...ctxA, ...profileArgs], { cwd: d, env, encoding: 'utf8', maxBuffer: CDK_MAX_BUFFER });
90
+ if (synth.status !== 0)
91
+ throw new Abort(`cdk synth of the pentest target failed:\n${(synth.stderr || '').split('\n').slice(-15).join('\n')}`);
92
+ const diff = spawnSync(bin, ['diff', stack, '--no-color', '--method=template', ...ctxA, ...profileArgs], { cwd: d, env, encoding: 'utf8', maxBuffer: CDK_MAX_BUFFER });
93
+ const diffText = `${diff.stdout || ''}${diff.stderr || ''}`.trim() || 'A private VPC (isolated subnets only), ECR/S3/Logs VPC endpoints, a Fargate service, an internal ALB, four security groups, a scoped service role, a source bucket and a log group.';
94
+ return { diffText, targetHost: host, stack, slug };
95
+ }
96
+ function apply(ctx, repo, cfg, p, approveAll) {
97
+ const d = dir();
98
+ ensureDeps(d);
99
+ const env = cdkEnv(ctx);
100
+ const bin = join(d, 'node_modules', '.bin', 'cdk');
101
+ const ctxA = ctxArgs(context(repo, cfg, p.slug));
102
+ const approval = approveAll ? ['--require-approval', 'never'] : [];
103
+ const deploy = spawnSync(bin, ['deploy', p.stack, ...approval, ...ctxA, ...profileArgs], { cwd: d, env, stdio: 'inherit' });
104
+ if (deploy.status !== 0)
105
+ throw new Abort(`cdk deploy of the pentest target (${p.stack}) failed; check the output above and CloudFormation.`);
106
+ const outputs = readStackOutputs(ctx, p.stack);
107
+ const subnetArns = (outputs.SubnetArns || '').split(',').filter(Boolean);
108
+ if (!outputs.VpcArn || !subnetArns.length || !outputs.AgentSecurityGroupArn || !outputs.ServiceRoleArn || !outputs.AgentLogGroup || !outputs.PrivateHost || !outputs.SourceBucket || !outputs.TargetGroupArn) {
109
+ throw new Abort(`the pentest stack ${p.stack} did not report the expected outputs; cannot configure the pentest.`);
110
+ }
111
+ const sourceZipS3 = uploadSourceZip(ctx, repo, outputs.SourceBucket);
112
+ return {
113
+ targetHost: outputs.PrivateHost, targetUrl: `http://${outputs.PrivateHost}`,
114
+ vpcArn: outputs.VpcArn, subnetArns, pentestSubnetArn: subnetArns[0],
115
+ agentSecurityGroupArn: outputs.AgentSecurityGroupArn, serviceRoleArn: outputs.ServiceRoleArn,
116
+ logGroup: outputs.AgentLogGroup, sourceZipS3, expiresAt: outputs.ExpiresAt || '',
117
+ stack: p.stack, slug: p.slug,
118
+ targetGroupArn: outputs.TargetGroupArn, appLogGroup: outputs.AppLogGroup || '',
119
+ };
120
+ }
121
+ function readStackOutputs(ctx, stack) {
122
+ const r = call(ctx, ['cloudformation', 'describe-stacks', '--stack-name', stack]);
123
+ const outs = r.json?.Stacks?.[0]?.Outputs || [];
124
+ const map = {};
125
+ for (const o of outs)
126
+ if (o?.OutputKey)
127
+ map[String(o.OutputKey)] = String(o.OutputValue ?? '');
128
+ return map;
129
+ }
130
+ function uploadSourceZip(ctx, repo, bucket) {
131
+ const dirTmp = ctx.deps.makeTempDir();
132
+ const zip = join(dirTmp, 'source.zip');
133
+ const archived = ctx.deps.git(['-C', repo.root, 'archive', 'HEAD', '--format=zip', '-o', zip]);
134
+ if (!archived.ok || !existsSync(zip)) {
135
+ ctx.deps.log('Warning: git archive HEAD failed; the pentest runs without white-box source.');
136
+ return null;
137
+ }
138
+ const key = repoZipKey(repo.slug);
139
+ call(ctx, ['s3api', 'put-object', '--bucket', bucket, '--key', key, '--body', zip]);
140
+ return `s3://${bucket}/${key}`;
141
+ }
142
+ return {
143
+ type: 'dockerfile',
144
+ detect: (appDir, dockerfile) => {
145
+ try {
146
+ if (!statSync(appDir).isDirectory())
147
+ return false;
148
+ }
149
+ catch {
150
+ return false;
151
+ }
152
+ const f = dockerfile ?? join(appDir, 'Dockerfile');
153
+ try {
154
+ return statSync(f).isFile();
155
+ }
156
+ catch {
157
+ return false;
158
+ }
159
+ },
160
+ plan, apply,
161
+ };
162
+ }
163
+ //# sourceMappingURL=pentest-dockerfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pentest-dockerfile.js","sourceRoot":"","sources":["../../../src/security/pentest-dockerfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EA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type PentestInfo, type PrismResult, type ResultEntry } from '../codewatch/results.js';
2
+ import { type Ctx, type RepoCtx, type SecurityOptions } from './setup.js';
3
+ import { TERMINAL, type ReviewDeps } from './review.js';
4
+ /** A pentest runs for hours (the spike took ~2h50m), so --wait defaults to 6h, not code-review's 30m. */
5
+ export declare const PENTEST_DEFAULT_TIMEOUT_MIN = 360;
6
+ /** Terminal job states (STOPPING is not terminal). Same set as code-review. */
7
+ export { TERMINAL };
8
+ export declare const FAIL_ON_LEVELS: readonly ["critical", "high", "medium", "low"];
9
+ export declare const PENTEST_NOTICE = "prism-cli security pentest deploys a TEMPORARY private environment (a VPC with private subnets only, Fargate behind an internal ALB, VPC endpoints, a service role, a source bucket and a log group) into the AWS account your credentials point to, builds and pushes your app image, uploads the repo at HEAD, registers and verifies a PRIVATE_VPC target domain, and starts an AWS Security Agent penetration test against that environment only. The environment is reachable only by the pentest agent; it has no public endpoint. It is torn down when the job finishes (--keep leaves it up, --cleanup removes it later).";
10
+ export declare const COST_WARNING = "Cost: AWS Security Agent penetration testing is billed in task-hours (publicly reported at $50 per task-hour, per-second metered; verify current pricing at the AWS Security Agent pricing page), plus the Fargate, internal ALB and VPC-endpoint running cost for as long as the environment is up. A run can last hours (the reference run took ~2h50m).";
11
+ export interface PentestOptions extends SecurityOptions {
12
+ /** Repo top level (default: the working directory). */
13
+ path?: string;
14
+ /** Docker build context, relative to the repo root; overrides "path" in pentest.json. */
15
+ appDir?: string;
16
+ /** Dockerfile, relative to the repo root; overrides "dockerfile" in pentest.json. */
17
+ dockerfile?: string;
18
+ /** Adapter to build the app with (default: inferred, v1 only "dockerfile"). */
19
+ appType?: string;
20
+ /** commander turns --no-wait off; default here is already not to wait, so this is opt-in. */
21
+ wait?: boolean;
22
+ timeout?: string | number;
23
+ keep?: boolean;
24
+ status?: boolean;
25
+ cleanup?: boolean;
26
+ includeFalsePositives?: boolean;
27
+ failOn?: string;
28
+ /** security findings --pentest only: a specific job id, and the display severity floor. */
29
+ job?: string;
30
+ severity?: string;
31
+ }
32
+ export declare const PENTEST_CONFIG_PATH = ".prism/pentest.json";
33
+ export interface ActorConfig {
34
+ identifier: string;
35
+ uris?: string[];
36
+ auth: {
37
+ providerType: string;
38
+ value: string;
39
+ };
40
+ }
41
+ export interface PentestConfig {
42
+ appType: string;
43
+ /** Docker build context, relative to the repo root. */
44
+ path: string;
45
+ /** Dockerfile, relative to the repo root (default: <path>/Dockerfile). */
46
+ dockerfile: string;
47
+ port: number;
48
+ healthPath: string;
49
+ /** Literal env values plus resolved Secrets Manager references. */
50
+ env: {
51
+ name: string;
52
+ value: string;
53
+ }[];
54
+ secretEnv: {
55
+ name: string;
56
+ secret: string;
57
+ }[];
58
+ actors: ActorConfig[];
59
+ excludeRiskTypes: string[];
60
+ }
61
+ /**
62
+ * Loads and validates `.prism/pentest.json`. A sensitive-looking env value must
63
+ * be a Secrets Manager reference ({ "secret": "<arn>" }), never a literal, so
64
+ * no credential lands in the committed file.
65
+ */
66
+ export declare function loadPentestConfig(repoRoot: string, override?: {
67
+ appType?: string;
68
+ path?: string;
69
+ appDir?: string;
70
+ dockerfile?: string;
71
+ }): PentestConfig;
72
+ /** The deployed temporary environment the pentest runs against. */
73
+ export interface TargetEnv {
74
+ /** The verified target host (app.<zone>) and its URL. */
75
+ targetHost: string;
76
+ targetUrl: string;
77
+ vpcArn: string;
78
+ /** Every private subnet (for the agent space). */
79
+ subnetArns: string[];
80
+ /** The ONE subnet create-pentest --vpc-config accepts. */
81
+ pentestSubnetArn: string;
82
+ agentSecurityGroupArn: string;
83
+ serviceRoleArn: string;
84
+ logGroup: string;
85
+ sourceZipS3?: string | null;
86
+ expiresAt: string;
87
+ /** CloudFormation stack of the environment, for teardown. */
88
+ stack: string;
89
+ slug: string;
90
+ /** The ALB target group in front of the app; the command waits for a healthy target in it. */
91
+ targetGroupArn: string;
92
+ /** The app container's log group, named in the health-timeout hint. */
93
+ appLogGroup: string;
94
+ }
95
+ export interface PentestPlan {
96
+ /** Human-readable summary of what the deploy will create (cdk diff). */
97
+ diffText: string;
98
+ /** The target host the deploy will stand up (derivable before deploy). */
99
+ targetHost: string;
100
+ stack: string;
101
+ slug: string;
102
+ }
103
+ /**
104
+ * An app type knows how to stand its app up as a private pentest target and
105
+ * tear it down. `plan` is read-only (synth + diff); `apply` deploys and returns
106
+ * the environment handle. v1 ships only the dockerfile adapter.
107
+ */
108
+ export interface PentestApp {
109
+ readonly type: string;
110
+ /** Can this adapter handle the app at `dir`? */
111
+ /** True when the build context dir and (for dockerfile) the Dockerfile exist. */
112
+ detect(dir: string, dockerfile?: string): boolean;
113
+ plan(ctx: Ctx, repo: RepoCtx, cfg: PentestConfig): PentestPlan;
114
+ apply(ctx: Ctx, repo: RepoCtx, cfg: PentestConfig, plan: PentestPlan, approveAll: boolean): TargetEnv;
115
+ }
116
+ interface PentestJob {
117
+ jobId: string;
118
+ status: string;
119
+ step?: string | null;
120
+ reason?: string | null;
121
+ overview?: string | null;
122
+ createdAt?: string;
123
+ updatedAt?: string;
124
+ }
125
+ export declare function toPentestJob(j: any): PentestJob;
126
+ interface Env {
127
+ targetHost: string;
128
+ stack: string;
129
+ slug: string;
130
+ expiresAt: string;
131
+ agentSgId?: string | null;
132
+ appLogGroup?: string | null;
133
+ targetDomainId?: string | null;
134
+ }
135
+ export declare function pendingPentestResult(o: {
136
+ job: PentestJob;
137
+ pentestId: string;
138
+ agentSpaceId: string;
139
+ dedicated: boolean;
140
+ region: string;
141
+ account: string;
142
+ env: Env;
143
+ commit: string | null;
144
+ branch: string | null;
145
+ startedAt: string;
146
+ }): PrismResult;
147
+ export declare function countByRisk(fs: PentestFinding[]): Record<string, number>;
148
+ export interface PentestFinding {
149
+ findingId: string;
150
+ riskLevel: string;
151
+ confidence: string;
152
+ title: string;
153
+ riskType: string;
154
+ description: string;
155
+ }
156
+ export declare function completedPentestResult(o: {
157
+ job: PentestJob;
158
+ pentestId: string;
159
+ agentSpaceId: string;
160
+ dedicated: boolean;
161
+ region: string;
162
+ account: string;
163
+ env: Env;
164
+ commit: string | null;
165
+ branch: string | null;
166
+ startedAt: string;
167
+ findings: PentestFinding[];
168
+ now: Date;
169
+ wallS?: number | null;
170
+ }): PrismResult;
171
+ export declare function totalsLine(c: Record<string, number>): string;
172
+ export declare function getPentestJob(ctx: Ctx, agentSpaceId: string, jobId: string): PentestJob;
173
+ /** Pentest findings, dropping FALSE_POSITIVE confidence unless `includeFP`. */
174
+ export declare function fetchPentestFindings(ctx: Ctx, agentSpaceId: string, jobId: string, includeFP: boolean): PentestFinding[];
175
+ export declare function failOnHit(fs: PentestFinding[], failOn: string | undefined): boolean;
176
+ export type PollOutcome = {
177
+ kind: 'done' | 'timeout' | 'interrupted';
178
+ job: PentestJob;
179
+ };
180
+ export declare function pollPentest(ctx: Ctx, agentSpaceId: string, first: PentestJob, timeoutMin: number): Promise<PollOutcome>;
181
+ /** The --profile/--region this run was given, so a printed follow-up command targets the same account and region. */
182
+ export declare const followUpFlags: (ctx: Ctx) => string;
183
+ /** The newest security-pentest record for this account+region (pending first, else any), used by --status/--cleanup/findings. */
184
+ export declare function latestPentestEntry(root: string, account: string, region: string, jobId?: string): ResultEntry | null;
185
+ /** cdk deploy returns before the ALB has a healthy target; starting then gets 503s and PREFLIGHT fails. */
186
+ export declare const HEALTH_TIMEOUT_MS: number;
187
+ export declare const HEALTH_POLL_MS = 15000;
188
+ /**
189
+ * Polls the ALB target group until at least one target is `healthy`. On
190
+ * timeout aborts with the targets' state, reason and description and how to
191
+ * read the app's logs -- before anything is created in Security Agent.
192
+ */
193
+ export declare function waitForHealthyTarget(ctx: Ctx, env: TargetEnv, say: (l?: string) => void, timeoutMs?: number): Promise<void>;
194
+ /** Security Agent removes its ENIs a while after a job ends; the stack cannot delete the subnets/SG until then. */
195
+ export declare const ENI_DRAIN_TIMEOUT_MS: number;
196
+ export declare const ENI_POLL_MS = 15000;
197
+ /** How long one stack deletion may take (VPC endpoints, the ALB and the bucket-emptying custom resource). */
198
+ export declare const STACK_DELETE_TIMEOUT_MS: number;
199
+ export declare const STACK_POLL_MS = 15000;
200
+ /**
201
+ * The environment stack a record belongs to: the stored name, else the slug,
202
+ * else derived from the target host. shortcut: the derivation follows the
203
+ * dockerfile adapter's naming (PrismPentest-<slug>, app.<slug>.prism.internal)
204
+ * and exists for records whose earlier teardown cleared the name; drop it once
205
+ * those records are gone.
206
+ */
207
+ export declare function recordedStackName(p: PentestInfo): string | null;
208
+ export declare function teardownFailedLine(ctx: Ctx, p: PentestInfo): string;
209
+ /** `prism-cli security pentest`. Returns the exit code. */
210
+ export declare function securityPentest(input: PentestOptions, deps: ReviewDeps, app: PentestApp): Promise<number>;
211
+ /**
212
+ * `prism-cli security findings --pentest [<job>]`. Read-only in AWS: refreshes
213
+ * the pentest job, completes the cached record in place, and prints the
214
+ * findings. Never tears the environment down (that is pentest --status /
215
+ * --cleanup). Returns the exit code.
216
+ */
217
+ export declare function securityPentestFindings(input: PentestOptions, deps: ReviewDeps): Promise<number>;
218
+ /** create-target-domain (PRIVATE_VPC) + verify. UNREACHABLE and VERIFIED/PENDING are OK; FAILED aborts. Returns the domain id. */
219
+ export declare function createAndVerifyDomain(ctx: Ctx, host: string, say: (l?: string) => void): string;
220
+ /**
221
+ * The agent space to run in. v1 creates a DEDICATED pentest space per run (the
222
+ * spike-proven path), bound to the run's VPC, role, log group and target
223
+ * domain. shortcut: reuse the shared PrismD1SecurityAgent space via
224
+ * update-agent-space once that path is proven in an account (see the design's
225
+ * open question); reusing it untested risks the code-review space's config.
226
+ */
227
+ export declare function resolveAgentSpace(ctx: Ctx, env: TargetEnv, domainId: string, say: (l?: string) => void): {
228
+ agentSpaceId: string;
229
+ dedicated: boolean;
230
+ };
231
+ /** create-pentest with vpc-config (ONE subnet), a single ALLOW rule for the target URL, and the source zip. Returns the pentest id. */
232
+ export declare function createPentest(ctx: Ctx, cfg: PentestConfig, env: TargetEnv, agentSpaceId: string, say: (l?: string) => void): string;
233
+ //# sourceMappingURL=pentest.d.ts.map
@@ -0,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