Skip to content

Feature: HAR redaction/sanitization (local) #31

@pillowbytes

Description

@pillowbytes

HAR Redaction / Sanitization (Phase 0 - MVP)

Summary
Add a robust, client-side HAR redaction/sanitization tool to Replin Inspect so users can safely share or archive HAR files without exposing sensitive tokens, cookies, headers, or large response bodies. All processing must be performed in-browser; no data egress.


Scope (high level)

  • Phase 0 (MVP): UI panel + basic redaction pass (strip Authorization and Cookie headers; truncate request/response bodies > 64KB to a short snippet plus metadata). Allow download of sanitized HAR and include a small manifest entry in the sanitized file.
  • Phase 1: Add pattern detectors (JWT, Bearer, API key heuristics), per-field JSON masking, query param redaction, preview evidence UI, and manifest detailing applied rules.
  • Phase 2: Policy/rule import-export, streaming parsing for large HARs, enterprise presets and audit UI.

Why

HAR files commonly include sensitive data (cookies, auth headers, tokens, query params, response bodies). A built-in, client-side redaction flow will let support engineers create safe, shareable HAR files without leaving the browser.


What is considered sensitive (examples)

  • Headers: Authorization, Proxy-Authorization, X-Auth-Token, Cookie, and any header containing auth or token.
  • Cookies: session cookies (session, sid, auth, jwt), SSO cookies, CSRF tokens.
  • Query params: api_key, token, access_token, secret, password, session_id.
  • Request/response bodies: fields named password, token, secret, email, ssn, card numbers, or any PII.
  • Other metadata: internal hostnames, IPs, referer/origin revealing internal flows.

Design & UX (summary)

  • Add a Sanitize / Redact step into the upload flow (post-upload, pre-download).
  • Modes: Safe (default) and Custom (advanced toggles).
  • Preview: side-by-side sample of original vs redacted for a selected request.
  • Manifest: embed a JSON manifest in the sanitized HAR listing applied rules and counts.

Acceptance criteria (MVP)

  • Default Safe mode strips Authorization and Cookie headers and truncates bodies > 64KB.
  • Download sanitized HAR locally; no network egress.
  • Unit tests for header/cookie redaction and body truncation; one functional test verifying sanitized HAR lacks Authorization/cookie values.

Implementation notes

  • Deterministic rules (exact header/cookie names) + heuristic detectors (JWT, bearer tokens, API keys).
  • Replace redacted values with placeholders (e.g. <REDACTED: Authorization token>) and record evidence in manifest.
  • For large files, process in chunks and warn users about memory limits.

Phasing & next steps

  1. Create Phase 0 PR (feat-redact-har-mox) implementing MVP safe mode. Include tests and QA steps.
  2. After MVP merged, plan Phase 1 (pattern detectors, JSON masking, preview) with separate issue(s).
  3. Phase 2 enterprise features later.

I will draft the Phase 0 PR after you confirm. The PR will be small, low-risk, and fully client-side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions