Skip to content

feat: add the Security Map foundation - #633

Merged
mattaereal merged 8 commits into
developfrom
feat/security-map-foundation
Sep 14, 2026
Merged

mattaereal merged 8 commits into
developfrom
feat/security-map-foundation

Conversation

@mattaereal

Copy link
Copy Markdown
Collaborator

What does this PR change?

Replace the radial Attack Surface Overview prototype at /intro/attack-surface with a first production Security Map: a versioned, validated graph of SEAL knowledge plus an interactive explorer and local control assessment.

Closes nothing. Foundation PR.

Type of change

  • New content
  • Edit to existing content
  • Outline / structure change
  • Typo or formatting fix
  • Tooling / config

Problem

The old dashboard was a fixed 12-node radial SVG. Threats defaulted to red "gaps", could be marked "secured", and stored threat-level yes/no/partial in attackSurface-posture. Incident examples and loss figures had no sources. Relationships lived in a handwritten TypeScript array instead of repository data.

Scope

Foundation only. Seed graph for the migrated threat concepts, generator/validator, UI, local assessment, maintainer docs. Not a repo-wide framework mapping, not an incident database, not accounts or synced assessments.

Architecture

docs/data/security-map/ (taxonomy, schema, nodes, edges, views, optional MDX securityMap frontmatter)
utils/security-map-lib.cjs loads, merges, validates
→ writes public/security-map.json and components/security-map/securityMap.generated.ts from the same in-memory graph
→ React Security Map at /intro/attack-surface
→ control assessments in localStorage key seal-security-map-assessment:v1

Renderer is original SVG/HTML, not Cytoscape. Overview shows eight domains and saved entry points, not the full graph. The list is the primary keyboard/AT interface; the canvas is aria-hidden.

Schema and validation

  • schemaVersion 1.0.0
  • Prefixed kebab-case IDs
  • Bounded node/edge types and an edge compatibility matrix
  • Guidance href resolved against docs/pages
  • Incidents require sources (seed ships zero incident nodes)
  • Threats must targets something and have a mitigates or documented-by path
  • assessmentEligible only on controls
  • Build fails on invalid graph (docs:dev / docs:build run generate-security-map)

UI

Search, AND-across / OR-within filters, domain overview, curated views, 1-hop focus, expand-one-hop, detail panel, guidance links, seven-state control assessment, import/export with preview.

Shareable query params: focus, domain, view. Never assessment state.

Privacy and security

  • No assessment API, analytics, or remote layout
  • Assessment stays in this browser
  • Import validates size, schema, enums, and drops __proto__ / unknown IDs
  • Replace-after-preview, no partial apply
  • No dangerouslySetInnerHTML, no CDN runtime, no CSP changes
  • Legacy attackSurface-posture is detected and not converted into control evidence

Accessibility

Semantic list/tree for the same tasks as the graph. Icon-only controls named. Live region for search/focus, not pan. Reduced motion respected. Color is not the only encoding.

Migration

  • Route /intro/attack-surface kept
  • Sidebar and page title: Security Map
  • AttackSurfaceDashboard re-exports SecurityMap
  • threatData.ts and AttackSurface.css removed
  • SDLC pipeline now owns categoryMeta / Category / FrameworkLink so it no longer imports the deleted catalogue
  • Stale threatData routes remapped (e.g. /front-end-web-app/overview, /incident-management/playbooks/hacked-dprk)

Validation

Command Result
pnpm run test:security-map 26 pass, 0 fail
pnpm run validate:security-map OK, 127 nodes, 165 edges, 7 views
pnpm run validate:content -- --path docs/pages/intro attack-surface.mdx passed. Other intro pages still have pre-existing content-debt failures (missing tags/contributors). Not introduced here.
pnpm exec cspell on touched MDX 0 issues
pnpm run docs:build succeeded
git diff --check clean
Preview :4173/intro/attack-surface title Security Map; search found Hardware-backed signer isolation; focus URL ?focus=control-signer-isolation; assessment stored locally and not in the URL; graph hidden at 390px

markdownlint-cli2 is not installed in this environment; justfile lint could not run that half.

Visual evidence

Screenshots taken during preview (desktop dark, focused control + assessment, desktop light, mobile 390). Not committed. Attach via PR comment for /img-bot if wanted.

Known limitations

  • Seed is proposed, not steward-reviewed
  • Not every framework is mapped
  • No incident nodes (unsourced one-liners from the old catalogue were not promoted)
  • Custom SVG neighborhood, not a full layout engine
  • Assessment parser exists in utils/security-map-assessment.cjs (tested) and is wrapped by the client module

Follow-up

  1. Map one framework per PR (feat/security-map-<framework>), steward review
  2. Sourced incidents in evidence-only PRs
  3. Coverage reports (threats without controls, controls without guidance, assets without response)
  4. Schema migrations before ID/enum changes
  5. Later: search, MCP/retrieval, cert mappings

OKcontract Interactive Onchain Attack Map was used only as interaction inspiration (select, trace, filter, share a focused view). No OKcontract code, data, assets, branding, or undocumented behavior was copied.

If applicable

  • Editing existing content: tagged the current contributors from the attribution list
  • Framework has a steward: asked them to review
  • Outline change: updated vocs.config.ts with the dev: true parameter
  • Want community feedback: shared this PR in our Discord

Replace the radial Attack Surface Overview with a versioned graph
catalogue, build-time validation, and a local control-assessment UI
on the existing /intro/attack-surface route.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploying frameworks with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98b3a42
Status: ✅  Deploy successful!
Preview URL: https://d779a207.frameworks-573.pages.dev
Branch Preview URL: https://feat-security-map-foundation.frameworks-573.pages.dev

View logs

Replace the search/filter/radial UI with a six-column map
(assets, components, attack surfaces, threats, controls, guidance).
Clicking a field lights related fields in the other columns and
shows counts for surfaces, threats, controls, and incidents.
Docs column is too narrow for six columns plus guidance. /map uses
Vocs blank layout so the map sits side by side with the detail panel.
The docs page keeps a compact preview and an Open full map link.
@github-actions

Copy link
Copy Markdown

Sidebar Configuration Reminder

Documentation files update:

New in this push:

  • docs/pages/map.mdx (added) ← NEW

Please ensure that:

  • The sidebar in vocs.config.ts has been updated to include these files
  • New content has the dev: true parameter so it's marked as under development
  • Sidebar links match the file paths - use the preview deployment to verify

See Contributing guidelines - Sidebar / Navigation for more details.


This is an automated reminder. If this PR doesn't need sidebar changes, you can ignore this message.

Same graph, smaller subgraphs. Tabs on /map cut the six columns to a
job (multisig, deployment, domains, signers, supply chain, response)
or to gaps: threats with no response and assets with no protecting
control. Share URLs may include view and focus.
Vocs Link expects `to`. The panel passed `href`, so Open framework page
reloaded /map. Related guidance is no longer a 2-hop button dump.
Documented pages are <a target=_blank>. Other lists stay map focus.
Native <a href> pointed at the right path. Click still stayed on /map
because Vocs routing owns in-app links. Use Link to={page.href}.
Verified click lands on /multisig-for-protocols/overview.
Restore Elliot's radial overview at /intro/attack-surface. Put both
pages under Interactive content. Security Map lives at
/intro/security-map. Map cards use the overview palette: translucent
surfaces, 4px controls, 8px cards, red/green/amber, primary purple.
@github-actions

Copy link
Copy Markdown

Sidebar Configuration Reminder

Documentation files update:

New in this push:

  • docs/pages/intro/security-map.mdx (added) ← NEW

Previously seen:

  • docs/pages/map.mdx (added)

Please ensure that:

  • The sidebar in vocs.config.ts has been updated to include these files
  • New content has the dev: true parameter so it's marked as under development
  • Sidebar links match the file paths - use the preview deployment to verify

See Contributing guidelines - Sidebar / Navigation for more details.


This is an automated reminder. If this PR doesn't need sidebar changes, you can ignore this message.

Vocs warning callout on /intro/security-map. Coverage, layout, and
assessment format may change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant