HAR File & JSON Log Secret Sanitizer
Scrub session cookies, Authorization headers, JWTs, Stripe/AWS API keys, and embedded JSON body secrets from HAR files and logs 100% locally in your browser.
Ctrl+F) before sending .har files to third parties.Example Output (HAR & JSON Secret Sanitizer)
{
"log": {
"version": "1.2",
"entries": [
{
"request": {
"method": "POST",
"url": "https://api.example.com/v1/checkout?api_key=sk_live_dummy_key_998877",
"headers": [
{ "name": "Authorization", "value": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyXzEyMyJ9.sig123456" },
{ "name": "Cookie", "value": "session_id=s%3A998877665544; theme=dark" }
],
"cookies": [
{ "name": "session_id", "value": "s%3A998877665544" }
],
"postData": {
"mimeType": "application/json",
"text": "{\"email\":\"admin@company.io\",\"password\":\"SuperSecret123!\",\"stripeKey\":\"rk_live_dummy_991122\"}"
}
}
}
]
}
}{
"log": {
"version": "1.2",
"entries": [
{
"request": {
"method": "POST",
"url": "https://api.example.com/v1/checkout?api_key=[REDACTED_QUERY_SECRET]",
"headers": [
{
"name": "Authorization",
"value": "[REDACTED_AUTHORIZATION]"
},
{
"name": "Cookie",
"value": "[REDACTED_COOKIE]"
}
],
"cookies": [
{
"name": "session_id",
"value": "[REDACTED_COOKIE_VALUE]"
}
],
"postData": {
"mimeType": "application/json",
"text": "{\"email\":\"[REDACTED_EMAIL]\",\"password\":\"[REDACTED_PASSWORD]\",\"stripeKey\":\"[REDACTED_RK_LIVE_KEY]\"}"
}
}
}
]
}
}
Understanding the HAR & JSON Secret Sanitizer Transformation
HTTP Archive (`.har`) files exported from Chrome DevTools or Firefox Network panels capture a complete forensic snapshot of your browser session. Even when Chrome's 'Export HAR (sanitized)' option is used, it only strips standard `Cookie`, `Set-Cookie`, and `Authorization` headers—leaving custom headers (`X-Shopify-Access-Token`, `X-Api-Key`), URL query string tokens (`?api_key=...`), and serialized JSON request/response bodies (`postData.text` and `response.content.text`) completely exposed. Sharing an unsanitized HAR file with third-party support teams or pasting it into an LLM allows immediate session hijacking. Castov's HAR Sanitizer runs 100% client-side and recursively parses stringified JSON payloads to scrub credentials while preserving valid `.har` structure.
Key Architectural Benefits
- •Recursively parses stringified JSON inside `postData.text` and `response.content.text` to redact nested `password`, `client_secret`, `access_token`, Stripe (`sk_live_`), AWS (`AKIA`), and JWT values.
- •Redacts 18+ sensitive HTTP headers (`Authorization`, `Cookie`, `Set-Cookie`, `X-Api-Key`, `X-Shopify-Access-Token`, `Stripe-Signature`) and `cookies` arrays.
- •Scrubs URL query parameters (`?token=...`, `&api_key=...`, `&x-amz-signature=...`) both in `request.url` strings and `queryString` arrays.
- •Executes 100% locally in your browser memory—you never upload a sensitive HAR file to an external server in order to sanitize it.
Common Conversion Pitfalls & Fixes
Verified Edge Cases & Complex Scenarios
Real payloads often contain edge cases that break naive generators. Here is how our engine handles them:
A GraphQL or REST login request stores a serialized JSON string inside `request.postData.text` containing a `password` and a Stripe `sk_live_` key.
{
"postData": {
"mimeType": "application/json",
"text": "{\"password\":\"MyPass123\",\"token\":\"ghp_1234567890abcdef\"}"
}
}{
"postData": {
"mimeType": "application/json",
"text": "{\"password\":\"[REDACTED_PASSWORD]\",\"token\":\"[REDACTED_TOKEN]\"}"
}
}A request URL contains inline query parameters like `?access_token=eyJ...&X-Amz-Signature=99aabb`.
{
"url": "https://bucket.s3.amazonaws.com/file.pdf?X-Amz-Signature=abcdef123456&token=secret99"
}{
"url": "https://bucket.s3.amazonaws.com/file.pdf?X-Amz-Signature=[REDACTED_QUERY_SECRET]&token=[REDACTED_QUERY_SECRET]"
}Frequently Asked Questions
Does Castov upload my HAR file to any server?
Can I re-import the sanitized HAR file back into Chrome DevTools?
Does this also work on regular JSON application logs (Pino, Winston, Datadog)?
Related Developer Converters
Browse All.env to Zod & T3 Env
Convert .env files into Zod v4, Zod v3, or @t3-oss/env-nextjs schemas in your browser. Infers types without exposing secret values and generates .env.example.
cURL to Fetch
Convert Chrome Copy as cURL commands into Browser Fetch, Node.js Fetch, or Axios code. Handles -H, -d, --data-raw, -u UTF-8 Basic Auth, -F FormData, -b, -L, and -k.
JSON to Zod Schema
Convert raw JSON into strict, production-ready Zod schemas. Supports ISO datetime offsets, email, URLs, nullish options, and inferred TypeScript types in browser.