jso-protector 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +960 -0
  2. package/LICENSE +90 -0
  3. package/MIGRATION.md +207 -0
  4. package/README.md +1477 -0
  5. package/RELEASE.md +82 -0
  6. package/SECURITY.md +71 -0
  7. package/ai-cli.js +392 -0
  8. package/ai.js +176 -0
  9. package/bin/jso-protector.js +12066 -0
  10. package/browserify.d.ts +10 -0
  11. package/browserify.js +88 -0
  12. package/bun.d.ts +10 -0
  13. package/bun.js +41 -0
  14. package/ci/Jenkinsfile +82 -0
  15. package/ci/argo-workflows.yaml +121 -0
  16. package/ci/azure-pipelines.yml +56 -0
  17. package/ci/bitbucket-pipelines.yml +43 -0
  18. package/ci/buildkite.yml +50 -0
  19. package/ci/circleci.yml +60 -0
  20. package/ci/drone.yml +67 -0
  21. package/ci/github-actions.yml +51 -0
  22. package/ci/gitlab-ci.yml +39 -0
  23. package/ci/gocd.yaml +79 -0
  24. package/ci/teamcity.kts +79 -0
  25. package/ci/tekton.yaml +106 -0
  26. package/ci/verify-package.js +748 -0
  27. package/ci/verify-publish-metadata.js +147 -0
  28. package/ci/verify-templates.js +195 -0
  29. package/ci/woodpecker.yml +53 -0
  30. package/compliance/cli.js +204 -0
  31. package/compliance/evidence-forwarder.js +209 -0
  32. package/compliance/pci-dss-v4/controls.json +75 -0
  33. package/compliance/pci-dss-v4/index.js +2613 -0
  34. package/config/named-sets.js +185 -0
  35. package/esbuild.d.ts +16 -0
  36. package/esbuild.js +190 -0
  37. package/examples/README.md +78 -0
  38. package/examples/browserify/build.js +20 -0
  39. package/examples/bun/package.json +13 -0
  40. package/examples/bun/scripts/protect-release.js +28 -0
  41. package/examples/cli-basic/jso.config.cjs +23 -0
  42. package/examples/cli-basic/jso.config.json +15 -0
  43. package/examples/cli-basic/package.json +14 -0
  44. package/examples/cli-basic/scripts/build.js +10 -0
  45. package/examples/curl/README.md +55 -0
  46. package/examples/curl/protect.sh +106 -0
  47. package/examples/esbuild/build.js +19 -0
  48. package/examples/grunt/Gruntfile.js +29 -0
  49. package/examples/gulp/gulpfile.js +19 -0
  50. package/examples/helm/Chart.yaml +27 -0
  51. package/examples/helm/README.md +69 -0
  52. package/examples/helm/templates/_helpers.tpl +23 -0
  53. package/examples/helm/templates/_podtemplate.tpl +64 -0
  54. package/examples/helm/templates/job.yaml +39 -0
  55. package/examples/helm/templates/secret.yaml +17 -0
  56. package/examples/helm/values.yaml +54 -0
  57. package/examples/kubernetes/job.yaml +123 -0
  58. package/examples/metro.config.js +11 -0
  59. package/examples/nextjs/next.config.js +11 -0
  60. package/examples/node-api/protect-release.js +28 -0
  61. package/examples/node-api/release-summary.js +59 -0
  62. package/examples/parcel/package.json +13 -0
  63. package/examples/parcel/scripts/protect-release.js +28 -0
  64. package/examples/payment-page-script-inventory.json +62 -0
  65. package/examples/payment-page-security-headers.json +46 -0
  66. package/examples/pre-commit/.pre-commit-config.yaml +33 -0
  67. package/examples/pre-commit/README.md +45 -0
  68. package/examples/react-native/README.md +208 -0
  69. package/examples/react-native/metro.config.js +11 -0
  70. package/examples/rollup/rollup.config.js +20 -0
  71. package/examples/rspack/rspack.config.js +28 -0
  72. package/examples/turbopack/package.json +13 -0
  73. package/examples/turbopack/scripts/protect-release.js +28 -0
  74. package/examples/vite/vite.config.js +18 -0
  75. package/examples/webpack/webpack.config.js +21 -0
  76. package/examples/webpack-loader/webpack.config.js +22 -0
  77. package/governance/index.d.ts +18 -0
  78. package/governance/index.js +309 -0
  79. package/grunt.d.ts +4 -0
  80. package/grunt.js +111 -0
  81. package/gulp.d.ts +10 -0
  82. package/gulp.js +106 -0
  83. package/index.d.ts +879 -0
  84. package/index.js +607 -0
  85. package/jso.config.example.json +29 -0
  86. package/jso.config.schema.json +548 -0
  87. package/metro.d.ts +43 -0
  88. package/metro.js +117 -0
  89. package/next.d.ts +24 -0
  90. package/next.js +64 -0
  91. package/package.json +241 -0
  92. package/parcel.d.ts +10 -0
  93. package/parcel.js +40 -0
  94. package/react-native.d.ts +2 -0
  95. package/react-native.js +3 -0
  96. package/release-signer.js +245 -0
  97. package/rollup.d.ts +13 -0
  98. package/rollup.js +71 -0
  99. package/rspack-loader.d.ts +13 -0
  100. package/rspack-loader.js +11 -0
  101. package/rspack.d.ts +11 -0
  102. package/rspack.js +9 -0
  103. package/runtime/ai-script-governance.js +379 -0
  104. package/runtime/countermeasures.js +0 -0
  105. package/runtime/data-exfiltration-guard.d.ts +7 -0
  106. package/runtime/data-exfiltration-guard.js +161 -0
  107. package/runtime/environment-integrity.js +389 -0
  108. package/runtime/managed-integrity.d.ts +4 -0
  109. package/runtime/managed-integrity.js +108 -0
  110. package/runtime/third-party-inventory.js +437 -0
  111. package/turbopack.d.ts +10 -0
  112. package/turbopack.js +41 -0
  113. package/vite.d.ts +16 -0
  114. package/vite.js +78 -0
  115. package/watermark.js +126 -0
  116. package/webpack-loader.d.ts +15 -0
  117. package/webpack-loader.js +97 -0
  118. package/webpack.d.ts +13 -0
  119. package/webpack.js +143 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,960 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1 - 2026-07-13
4
+
5
+ - Added OIDC/SAML configuration validation, organization directory behavior, and a bearer-authenticated SCIM 2.0 user lifecycle core to governance.
6
+ - Added versioned managed Web Integrity policies, monitor/block decisions, incident deduplication and workflow, plus active blocking for unknown dynamic scripts.
7
+ - Exported the managed integrity, third-party inventory, and countermeasure runtime entry points.
8
+
9
+ ## 0.2.0 — 2026-05-19
10
+
11
+ - Added `--report <file>` flag. After a successful run, writes the full API
12
+ response JSON (BuildId, PolymorphismFingerprint, GlobalIdentifierMap,
13
+ MemberIdentifierMap, audit metadata) to the given path. Strips the heavy
14
+ file payload before persisting since the protected source is already
15
+ written to `config.output`. Pairs with `jso-symbolicate`.
16
+ - Added `--label <value>` flag. Tags the API request with a release label
17
+ that appears as `ReleaseLabel` in the JSO dashboard audit log. Also reads
18
+ `JSO_LABEL` / `JAVASCRIPT_OBFUSCATOR_LABEL` from the environment.
19
+ - `--json` output now includes `buildId`, `polymorphismFingerprint`, and
20
+ `label` fields so CI scripts can capture them without a second read of the
21
+ report file.
22
+ - All 149 existing CLI unit tests still pass.
23
+
24
+ ## Unreleased
25
+
26
+ ### Runtime recovery and governance foundations (2026-07-13)
27
+
28
+ - Added bounded browser-side `SelfHealing` for post-startup self-defending
29
+ mutations, corrected the integrity baseline to hash the constructed function
30
+ representation, and added `reload`, `callback`, and `degrade` response modes.
31
+ - Added `jso-protector/governance` with local RBAC, scoped-token descriptors,
32
+ and SHA-256 hash-chained audit events. Hosted SSO/SCIM remains explicitly out
33
+ of scope for this local module.
34
+
35
+ ### Runtime incident action plans (2026-06-12)
36
+
37
+ - Dashboard Monitoring JSON/CSV exports now carry source-free per-incident
38
+ action plans with next owner, evidence packet, response due state, status
39
+ transition, acknowledgement requirement, and next action.
40
+ - `--runtime-incident-evidence` preserves those action plans in Markdown and
41
+ JSON, adds an Incident Action Plan table, and prompts BYO AI or internal
42
+ reviewers about overdue incident owners before external handoff.
43
+
44
+ ### VM marker ergonomics (2026-06-12)
45
+
46
+ - VM protection now accepts `// @virtualize`, `/* @virtualize */`, and
47
+ `/** @virtualize */` markers immediately before supported synchronous
48
+ function declarations. The website pipeline normalizes block and JSDoc
49
+ marker forms before invoking the VM sidecar, removing a silent-miss setup
50
+ trap from the VM beta flow.
51
+ - The VM proof static guard now checks the server-side normalizer and public
52
+ docs so marker support cannot drift back to line-comment-only wording.
53
+
54
+ ### Parser engine compatibility smoke (2026-06-12)
55
+
56
+ - `tools/verify-parser-engine.ps1` now runs a multi-root compatibility smoke
57
+ after the main parser conformance harness. The smoke compiles the legacy root
58
+ `App_Code/JScriptProtectorV2` source tree and the framework
59
+ `JScriptCodeDom` source tree, then verifies the Cesium-style `?.25`,
60
+ optional-chain, nullish, and `.5e3` leading-dot exponent cases.
61
+ - Archive hygiene now requires the new `compat-run.ps1` and
62
+ `compat-smoke.cs` files so deployment packages include the same parser drift
63
+ guard used locally.
64
+
65
+ ### PCI DSS review assistant (2026-06-08)
66
+
67
+ - `jso-protector compliance pci-dss-v4` Markdown and JSON now include a
68
+ source-free PCI DSS Review Assistant for BYO AI or internal reviewer triage.
69
+ - The assistant turns evidence gaps, signed-release proof, script
70
+ authorization, observed script drift, header change evidence, runtime
71
+ incident routing, and QSA handoff boundaries into checkout-owner actions
72
+ without sharing source code, protected output, raw script rows, raw response
73
+ headers, raw incident payloads, payment-card data, provider keys, customer
74
+ data, or secrets.
75
+
76
+ ### Runtime defense review assistant (2026-06-08)
77
+
78
+ - `--runtime-defense-review` Markdown and JSON now include a source-free
79
+ Runtime Defense Review Assistant for BYO AI or internal reviewer triage.
80
+ - The assistant turns runtime behavior scope, monitoring handoff,
81
+ countermeasure policy, domain/date lock smoke, source-reading compatibility
82
+ scan, release metadata, and protected-build smoke into owner prompts without
83
+ sharing source code, protected output, domains, dates, redirect URLs, beacon
84
+ URLs, countermeasure values, raw config files, API credentials, provider
85
+ keys, collector tokens, customer data, or secrets.
86
+
87
+ ### Identifier cache review assistant (2026-06-08)
88
+
89
+ - `--identifier-cache-review` Markdown and JSON now include a source-free
90
+ Identifier Cache Review Assistant for BYO AI or internal reviewer triage.
91
+ - The assistant turns deterministic cache assumptions, custom dictionary
92
+ replacement, reserved-name coverage, release metadata, and protected-build
93
+ smoke into owner prompts without sharing source code, protected output, cache
94
+ contents, dictionary values, prefixes, reserved-name expressions, raw config
95
+ files, API credentials, provider keys, customer data, or secrets.
96
+
97
+ ### Migration review assistant (2026-06-08)
98
+
99
+ - `--migration-review` Markdown and JSON now include a source-free Migration
100
+ Review Assistant for BYO AI or internal reviewer triage.
101
+ - The assistant turns manual review tracks, source-map policy,
102
+ identifier-cache replacement, runtime-defense behavior, source-reading
103
+ command boundaries, release metadata, and protected-build smoke into owner
104
+ prompts without sharing source code, protected output, source maps, cache
105
+ contents, raw config files, API credentials, provider keys, customer data, or
106
+ secrets.
107
+
108
+ ### Competitor gap review assistant (2026-06-08)
109
+
110
+ - `--competitor-gap-report` JSON and text output now include a source-free
111
+ Competitor Gap Review Assistant for BYO AI or internal reviewer triage.
112
+ - The assistant turns gap prioritization, partial-parity validation, triggered
113
+ migration limitations, source-reading scan boundaries, vendor-claim
114
+ freshness, and plan handoff into owner prompts without sharing source code,
115
+ protected output, API credentials, provider keys, customer data, or secrets.
116
+
117
+ ### Source-map evidence review assistant (2026-06-08)
118
+
119
+ - `--source-map-evidence` now includes a source-free Source Map Review
120
+ Assistant for BYO AI or internal reviewer triage.
121
+ - The assistant turns leak cleanup, manifest verification, secure debugging
122
+ exceptions, bundler cleanup order, and clean reviewer handoff into owner
123
+ prompts without sharing source code, protected output, raw `.map` files,
124
+ source-map contents, original source paths, customer data, or secrets.
125
+
126
+ ### VM proof review assistant (2026-06-08)
127
+
128
+ - `--vm-proof-pack` now includes a source-free VM Proof Review Assistant for
129
+ BYO AI or internal reviewer triage.
130
+ - The assistant turns failed proof checks, VM warnings, cold sensitive
131
+ function scope, hot-path risk, build identity, and protected-build smoke
132
+ evidence into owner prompts without sharing source code, protected output,
133
+ VM bytecode, source maps, provider keys, customer data, or secrets.
134
+
135
+ ### Deployment hygiene evidence packet (2026-06-08)
136
+
137
+ - Added `--deployment-hygiene-evidence <file>` and
138
+ `--deployment-hygiene-output <file>` to turn
139
+ `tools/Build-UpdatedArchives.ps1 -ReportPath` JSON into a source-free
140
+ archive/deployment hygiene reviewer packet.
141
+ - The packet summarizes archive names, entry counts, byte sizes, missing
142
+ required entries, blocked entries, blocked category booleans, exclusion
143
+ policy, operator checklist, rotation triggers, and hygiene-report SHA-256
144
+ without including `Web.config` contents, raw secrets, provider keys,
145
+ database strings, host-specific transforms, customer data, or source code.
146
+ - The command writes failed packets before exiting nonzero when archive
147
+ hygiene is blocked, and includes a Deployment Hygiene Review Assistant for
148
+ BYO AI or internal reviewers.
149
+
150
+ ### Runtime incident review assistant (2026-06-08)
151
+
152
+ - `--runtime-incident-evidence` now includes a source-free Runtime Incident
153
+ Review Assistant for BYO AI or internal reviewer triage.
154
+ - The assistant turns urgent response, repeated-signal correlation, dashboard
155
+ status actions, response-window decisions, and alert-routing handoff into
156
+ owner prompts without sharing source code, raw incident payloads, collector
157
+ tokens, customer data, or secrets.
158
+
159
+ ### AI-resistance review assistant (2026-06-08)
160
+
161
+ - `--ai-resistance-evidence` now includes a source-free Review Assistant
162
+ Packet for BYO AI or internal reviewer triage.
163
+ - The packet turns failed required checks, missing attacker-model review
164
+ tracks, VM scope, runtime evidence, compatibility proof, and planned
165
+ Resistance Score wording into owner actions without sending source code,
166
+ protected output, source maps, provider keys, or secrets.
167
+ - Text output now renders the assistant packet beside the non-scoring review
168
+ matrix, review decision, claim boundaries, and recommendations.
169
+
170
+ ### Payment-page security-header review assistant (2026-06-08)
171
+
172
+ - HAR-derived payment-page security-header snapshots now include a
173
+ source-free Review Assistant Packet for BYO AI or internal reviewer triage.
174
+ - The packet focuses checkout reviewers on baseline drift, CSP/reporting,
175
+ HSTS, and frame-policy owner actions while explicitly excluding raw response
176
+ headers, cookies, source code, payment data, customer data, provider keys,
177
+ and secrets.
178
+ - PCI DSS v4 security-header evidence now preserves or rebuilds the same
179
+ review assistant packet and renders it in Markdown beside the header summary.
180
+
181
+ ### Runtime incident repeated-signal correlation (2026-06-08)
182
+
183
+ - `--runtime-incident-evidence` now preserves Dashboard Monitoring
184
+ repeated-signal correlation and computes a CSV/row fallback when the export
185
+ does not already include it.
186
+ - Runtime evidence Markdown now includes a repeated-signal correlation table
187
+ for repeated fingerprints and reasons, plus recommendations for repeated
188
+ active high/critical signals before reviewer handoff.
189
+ - PCI DSS v4 runtime-incident evidence now summarizes repeated-signal
190
+ correlation beside routing, dashboard actions, response windows, and
191
+ checklist metadata.
192
+
193
+ ### Runtime incident evidence dashboard closeout (2026-06-08)
194
+
195
+ - Runtime incident evidence packets now preserve and recommend the dashboard's
196
+ filtered `Reviewing -> Resolved` closeout action when it is present in a
197
+ Dashboard Monitoring JSON export.
198
+ - CLI tests now cover multi-action dashboard metadata, including both
199
+ `Open -> Reviewing` acknowledgement and `Reviewing -> Resolved` closeout.
200
+
201
+ ### BYO AI key health in usage preflight (2026-06-08)
202
+
203
+ - `ai.usage()` test fixtures now pin the `/v1/ai/usage.ashx`
204
+ `providerKey` health object so Node callers can monitor missing, failed,
205
+ stale, or rotation-review-due BYO AI keys without receiving key material.
206
+ - `jso-protector --estimate` now preserves that source-free provider-key
207
+ health in text output and under `estimate.providerKey` in JSON output while
208
+ keeping quota as the only OK/WARN/FAIL gate.
209
+ - `jso ai usage --pretty` now prints the same provider-key health summary:
210
+ source-free status label, provider, next stored-key test, rotation review,
211
+ and recommended action.
212
+ - TypeScript callers now get an `AiProviderKeyHealth` declaration on
213
+ `AiUsageResult.providerKey`, and package verification guards that declaration.
214
+ - The README now documents `jso ai usage --pretty`, typed
215
+ `ai.usage().providerKey` monitoring, the 30-day stored-key test, and the
216
+ 90-day rotation review fields surfaced by usage preflight.
217
+
218
+ ### Native parser-engine verification runners (2026-06-08)
219
+
220
+ - Added PowerShell runners for ES6 lowering conformance, real-world parser
221
+ corpus parse/write-back checks, and the combined parser-engine pre-deploy
222
+ gate so this Windows workspace can verify parser changes without git-bash.
223
+ - Added `verify:parser-engine` as a static package guard so the native engine
224
+ runners, parser/ES6 harness docs, archive packaging, and polyglot smoke
225
+ contract cannot drift out of the shipped updated-files package.
226
+
227
+ ### Migration review packet (2026-06-08)
228
+
229
+ - Added `--migration-review` with optional
230
+ `--migration-review-output <file>` so migrated release teams get one
231
+ source-free owner checklist for all accepted competitor-only fields before
232
+ running focused source-map, identifier-cache, or runtime-defense packets.
233
+ - The packet captures review-only field names, value types/counts, limitation
234
+ groups, CLI compatibility warnings, saved report/manifest readiness,
235
+ follow-up commands, protected-build smoke-test actions, and source-free
236
+ sharing boundaries without embedding source code, protected output,
237
+ source-map contents, cache contents, dictionary values, prefixes, domains,
238
+ URLs, dates, seed values, or reserved expressions.
239
+ - Migration reports now add a `migration-review` next command whenever any
240
+ review-only item is present, and `--competitor-gap-report` lists the packet
241
+ as a source-free review artifact when limitation groups are triggered.
242
+ - The GitHub Action now exposes `migration-review` and
243
+ `migration-review-report`, writes the same source-free JSON packet as a
244
+ pre-protection artifact, and surfaces the report path for upload-artifact
245
+ steps.
246
+
247
+ ### Source-map migration next command (2026-06-08)
248
+
249
+ - Migration reports now add a post-protect `source-map-evidence` next command
250
+ whenever the source config contains source-map review items.
251
+ - The generated command uses the same manifest path emitted by the `protect`
252
+ next command:
253
+ `jso-protector --source-map-evidence dist-protected/jso-manifest.json
254
+ --source-map-evidence-output reports/source-map-evidence.md`.
255
+ - Updated the README, website migration docs, tests, and source-map evidence
256
+ guard so source-map migrations point directly at the source-free reviewer
257
+ packet instead of relying on separate documentation.
258
+
259
+ ### Runtime defense migration review packet (2026-06-08)
260
+
261
+ - Added `--runtime-defense-review` with optional
262
+ `--runtime-defense-review-output <file>` so migrated release teams can turn
263
+ anti-debug, self-defending, runtime lock, console, and countermeasure
264
+ settings into a source-free reviewer packet instead of a broad compatibility
265
+ scan note.
266
+ - The packet lists review-only field names, configured runtime evidence,
267
+ monitoring and customer-owned forwarding tracks, countermeasure-policy
268
+ follow-up, source-free release metadata readiness, compatibility-scan
269
+ follow-up, protected-build smoke-test follow-up, and safe-sharing boundaries
270
+ without embedding domains, dates, redirect URLs, beacon URLs, countermeasure
271
+ values, source code, protected output, or compatibility-scan snippets.
272
+ - `--competitor-gap-report` now points runtime-self-defending limitations at
273
+ the dedicated `--runtime-defense-review` command and keeps
274
+ `runtime-compatibility-scan` as an explicit source-reading follow-up.
275
+ - Migration reports now add a `runtime-defense-review` next command whenever
276
+ the source config contains anti-debug, self-defending, runtime lock, console,
277
+ or countermeasure review items.
278
+ - Added a `verify:runtime-defense-review` guard so CLI behavior, tests, docs,
279
+ changelog, and competitive gap notes stay aligned.
280
+
281
+ ### Identifier cache replacement review packet (2026-06-08)
282
+
283
+ - Added `--identifier-cache-review` with optional
284
+ `--identifier-cache-review-output <file>` so migrated release teams can turn
285
+ `identifierNamesCache`, `identifierNamesCachePath`, `identifiersDictionary`,
286
+ and `identifiersPrefix` into a source-free reviewer packet instead of a
287
+ vague manual-review note.
288
+ - The packet lists review-only field names, counts, reserved-name evidence,
289
+ saved API report and manifest readiness, protected-build smoke-test follow-up,
290
+ and safe-sharing boundaries without embedding cache contents, dictionary
291
+ values, prefixes, reserved-name expressions, or source code.
292
+ - `--competitor-gap-report` now points identifier-cache and custom-dictionary
293
+ limitations at the dedicated review command, and the main verify chain has a
294
+ `verify:identifier-cache-review` guard so CLI, tests, docs, and gap notes stay
295
+ aligned.
296
+ - Migration reports now add an `identifier-cache-review` next command whenever
297
+ the source config contains identifier cache or custom dictionary review items,
298
+ so release owners do not have to discover the packet from separate docs.
299
+
300
+ ### Runtime incident dashboard action metadata (2026-06-08)
301
+
302
+ - `--runtime-incident-evidence` now preserves `dashboardActions` from
303
+ Dashboard Monitoring JSON exports and renders them in Markdown.
304
+ - PCI DSS v4 runtime incident evidence also keeps the same action metadata, so
305
+ reviewer packets can say which source-free dashboard status action is
306
+ available without scraping dashboard HTML.
307
+ - The action metadata currently covers the filtered `Open` to `Reviewing`
308
+ acknowledgement path, including scope, matching Open incident count, and the
309
+ safety boundary for resolved, ignored, and already-reviewing incidents.
310
+
311
+ ### Payment-page security-header evidence (2026-06-08)
312
+
313
+ - Added `--payment-page-headers <csv|json>` to `jso-protector compliance
314
+ pci-dss-v4` so checkout owners can summarize CSP, `script-src`,
315
+ `frame-src`, reporting endpoint, HSTS, referrer-policy, monitor,
316
+ alert-route, baseline-hash match state, checkout surface, and frame context
317
+ in the same source-free PCI evidence packet as script inventory and runtime
318
+ incidents.
319
+ - Added `examples/payment-page-security-headers.json` as a starter snapshot
320
+ for payment-page header evidence.
321
+ - Added `--payment-page-headers-from-har <file>` with
322
+ `--payment-page-headers-output <file>` and optional
323
+ `--payment-page-url-pattern <regex>` so browser or synthetic-monitor HAR
324
+ exports can become the same source-free security-header snapshot without
325
+ preserving raw cookie headers.
326
+ - Added optional `--payment-page-headers-baseline <file>` so the HAR converter
327
+ marks each checkout page or frame as `match`, `mismatch`, or `missing`
328
+ against the last approved security-header snapshot for PCI 11.6.1 change
329
+ review.
330
+ - PCI DSS v4 security-header evidence now reports missing baseline pages as a
331
+ first-class count instead of folding them into unstated baseline evidence.
332
+ - Added matching GitHub Action support through `payment-page-har`,
333
+ `payment-page-headers-baseline`, `payment-page-url-pattern`, and
334
+ `payment-page-headers-report`, including a source-free JSON artifact path,
335
+ step-summary baseline metrics, and workflow annotations for header drift,
336
+ missing CSP, or missing reporting-endpoint coverage.
337
+ - Updated the non-GitHub CI template hint blocks so Jenkins, GitLab, Azure,
338
+ CircleCI, Bitbucket, Buildkite, Drone, Woodpecker, GoCD, Tekton, Argo, and
339
+ TeamCity users see the same security-header baseline option.
340
+ - Added optional GitHub Action PCI DSS v4 evidence assembly through
341
+ `pci-dss-v4-evidence`, `pci-dss-v4-report`, and
342
+ `pci-dss-v4-json-report`. The action now auto-creates a manifest when the
343
+ PCI gate is enabled, prefers the signed `.sig` envelope when present, reuses
344
+ payment-page audit/header/runtime evidence inputs, and emits source-free
345
+ Markdown plus JSON report paths.
346
+
347
+ ### Payment-page iframe evidence context (2026-06-08)
348
+
349
+ - Payment-page script inventory starters, audit packets, and PCI DSS v4
350
+ reports now preserve optional checkout-surface and frame metadata:
351
+ `checkoutSurface`, `frameContext`, `frameOwner`, `parentPageHref`,
352
+ `frameHref`, and `frameOrigin`.
353
+ - Audit and PCI Markdown/JSON summaries now include checkout surface counts,
354
+ frame context counts, frame owner counts, and iframe-scoped script counts so
355
+ checkout owners can distinguish parent-page, hosted-checkout, PSP iframe,
356
+ and embedded-frame evidence without embedding raw source code.
357
+
358
+ ### Source-map evidence verification guard (2026-06-08)
359
+
360
+ - Added `verify:source-map-evidence` to the main package verify chain. The
361
+ guard checks that manifest verification, source-map leak auditing,
362
+ `--source-map-evidence`, public npm docs, GitHub Action artifact wiring, and
363
+ source-free reviewer-boundary wording stay aligned.
364
+
365
+ ### Payment-page evidence verification guard (2026-06-08)
366
+
367
+ - Added `verify:payment-page` to the main package verify chain. The guard
368
+ checks that payment-page script inventory generation, audit reconciliation,
369
+ PCI DSS v4 evidence import, GitHub Action preflight wiring, public
370
+ Payment Page Protection docs, and source-free Review Assistant Packet
371
+ boundaries stay aligned.
372
+
373
+ ### VM proof-pack verification guard (2026-06-08)
374
+
375
+ - Added `verify:vm-proof` to the main package verify chain. The guard checks
376
+ that `--verify-vm-proof`, `--vm-proof-pack`, public VM Proof Pack docs,
377
+ GitHub Action inputs/outputs, CLI tests, and reviewer handoff language stay
378
+ aligned around source-free VM evidence, cold-path review, and
379
+ `ready-for-manual-review` decisions.
380
+
381
+ ### Runtime incident evidence packet (2026-06-08)
382
+
383
+ - Added `--runtime-incident-evidence <csv|json>` with optional
384
+ `--runtime-incident-evidence-output <file>` so account owners can turn a
385
+ Dashboard Monitoring runtime incident export into a standalone source-free
386
+ Markdown or JSON handoff packet for support, on-call, and reviewer workflows.
387
+ - The packet summarizes incident counts, active high/critical count, BuildIDs,
388
+ routing recommendation, response window, response checklist, alert routing
389
+ playbook, export SHA-256, safe-sharing boundaries, and review decision. It
390
+ exits nonzero when active high/critical incidents need response.
391
+
392
+ ### Competitor gap review artifacts (2026-06-08)
393
+
394
+ - Refreshed the `--competitor-gap-report` public-source snapshot to 2026-06-08
395
+ with current javascript-obfuscator, JS-Confuser, Jscrambler, AfterPack,
396
+ Obfuscator.io, JSDefender, and Digital.ai public surfaces.
397
+ - Added a `reviewArtifacts` block to the JSON and text report so migrated
398
+ release teams get concrete source-free handoff commands for release-check,
399
+ competitor-gap, source-map evidence, and identifier-cache replacement review,
400
+ plus a source-reading compatibility scan when runtime-defense switches need
401
+ manual validation.
402
+
403
+ ### Source-map evidence packet (2026-06-07)
404
+
405
+ - Added `--source-map-evidence <manifest>` with optional
406
+ `--source-map-evidence-output <file>` so release teams can generate a
407
+ source-free Markdown or JSON packet proving protected artifacts still match
408
+ the manifest and do not expose `.map` files or `sourceMappingURL` comments.
409
+ The packet lists artifact names, counts, policy boundaries, review decision,
410
+ and next actions without embedding source code or source-map contents.
411
+
412
+ ### Runtime incident alert routing playbook evidence (2026-06-07)
413
+
414
+ - PCI DSS v4 runtime-incident evidence now preserves Dashboard Monitoring
415
+ `routing.alertRoutingPlaybook` metadata from JSON exports and renders it in
416
+ Markdown. Reviewer packets keep the security-response, customer-owned
417
+ alerting, support-handoff, and reviewer-packet lanes without embedding raw
418
+ incident rows or turning JSO into a managed SOC console.
419
+
420
+ ### Competitor gap source snapshot (2026-06-07)
421
+
422
+ - `--competitor-gap-report` now includes a dated public-source snapshot in JSON
423
+ and text output. The report names the competitor pages reviewed for the
424
+ migration framing and warns teams to re-check current vendor pages before
425
+ publishing named competitive claims.
426
+
427
+ ### AI evidence review decision (2026-06-07)
428
+
429
+ - `--ai-resistance-evidence` now includes a source-free `reviewDecision`
430
+ object and text line. The packet is `blocked` when required evidence fails,
431
+ `ready-for-manual-review` when required checks pass but review tracks need
432
+ confirmation, and `ready` when every current track is evidenced.
433
+
434
+ ### Public copy discipline verify gate (2026-06-07)
435
+
436
+ - Added `verify:copy-discipline` to the main verify chain. The guard scans
437
+ public website copy and the npm README for stale competitor claims, absolute
438
+ AI/security claims, and missing evidence-boundary statements so customer
439
+ pages stay end-user focused and source-reviewable.
440
+
441
+ ### Runtime incident response window (2026-06-07)
442
+
443
+ - PCI runtime-incident evidence now preserves Dashboard Monitoring
444
+ `responseWindow` metadata from JSON exports and renders it in Markdown.
445
+ The packet records the source-free timing basis, target, due time, overdue
446
+ state, and status action so reviewers can see whether active runtime
447
+ incidents are still inside the response target.
448
+ - CSV incident exports now get a conservative response-window fallback in the
449
+ PCI report: the reporter can calculate the due time from the oldest active
450
+ high/critical or active incident, while leaving overdue state unevaluated
451
+ unless a dashboard JSON export supplies generation timing.
452
+
453
+ ### Archive hygiene verify gate (2026-06-07)
454
+
455
+ - Added `verify:deployment-hygiene` to the main verify chain. The guard checks
456
+ that `tools/Build-UpdatedArchives.ps1` still supports optional JSON hygiene
457
+ reports, keeps blocked deployment files out of updated-files zips, and keeps
458
+ the public Deployment Hygiene docs aligned with the archive handoff command.
459
+ - Archive hygiene JSON reports now include a source-free operator checklist
460
+ with before-sharing steps, rotation triggers, and a support boundary so
461
+ release handoffs can say what to verify without exposing config secrets.
462
+
463
+ ### Payment-page inventory audit packet (2026-06-07)
464
+
465
+ - PCI runtime-incident evidence now includes a source-free response checklist
466
+ derived from Dashboard Monitoring CSV/JSON exports. Dashboard JSON exports
467
+ can carry that checklist directly, and the PCI report preserves it when
468
+ present. The checklist keeps filter scope, routing scope, suggested owners,
469
+ response targets, downstream incident destinations, and safe-sharing
470
+ boundaries without embedding raw incident rows.
471
+ - Added optional payment-page script review metadata fields:
472
+ `risk`, `dataAccess`, and `approvalTicket`. Generated inventory starters now
473
+ include blank fields for checkout owners to complete, and PCI evidence
474
+ reports summarize risk ratings, data-access scopes, and approval-ticket
475
+ coverage without embedding every script row.
476
+ - The payment-page script inventory audit now reports review-context coverage
477
+ for authorized scripts. Missing optional `risk`, `dataAccess`, or
478
+ `approvalTicket` values show up as non-blocking review-context gaps, while
479
+ unknown scripts, unauthorized scripts, hash drift, missing approved rows,
480
+ late injection, runtime violations, duplicate rows, and required metadata
481
+ gaps remain blocking.
482
+ - The same audit now includes a source-free Review Assistant Packet for BYO
483
+ AI or internal reviewer triage, with safe-input boundaries, "do not include"
484
+ reminders, and prompts for unknown scripts, authorization gaps, integrity
485
+ drift, runtime behavior, missing approved scripts, and approval-ticket
486
+ cleanup.
487
+ - Added `--script-inventory-audit <inventory.json|csv>` with required
488
+ `--runtime-inventory-snapshot <snapshot.json>` and optional
489
+ `--script-inventory-audit-output <file>` so checkout owners can reconcile an
490
+ approved payment-page script inventory against a saved browser runtime
491
+ snapshot before reviewer handoff.
492
+ - The audit stays local and source-free, emits Markdown by default or JSON with
493
+ `--json`, and flags unknown observed scripts, unauthorized observed scripts,
494
+ missing approved scripts, integrity hash mismatches, late injection, runtime
495
+ violation reasons, duplicate approved rows, and incomplete inventory
496
+ metadata.
497
+ - `jso-protector compliance pci-dss-v4` now accepts
498
+ `--script-inventory-audit <json>` so the approved-vs-observed reconciliation
499
+ summary can be included in the same PCI evidence report as the script
500
+ inventory and Dashboard Monitoring runtime incident export.
501
+ - The shipped CI templates now advertise the same
502
+ `--script-inventory-audit --runtime-inventory-snapshot
503
+ --script-inventory-audit-output --json` gate in their optional preflight
504
+ block, and the GitHub Action exposes matching
505
+ `payment-script-inventory`, `runtime-inventory-snapshot`, and
506
+ `script-inventory-audit-report` inputs for checkout release workflows.
507
+ - The GitHub Action audit preflight now writes a step summary and workflow
508
+ annotations for the first source-free findings so checkout owners can see
509
+ script drift in the CI run before opening the JSON artifact.
510
+
511
+ ### VM proof pack handoff (2026-06-07)
512
+
513
+ - Added `--vm-proof-pack <report.json>` with optional
514
+ `--vm-proof-output <file>` so release teams can turn a saved, source-free API
515
+ report into a reviewer-ready VM evidence packet. Markdown is emitted by
516
+ default; add `--json` for machine-readable evidence.
517
+ - The proof pack reuses `--verify-vm-proof` checks and adds build identity,
518
+ release label, polymorphism fingerprint, enabled options, warnings,
519
+ recommendations, and a required reviewer checklist.
520
+ - The proof pack now includes a `reviewDecision` object in JSON and a matching
521
+ Markdown section. Passing VM evidence can still be labeled
522
+ `ready-for-manual-review` when the reviewer must confirm cold-function scope
523
+ and protected-build smoke-test results before approval.
524
+ - Generated Markdown and JSON proof packs now include hot-path/cold-path
525
+ guidance so reviewers can confirm VM protection stayed on rare sensitive
526
+ functions instead of render loops, animation ticks, scroll handlers, or
527
+ high-frequency parsers.
528
+ - Generated proof packs now also include VM compatibility guidance covering
529
+ supported function shape, skipped-with-warning syntax, public callback /
530
+ framework-reflection risks, and reviewer actions before approval.
531
+
532
+ ### Payment-page incident evidence for PCI reports (2026-06-06)
533
+
534
+ - Added `--script-inventory <csv|json>` to `jso-protector compliance
535
+ pci-dss-v4` so payment-page script authorization, written justification,
536
+ owner, review-date, domain, and integrity-reference coverage can be hashed
537
+ and summarized in the same source-free evidence report.
538
+ - Added `examples/payment-page-script-inventory.json` as a starter attachment
539
+ for the source-free payment-page inventory evidence workflow.
540
+ - Added `--script-inventory-from-snapshot <file>` with optional
541
+ `--script-inventory-output <file>` so checkout owners can turn an observed
542
+ `third-party-inventory` runtime snapshot into a source-free PCI inventory
543
+ review starter before adding authorization, justification, owner, and review
544
+ dates.
545
+ - Added `--runtime-incidents <csv|json>` to `jso-protector compliance
546
+ pci-dss-v4` so the report can summarize the Dashboard Monitoring
547
+ runtime-incident export as source-free PCI DSS v4 11.6.1 evidence.
548
+ - Broadened the same flag to accept the Dashboard Monitoring JSON export too,
549
+ so support tooling and release automation can feed machine-readable incident
550
+ evidence into the PCI report without converting to CSV first.
551
+ - Runtime incident JSON evidence now preserves Dashboard Monitoring export
552
+ filters, such as active status or high/critical severity, in the JSON summary
553
+ and Markdown evidence table.
554
+ - Runtime incident JSON evidence now also preserves Dashboard Monitoring
555
+ routing recommendations, including escalation level, recommended queue, and
556
+ preferred evidence packet, in the PCI evidence JSON and Markdown report.
557
+ - Dashboard Monitoring now shows that same source-free routing recommendation
558
+ on the current filtered incident view before checkout and support owners
559
+ export the JSON evidence packet.
560
+ - Runtime incident JSON evidence now preserves routing response targets and
561
+ next status actions, so PCI reviewer packets can carry queue, timing, and
562
+ triage-state guidance without embedding source code.
563
+ - The Markdown/JSON report now records CSV SHA-256, incident count, status and
564
+ severity counts, open/reviewing totals, high-or-critical unresolved totals,
565
+ received/event date ranges, and Build IDs without embedding every raw URL or
566
+ user-agent row.
567
+ - Updated payment-page documentation so checkout owners can pair signed
568
+ manifests, watermarks, beacon/SIEM routing, and dashboard incident history
569
+ in one reviewer-friendly command.
570
+
571
+ ### AI resistance evidence report (2026-06-06)
572
+
573
+ - Added `--ai-resistance-evidence <report.json>` so security reviewers can
574
+ turn a saved, source-free API report into a current AI-resistance evidence
575
+ checklist without sending source to an AI provider.
576
+ - Added `--ai-resistance-evidence-output <file>` so the same checklist can be
577
+ written as a reviewer artifact, using text by default or JSON when `--json`
578
+ is set.
579
+ - Extended `verify:ai` static checks so the AI evidence output artifact
580
+ workflow remains visible in both the CLI and public AI Resistance Evidence
581
+ docs.
582
+ - Added a non-scoring attacker-model review matrix to the evidence checklist.
583
+ The matrix covers identifier recovery, string recovery, control-flow
584
+ reconstruction, sensitive-function extraction, runtime instrumentation,
585
+ compatibility regression, and source-free handoff without claiming the
586
+ planned Resistance Score is live.
587
+ - The report checks build identity, strong protection options, optional VM
588
+ proof, runtime-defense evidence, compatibility evidence, and source-free
589
+ review data while clearly marking Resistance Score as planned, not live.
590
+ - The Markdown-style text output and JSON report now include explicit claim
591
+ boundaries for current evidence, planned Resistance Score, bounded AI
592
+ resistance claims, and client-side runtime secrecy limits.
593
+ - Added `--require-vm-proof` for release teams that want VM-backed evidence to
594
+ be a hard CI gate.
595
+
596
+ ### VM proof-pack verifier (2026-06-06)
597
+
598
+ - Added `--verify-vm-proof <report.json>` so security reviewers can validate a
599
+ saved, source-free API report without inspecting private source.
600
+ - The verifier checks that VM protection was requested, VM protection was
601
+ applied, the virtualized function count meets `--min-vm-functions`, and
602
+ `VMProtectionWarnings` is empty.
603
+ - Added CLI regression tests for saved-report and direct-report shapes.
604
+
605
+ ### Competitor gap report hosted-runtime evidence (2026-06-06)
606
+
607
+ - The runtime-defense capability now lists hosted dashboard intake,
608
+ `RuntimeDefenseBeaconUrl`, Dashboard Monitoring, SIEM forwarding, and
609
+ countermeasure helpers as the JSO evidence surface.
610
+ - The generated migration plan now tells teams to route runtime events to
611
+ customer monitoring or `/v1/runtime/beacon.ashx` before manually validating
612
+ competitor anti-debug/self-defending switches.
613
+ - Added regression coverage so the CLI report keeps the hosted first-triage
614
+ path visible during competitor migrations.
615
+
616
+ ### Migration documentation parity wording (2026-06-06)
617
+
618
+ - Updated the README, migration guide, and security checklist so runtime
619
+ defense is described as a mapped/partial capability with monitoring and
620
+ countermeasure helpers, not as a pure unresolved gap.
621
+ - The competitor report docs now name Obfuscator.io explicitly and call out
622
+ manual validation for protected source-map generation, release readiness,
623
+ and review-only migration fields.
624
+
625
+ ### Competitor gap report runtime-defense parity (2026-06-06)
626
+
627
+ - Runtime-defense parity now reports as `partial` instead of a pure `gap`
628
+ because `jso-protector` ships runtime monitoring, beacon forwarding, and
629
+ countermeasure helpers.
630
+ - The competitor list now names Obfuscator.io explicitly alongside
631
+ `javascript-obfuscator`, JS-Confuser, Jscrambler, and JSDefender.
632
+ - Migrated anti-debug, integrity, self-defending, and tamper-protection
633
+ switches remain review-only limitations because they are not one-to-one
634
+ hosted API options.
635
+ - Added a CLI test assertion so the runtime-defense capability cannot regress
636
+ to a pure gap while the JSO runtime helpers remain available.
637
+
638
+ ### Compliance evidence forwarder — push reports to GRC platforms (2026-06-02)
639
+
640
+ New `compliance/evidence-forwarder.js` + a `--push` flag on the
641
+ `compliance` CLI. After the PCI DSS v4 reporter generates a report, the
642
+ forwarder normalizes it into a vendor-neutral evidence artifact (control
643
+ mappings, summary, build id, content sha256) and POSTs it to a GRC
644
+ platform so the per-build report that already exists also lands in
645
+ Drata / Vanta / an in-house system without a manual upload.
646
+
647
+ ```
648
+ npx jso-protector compliance pci-dss-v4 \
649
+ --manifest dist/build.manifest.json.sig --root dist \
650
+ --push drata --push-endpoint "$JSO_GRC_ENDPOINT" --push-token "$JSO_GRC_TOKEN"
651
+ ```
652
+
653
+ Three profiles shape the envelope + headers: `generic` (artifact as-is,
654
+ optional HMAC signing identical to the jso-beacon-slack webhook adapter),
655
+ `drata`, and `vanta`. Field names are overridable via `fieldMap`. The
656
+ tenant endpoint + token are operator-supplied — GRC platforms are
657
+ multi-tenant, so the module deliberately does not hardcode a vendor API
658
+ version it can't keep current; the profile only shapes the request.
659
+
660
+ Contract matches the SIEM adapters: the forwarder never throws — a flaky
661
+ GRC endpoint resolves to `{ ok:false, status:0, error }` and does NOT
662
+ change the compliance exit code (the report's own verdict is the
663
+ authority; forwarding is a side channel). 14 new tests (artifact
664
+ normalization + stable hashing, all three profiles, fieldMap overrides,
665
+ HMAC verifiability, transport-failure + throw isolation, non-2xx
666
+ handling). 315/315 full jso-protector suite passes.
667
+
668
+ ### AI script data governance — block LLM-bound exfiltration (2026-06-02)
669
+
670
+ New browser runtime module `jso-protector/runtime/ai-script-governance.js`
671
+ that hooks `fetch`, `XMLHttpRequest`, and `WebSocket` on the protected
672
+ page and watches for requests that hit a known LLM provider endpoint.
673
+ Closes the Jscrambler "AI Data Governance" parity gap surfaced by the
674
+ latest deep-research workflow.
675
+
676
+ What it catches:
677
+
678
+ - a Magecart-style script exfiltrating card data to a free OpenAI
679
+ endpoint ("summarize this number")
680
+ - an untrusted third-party widget quietly streaming page contents to
681
+ its own AI backend
682
+ - a compromised CI/CD dependency that POSTs conversation history to
683
+ a side-channel LLM
684
+
685
+ Default known-host list covers OpenAI / Anthropic / Google
686
+ (Gemini + Vertex) / Groq / Together / Mistral / AWS Bedrock
687
+ (region-prefixed) / Cohere / Perplexity / xAI / DeepSeek / Replicate /
688
+ Hugging Face Inference / Azure OpenAI (tenant-prefixed). Extensible via
689
+ `config.additionalKnownLLMHosts`.
690
+
691
+ Two enforcement modes:
692
+
693
+ - `log` (default) — records destination + payload size + caller stack
694
+ frame; request proceeds.
695
+ - `block` — refuses. `fetch` returns a synthetic HTTP 451; XHR
696
+ transitions to `readyState=4 status=0`; `WebSocket` constructor
697
+ throws.
698
+
699
+ Events emit through the same beacon channel as `third-party-inventory`,
700
+ so the existing `jso-beacon-slack` SIEM adapters forward them unchanged
701
+ (envelope `kind: "ai-data-access"`).
702
+
703
+ 17 new tests, 301/301 full jso-protector suite passes.
704
+
705
+ ### Electron V8 bytecode adapter + React Native 2026 playbook (2026-06-02)
706
+
707
+ Completes deep-research GAP 5.
708
+
709
+ - New sibling package **`jso-protector-electron`** (`packages/jso-protector-electron/`)
710
+ with `compileDirectory({input, output, mode})` that walks JSO-protected
711
+ JS and emits V8 bytecode `.jsc` files via `vm.Script.createCachedData()`.
712
+ Two execution modes:
713
+ - `embedded` (run under Electron): emits real `.jsc` files bound to
714
+ the host Electron's V8 build.
715
+ - `scaffold-only` (plain Node): emits the source + per-file
716
+ `.bytecode-meta.json` for CI environments that don't ship Electron.
717
+ - `auto` picks based on `process.versions.electron`.
718
+ CLI: `jso-protector-electron --input dist-protected --output dist-bytecode`.
719
+ Each `.jsc` carries an 8-byte magic + length-prefixed JSON header +
720
+ the V8 cachedData blob so an auditor can validate coverage. 14 tests
721
+ cover both modes, the CLI surface, the header layout, and the
722
+ actionable error when embedded mode is invoked under plain Node.
723
+
724
+ - New **`examples/react-native/README.md`** playbook (2026 refresh)
725
+ walking the modern React Native + JSO pipeline:
726
+ - Metro `customSerializer` JSO integration (existing `metro.js`).
727
+ - Hermes bytecode layering (`.hbc`).
728
+ - **Play Integrity API** (Android) replacing the deprecated
729
+ SafetyNet Attestation (shut down 2024-06-30).
730
+ - **DCAppAttestService** (iOS) for on-device attestation.
731
+ - JSO release manifest + beacon flow for the in-app verifier.
732
+ - Field-tested gotchas (Reanimated worklets, native-module bridge
733
+ name preservation, dev-mode bypass).
734
+
735
+ ### RASP active countermeasures + named config sets (2026-06-02)
736
+
737
+ Two paired build-time + browser-runtime features completing deep-research
738
+ GAP 4 (JSDefender v2 / Jscrambler RASP parity).
739
+
740
+ **Browser runtime (`runtime/countermeasures.js`):**
741
+
742
+ Six configurable reactions to runtime-defense tamper events, fired after
743
+ the beacon POST so even destructive actions leave telemetry:
744
+
745
+ - `log` - record-only; default, no UI side effects
746
+ - `break` - stub every function on `window.__jsoEntry.*` so the protected
747
+ entry points become no-ops
748
+ - `deleteCookies` - clear cookies + sessionStorage + localStorage to
749
+ defuse stale credentials in a poisoned page
750
+ - `selfDestruct` with `mode: blank-body | crashWithMemory | crashTimeout`
751
+ - `redirect` to a safe URL (`javascript:` schemes rejected at build time)
752
+ - `callback` invoking a customer function with the violation event
753
+
754
+ Configurable as a single action or an ordered array
755
+ (`onTamper: ["break", "deleteCookies"]`). An `allowList` keeps dev
756
+ environments from accidentally shipping destructive escalations.
757
+
758
+ **Build-time named sets (`config/named-sets.js`):**
759
+
760
+ Apply different protection profiles to different parts of one app:
761
+
762
+ ```json
763
+ {
764
+ "preset": "balanced",
765
+ "countermeasures": { "onTamper": "log" },
766
+ "namedSets": {
767
+ "checkout": { "match": ["src/checkout/**", "src/wallet/**"],
768
+ "preset": "maximum",
769
+ "options": { "AddDeadCode": true, "DeadcodeLevel": "High" },
770
+ "countermeasures": { "onTamper": ["break", "deleteCookies"],
771
+ "redirectUrl": "https://example.com/outage" } },
772
+ "authenticated": { "match": ["src/dashboard/**", "src/account/**"],
773
+ "preset": "maximum",
774
+ "countermeasures": { "onTamper": ["deleteCookies"] } }
775
+ }
776
+ }
777
+ ```
778
+
779
+ First-matching-set wins, so config authors get deterministic precedence
780
+ by writing sets in priority order (like a route table). The glob matcher
781
+ supports `**`, `*`, `?`, `[a-z]`, `{a,b}` — including `/**` at end which
782
+ matches the bare directory plus any nested files (so `src/checkout/**`
783
+ covers `src/checkout` AND `src/checkout/a/b.js`).
784
+
785
+ Schema (`jso.config.schema.json`) extends with `countermeasures` and
786
+ `namedSets` as top-level properties plus a `$defs/countermeasures`
787
+ shared definition. Strict `additionalProperties: false` is preserved
788
+ on both the top-level and per-set objects.
789
+
790
+ 28 new tests (15 countermeasures + 13 named-sets), full jso-protector
791
+ suite **284/284 pass**, verify chain green.
792
+
793
+ ### Third-party script inventory + Magecart detection (2026-06-02)
794
+
795
+ New browser-side runtime module `jso-protector/runtime/third-party-inventory.js`
796
+ that snapshots every script loaded by a payment page and flags violations
797
+ to a beacon URL.
798
+
799
+ Detection signals:
800
+
801
+ - script `src` outside the configured `originAllowlist`
802
+ - inline `<script>` whose sha256 is not in `inlineContentAllowlist`
803
+ - script DOM-injected AFTER `document.readyState === "complete"`
804
+ (defer-injection is a common Magecart evasion)
805
+ - same script URL but its content sha256 changed since the previous
806
+ deploy (catches CDN supply-chain swap attacks)
807
+
808
+ Pure browser code (Web Crypto, fetch, PerformanceObserver) so it ships
809
+ in the protected bundle without server-side support. The module's
810
+ inventory snapshots emit through the same beacon channel as the rest
811
+ of the runtime-defense suite, so jso-beacon-slack forwards them to
812
+ Splunk / Elasticsearch / generic webhook unchanged.
813
+
814
+ ```js
815
+ // In the page that's being protected:
816
+ const tpi = require("jso-protector/runtime/third-party-inventory");
817
+ tpi.attach(window, {
818
+ buildId: window.__jsoBuildId,
819
+ originAllowlist: ["https://www.example.com", "https://cdn.example.com"],
820
+ inlineContentAllowlist: ["a3f5...sha256...", "b07e..."],
821
+ previousContentBySrc: { "https://cdn.example.com/lib.js": "<old-sha256>" },
822
+ beaconUrl: "https://beacon.example.com/v1/jso/inventory",
823
+ flushIntervalMs: 15000,
824
+ });
825
+ ```
826
+
827
+ 16 new tests (256 total in jso-protector) cover the pure-engine path
828
+ (unknown-origin / unknown-inline / injected-after-load /
829
+ content-changed-vs-previous-deploy / dedup / backpressure /
830
+ '*'-wildcard / trailing-slash) and the DOM-attach path
831
+ (idempotency + `createElement('script')` setter intercept).
832
+
833
+ ### PCI DSS v4.0.1 compliance reporter (2026-06-02)
834
+
835
+ New offline subcommand `jso-protector compliance pci-dss-v4` that consumes
836
+ a `--sign-release`-produced manifest envelope and emits a Markdown +
837
+ JSON evidence report mapping JSO primitives onto the two PCI DSS v4
838
+ controls JSO directly contributes to:
839
+
840
+ - **Req 6.4.3** payment-page script management — covered by HMAC watermarks
841
+ (sub-req .a, authorized), Ed25519 release attestation (.b, integrity),
842
+ and the manifest `files[]` array (.c, inventory).
843
+ - **Req 11.6.1** change/tamper detection — covered by Runtime Defense +
844
+ BeaconUrl wiring (.a/.b, detection + cadence) and jso-beacon-slack SIEM
845
+ adapters (.c, personnel alerts).
846
+
847
+ CLI:
848
+
849
+ ```
850
+ jso-protector compliance pci-dss-v4 \
851
+ --manifest dist/build.manifest.json.sig \
852
+ --root dist \
853
+ --watermark-key "$JSO_WATERMARK_KEY" \
854
+ --beacon-url https://beacon.example.com/v1/jso \
855
+ --siem splunk-hec \
856
+ --organization "Example Corp" \
857
+ --output reports/pci-dss-v4.md
858
+ ```
859
+
860
+ Exit codes follow the same shape as `--verify-release`: 0 = fully evidenced,
861
+ 1 = evidence gaps, 2 = manifest unsigned. The reporter is pure-offline —
862
+ no HTTP traffic, no telemetry. New `compliance/pci-dss-v4/` directory
863
+ ships in the npm tarball; 12 new tests (240 total) all pass.
864
+
865
+ ### Supply-chain integrity surface
866
+
867
+ - Added `--competitor-gap-report` to summarize covered / partial / gap parity
868
+ against common JavaScript obfuscator surfaces after migrations, including
869
+ runtime-defense, source-map, lock, and release-forensics guidance.
870
+ - Added public TypeScript declarations and package verification coverage for
871
+ the competitor gap report helpers.
872
+ - Added `--competitor-gap-report` to the optional CI template hint block and
873
+ extended CI template verification so all shipped pipelines keep surfacing
874
+ competitor migration gap checks.
875
+ - Added the same competitor gap report step to Kubernetes and Helm release
876
+ examples, plus migration/security/example docs that call out its
877
+ source-free behavior.
878
+ - Added `competitor-gap` to migration next-command output, gave the JSON report
879
+ a stable `format` / `version` envelope, and included the report in
880
+ `--local-only` preflight guidance.
881
+ - Added `--watermark <tag> --watermark-key <key>` &mdash; injects an HMAC-SHA256
882
+ header-comment marker into every input file before submission to the
883
+ obfuscation API. The obfuscator's `KeepComment` option preserves the
884
+ block verbatim through every transform so the marker survives in the
885
+ protected output. `JSO_WATERMARK_KEY` env-var fallback. Wire format
886
+ documented at /Docs/WireFormat.aspx#watermark.
887
+ - Added `--verify-watermark <file>` &mdash; single-file watermark validator.
888
+ With `--watermark-key`, runs a constant-time HMAC compare; without, prints
889
+ the embedded tag (lookup-only mode for forensic inspection of leaked
890
+ artifacts). Exit codes: 0 valid / 1 invalid / 2 missing-or-no-key.
891
+ - Added `--scan-watermarks <dir>` &mdash; tree walker for forensic / inventory
892
+ use. Skips `node_modules` + `.git`. Aggregates findings into a sorted
893
+ report. Exit codes: 0 all clean, 1 at least one invalid signature, 2 no
894
+ watermarks found at all.
895
+ - Added `--sign-release <priv.pem>` &mdash; produces an Ed25519-signed release
896
+ attestation `.manifest.json.sig` next to the manifest. Covers BuildId +
897
+ polymorphism fingerprint + label + per-file SHA-256. Canonical-JSON
898
+ serialization so verifiers in any language produce byte-identical
899
+ signatures.
900
+ - Added `--verify-release <sig>` &mdash; validates the envelope. Stage 1 is
901
+ Ed25519 signature over canonical manifest. Stage 2 (when `--verify-root
902
+ <dir>` is also passed) re-hashes referenced files on disk to catch
903
+ post-signing artifact tampering. `--public-key <pem>` pins to a trusted
904
+ public key (defeats key-substitution attacks).
905
+ - Added `--genkey-release <name>` &mdash; mints a fresh Ed25519 keypair, writes
906
+ `<name>.priv.pem` (0o600) and `<name>.pub.pem` (0o644). Removes the
907
+ "where do I get keys" friction.
908
+ - Added `--estimate` &mdash; pre-flight quota gate. Walks input files, calls
909
+ `/v1/ai/usage` for current-month counters, prints a three-state report
910
+ (OK / WARN / FAIL). FAIL (exit 1) when actions remaining = 0 blocks
911
+ builds that can't finish. Network failure on the usage endpoint
912
+ downgrades to WARN with a note (doesn't crash the pipeline).
913
+ - Added `--ai-precheck` &mdash; inline AI compatibility gate. Runs
914
+ `/v1/ai/compat-check` on every input file before the obfuscation API
915
+ is called; aborts the build on findings per `--ai-precheck-fail-on`
916
+ (`error` / `warning` / `never`). Quota untouched on failure.
917
+ - New `jso ai compat-scan` subcommand &mdash; stand-alone compat-check over
918
+ every input file in `jso.config.json`. Useful for pre-commit hooks and
919
+ IDE integrations.
920
+ - jso.config.schema.json: added `report`, `label`, `watermark`, and
921
+ `watermarkKey` to the schema so config validators stop rejecting these
922
+ documented keys. (Previous behavior: `additionalProperties: false`
923
+ caused IDE schema validators to flag the keys as unknown.)
924
+ - Coverage: new test suites `test/ai-precheck.test.js`, `test/watermark.test.js`,
925
+ `test/release-signer.test.js`, `test/estimate.test.js`,
926
+ `test/scan-watermarks.test.js`, `test/compat-scan.test.js`,
927
+ `test/wire-format-vectors.test.js` &mdash; 54 new cases on top of the
928
+ pre-existing AI client tests. Full suite 64/64.
929
+
930
+ ### --init templates
931
+
932
+ - Added `nextjs-app` and `react-native-app` `--init` templates plus `next`, `nextjs`, `react-native`, `reactnative`, `metro`, and `expo` aliases so scaffolded configs match the existing framework integrations.
933
+ - Added `vite-app`, `webpack-app`, `rspack-app`, and `turbopack-app` `--init` templates plus matching aliases so supported modern build paths now have first-class starter configs.
934
+ - Added `parcel-app`, `bun-app`, and `browserify-app` `--init` templates plus matching aliases so shipped Parcel/Bun/Browserify workflows now scaffold directly from the CLI.
935
+ - Added first-class `parcel`, `bun`, and `turbopack` package exports so the documented post-build workflows now ship with callable helpers and typed plan/config APIs.
936
+
937
+ ## 0.1.1
938
+
939
+ - Added `--mode` support so CommonJS and ES module config functions can branch cleanly across production, staging, and similar release profiles.
940
+ - Added the `electron-app` init template plus `electron` and `desktop` aliases for faster Electron/Desktop release onboarding.
941
+ - Added shipped Parcel, Bun, and Turbopack post-build examples plus README coverage for modern release pipelines without dedicated wrapper entrypoints.
942
+ - Fixed TypeScript init-template declarations so the public types include the shipped `electron-app` scaffold and aliases.
943
+ - Added regression coverage to ensure package JSON files do not introduce duplicate keys.
944
+ - Updated local-install tarball references and package metadata for the new patch release.
945
+
946
+ ## 0.1.0
947
+
948
+ Initial private package scaffold for JavaScript Obfuscator HTTP API workflows.
949
+
950
+ - Added dependency-free CLI for directory, single-file, stdin/stdout, and dry-run workflows.
951
+ - Added named presets: `standard`, `balanced`, and `maximum`.
952
+ - Added JSON config schema, `--init`, online web-preset import, and CI option overrides.
953
+ - Added `doctor` preflight checks with optional tiny live API validation.
954
+ - Added Node API plus esbuild, Vite, Rollup, and Webpack entrypoints.
955
+ - Added a dedicated `react-native` alias entrypoint for Metro/Expo integrations.
956
+ - Added TypeScript declarations for public entrypoints.
957
+ - Added source-map removal, asset copying, include/exclude filtering, and public-name preservation helpers.
958
+ - Added Webpack 4 compatibility through a legacy `emit`-hook fallback while keeping Webpack 5 and Rspack support.
959
+ - Expanded Browserify, Webpack plugin, and Webpack/Rspack loader coverage to respect configured script extensions such as `.mjs` and `.cjs`.
960
+ - Added JS-Confuser migration helpers for the CLI and Node API, including starter-config conversion, option explanations, and direct translation for common presets, locks, and string/control-flow settings.