What Gets Scrubbed from a Raw HAR Capture
An HTTP Archive (.har) capture is plain JSON containing every request and response recorded while a browser tab reproduced a bug. Unfortunately, attaching raw HAR logs to an issue tracker, vendor support ticket, or team Slack channel is one of the fastest ways to leak live production credentials: even after you close DevTools, the JSON still holds valid Cookie headers, Set-Cookie session grants,Authorization: Bearer ... JWTs, and password reset tokens.
This browser-only sanitizer never uploads your capture. It deep-clones the parsed HAR JSON in memory and runs five configurable passes with an itemized audit trail:
- Auth & API Key Headers: Masks
Authorization,Proxy-Authorization,X-API-Key,X-Auth-Token,X-CSRF-Token, and security tokens in both request and response headers. - Cookies & Set-Cookie: Scrubs raw cookie header strings as well as structured
request.cookies[]andresponse.cookies[]arrays so session identifiers never slip through duplicate HAR fields. - Query Secrets: Redacts query parameters such as
access_token,client_secret,api_key,signature, andcodeinside both the request URL string and the structuredqueryString[]array. - Inline JWTs & Provider Keys: Detects Bearer/Basic tokens, base64url JWT segments (
eyJ...), Stripe, GitHub, Google API, and AWS access key prefixes across headers, URLs, and text payloads. - Emails & Secret JSON Fields: Redacts email addresses and sensitive JSON keys such as
password,refresh_token, andapi_keyinside JSON request or response bodies.
QA Workflow & Local CLI Alternative
- Click Try sample .har (with mock secrets) to verify the redaction audit log and toggle checkboxes, or drop your exported Chrome / Firefox / Edge
.harfile above. - Review the Redaction Audit tab to confirm which entries matched, then spot-check theRequests & Safe cURL tab to copy sanitized reproducible
curlcommands directly into bug tickets. - Download the cleaned
*-sanitized.harJSON file safely from local memory.
If you automate log scrubbing inside a CI pipeline, you can also strip standard headers via jq:
# Minimal jq example: scrub Authorization & Cookie request headers (note: does not scan bodies/URLs)
jq '(.log.entries[].request.headers[] | select(.name | test("^(authorization|cookie|x-api-key)$";"i"))).value = "[REDACTED]"' raw.har > clean.harLimitations & Spot-Check Guidance
- Base64-encoded binary responses: Entries marked
encoding: "base64"(such as images or compressed blobs) are left untouched to avoid corrupting binary attachments. - Proprietary custom headers: If your internal service passes a secret inside a bespoke header name like
X-Acme-Tenant-Signaturewithout a standard prefix, inspect Sanitized Output Previewbefore distributing externally.
Frequently Asked Questions
Why must you sanitize a HAR file before attaching it to Jira, GitHub, or Slack?
Browser DevTools exports every request header, response header, and cookie verbatim inside a .har JSON file. Anyone who opens an unsanitized HAR can replay your active session cookies, Bearer JWTs, or OAuth API keys until they expire.
Does the sanitizer preserve timing, HTTP status codes, and API error bodies needed for debugging?
Yes. Request URLs (minus sensitive query parameters), HTTP methods, status codes, timings, and non-secret JSON fields stay intact so engineers can still see the exact 4xx/5xx failure and payload structure.
Can regex-based sanitization catch every proprietary custom secret?
Automated rules handle standard Auth/API key headers, Cookies, common secret query names, JWTs, known provider token prefixes, and email addresses. Always review the Sanitized Output Preview tab when an application puts custom tokens inside non-standard header names or opaque binary strings.
Are generated cURL commands also scrubbed before copying?
Yes. Each request row builds its reproducible cURL snippet from the already-sanitized HAR entry, with single quotes shell-escaped and HTTP/2 pseudo-headers stripped.