dsar-warden

Warden · privacy & compliance

dsar-warden

Assemble Data Subject Access Request exports from many systems into one structured, checksummed bundle, and catch the mistakes before you send it.

npm i -D @mrlouiswright/dsar-warden

Published to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).

What it checks

  • SourcesCSV/TSV (quotes, CRLF, BOM), JSON (array, or recordsPath into an object) and JSONL/NDJSON exports, paths relative to the manifest.
  • Matchingone or more identifiers (email, customer_id, phone, ...) mapped to fields per source, including nested paths (customer.id) and several fields (["to", "cc"]); case-insensitive, phone numbers normalised.
  • Cleaninginclude to whitelist fields, exclude to drop them, redact to keep the key with [REDACTED]; password, token, hash, salt, OTP and session fields are always removed and reported.
  • Third-party dataemails and phone numbers in exported records that do not belong to the subject are flagged until redacted or marked thirdPartyReviewed.
  • Article 15 contexteach source should state purpose, category, recipients and retention; these are carried into the bundle and SUMMARY.txt.
  • Deadlinedue date is one calendar month from received (clamped at month end; extended: true adds two months, or set deadlineDays); overdue and due-soon requests are reported, plus unverified identity.
  • Bundle--out dir writes bundle.json, sources/<id>.json, SUMMARY.txt and SHA256SUMS.

Quick usage

CLI

npx dsar-warden requests/DSAR-2026-014 --out out/DSAR-2026-014
npx dsar-warden dsar.json --subject email=jane@acme.io --subject customer_id=C123 -o bundle
npx dsar-warden . --fail-on medium --format markdown

API

import { assemble, writeBundle } from "dsar-warden";
const { bundle, raw } = assemble(manifest, { baseDir: "requests/DSAR-2026-014" });
if (!raw.some((f) => f.severity === "high")) writeBundle(bundle, "out");

Every option is documented in the dsar-warden docs.

CI / GitHub Action

permissions:
  contents: read
  security-events: write   # only needed for the SARIF upload
jobs:
  dsar-warden:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
        with: { persist-credentials: false }
      - uses: MrLouisWright/dsar-warden@v1
        with:
          path: requests/DSAR-2026-014
          fail-on: high
          sarif: dsar-warden.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with: { sarif_file: dsar-warden.sarif }