feat: SOC2 vendor inventory with CI checks - #740
Open
emmyoat wants to merge 1 commit into
Open
Conversation
Add a YAML vendor registry under docs/security with a JSON schema, a dependency-free checker (scripts/vendor-inventory-check.ts) enforcing the schema, the 12-month review freshness rule, duplicate detection, and currency-change re-review detection, plus a CI workflow that fails on stale/duplicate/invalid entries and posts a summary PR comment. 27 unit tests cover parser, validation, freshness, and currency-change edge cases.
|
@emmyoat Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Overview
Adds a lightweight, in-repo SOC2 vendor-management inventory with periodic risk review dates and CI enforcement, per issue #521.
docs/security/vendors.yaml— YAML entries with risk score, criticality, owner, invoicing currency, andreview_date.docs/security/vendor-registry.schema.json— documents the exact entry shape.scripts/vendor-inventory-check.ts— dependency-free validator + freshness checker (no new npm packages)..github/workflows/vendor-inventory.yml— runs on PRs touching the registry, fails if any entry is older than 12 months, and posts a summary comment (vendor count, per-vendor next review date, errors/warnings) on the PR.Related Issue
Closes #521
Changes
docs/security/vendors.yaml— registry with 4 vendors (cloud, payments, email) and allowed currencies.docs/security/vendor-registry.schema.json— JSON Schema (schema_version 1) with required fields, risk_score 1–5, criticality enum, currency ISO-4217, review_date format.docs/security/vendor-inventory.md— guide: how to add/update vendors, review cadence, CI behavior, edge cases.scripts/vendor-inventory-check.ts— includes a small, strict YAML-subset parser (block maps/sequences/scalars, comments, quoted scalars) so no YAML dependency is introduced. Checks:risk_score, out-of-range values, malformed/future dates, invalid criticality, currency not allowed),iddetection,review_dateolder than 12 months fails; entries within 3 months of the limit produce warnings,currencychanges vs. the PR base branch without an updatedreview_date, the check fails (change requires re-review),GITHUB_TOKEN/PR_NUMBER/GITHUB_REPOSITORYare present (mirrorsscripts/dep-alerter.js)..github/workflows/vendor-inventory.yml— node 24,npm ci,npx tsx scripts/vendor-inventory-check.ts, full checkout depth so the base registry can be diffed.scripts/__tests__/vendor-inventory-check.test.ts— 27 tests covering parser, registry parsing, validation, freshness (fresh/warning/stale), currency-change edge cases, and end-to-endrunCheck.Verification Results
npm test -- --testPathPattern=vendor-inventory-check→ 27 passed, 0 failed.npx tsx scripts/vendor-inventory-check.ts(real registry) → exit 0, "Vendor inventory OK."npx eslinton new files → clean. Prettier → clean.npm test: pre-existing failures in severalsrc/suites (e.g.src/utils/__tests__/redact.test.ts,src/routes/__tests__/admin.gdprDsr.test.ts) — reproduced identically on cleanupstream/main(89 failed / 10 passed for those suites with this PR's changes stashed). They appear to be local-environment issues (Node v25 vs CI Node 24) and are unrelated to this PR, which only adds new files and touches no existing source.Acceptance Criteria
vendors.yaml+vendor-registry.schema.json)npm test)docs/security/vendor-inventory.md