examples/protect: demo the static-rule delivery + remote-promotion chain via Pulse - #112
Merged
Merged
Conversation
…ain via Pulse demo.mjs wires rules from a local file; this adds demo-pulse-chain.mjs, which proves the real delivery path: a rule is served by a (mock) Pulse endpoint over HTTP, fetched by the guard's own Pulse client by site UUID, enforced through the .fetch() HTTP guard, then promoted dry-run -> block *remotely* (Pulse flips the bundle's enforcement; the guard hot-swaps on refresh, no redeploy), and finally re-verified against the same lodash CVE-2019-10744 exploit. Uses a real, unmodified vulnerable lodash@4.17.11 and only a public CVE — no tokens/secrets. Adds tests/protect/pulse-chain.test.ts to guard the same chain in CI without a socket (stubbed fetch with ETag/If-None-Match -> 304): siteUuid fetch, dry-run pass-through with onDetect, manual refresh() promotion to block (403), benign 200, and 304 revalidation. Complements runtime-pulse.test.ts (server-fn guard + timer-driven hot-swap). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Comprehensive Pulse delivery and remote-promotion demo with robust testing 🎯 Quality: 100% Elite · 📦 Size: Medium 📈 This month: Your 48th PR — above team average · Averaging Excellent |
Contributor
Author
|
/review |
daniloradovic
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
demo.mjsproves Verified Vulnerability Shielding but wires the rule from a local file. This addsdemo-pulse-chain.mjs, which proves the real delivery path the pilot ships on: the rule is served by Pulse over HTTP, fetched by the guard's own Pulse client by site UUID, enforced through the.fetch()HTTP guard, then promoted dry-run → block remotely (Pulse flips the bundle'senforcement; the guard hot-swaps on refresh — no redeploy), and re-verified against the same exploit.Run it:
Chain (all against a real, unmodified vulnerable
lodash@4.17.11, CVE-2019-10744):enforcement: dry-run— exploit detected + logged but served.enforcement: block(new ETag); a refresh hot-swaps the guard.304 Not Modified(conditional fetch).Tests
Adds
tests/protect/pulse-chain.test.ts— guards the same chain in CI without a socket (stubbedfetchhonoringIf-None-Match→ 304): siteUuid fetch, dry-run pass-through withonDetect, manualrefresh()promotion to block (403), benign 200, and 304 revalidation. Complementsruntime-pulse.test.ts(server-fn guard + timer-driven hot-swap). Full suite green (635 passing).Notes
Public CVE + a mock Pulse endpoint only — no rule corpus, no tokens/secrets. The remote-promotion seam demonstrated here is what the observed→enforced auto-promote flow will build on.