Works on this device
Log Secret Redactor
Paste a log before you share it in a ticket, a chat or a bug report. The redactor replaces keys, tokens, JSON Web Tokens, passwords in links, private key blocks and the values of names you list, and marks every change. It works in this browser.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Redact.
Your result
How it was worked out
How to use this redactor
- Paste a copy of the log into Log text, or open a log file. Use test values when you try the tool.
- Check the patterns. Change the list of token prefixes and the list of names to fit your logs. Tick the entropy test to find keys with no known prefix.
- Choose Redact. Read the marked log and the table of what was replaced (the line, the kind and the length, never the secret).
- To check what was hidden, tick Show the hidden parts on this screen only under More options. Then copy or download the redacted log.
The patterns, in order
- Private key blocks: from
-----BEGIN ... PRIVATE KEY-----(also the PGP PRIVATE KEY BLOCK) to its END line, or to the end of the text when the END line is missing. - JSON Web Tokens: three base64url parts joined by dots, the first two starting with
eyJ, when the first part reads as a JSON object. - Tokens with a known prefix: a prefix from your list at the start of a word, then at least 8 letters, digits, _ - or . (a dot at the end is left out). The starting list: ghp_, gho_, ghu_, ghs_, ghr_ and github_pat_ (GitHub), glpat- (GitLab), xoxb-, xoxp-, xoxa-, xoxr- and xapp- (Slack), sk_live_, sk_test_, rk_live_ and rk_test_ (Stripe), AKIA and ASIA (AWS access key IDs), AIza (Google API keys), npm_ (npm) and SG. (SendGrid).
- Passwords in links: the password in
scheme://user:password@host, such as a database address. - Bearer and Basic credentials: at least 8 characters after the word Bearer, or the value after
Authorization: Basic. - Values of listed names: the value after a name from your list and = or :, such as
password=...,"api_key": "..."ortoken: .... A value in quotes ends at its closing quote; other values end at a space or , ; & ) ] }. With "names that end with it",db_passwordcounts aspassword. - Entropy (optional): a run of at least 24 characters of letters, digits and + / _ - (with up to two = at its end) whose Shannon entropy H = −Σ p × log2 p is at least 4.5 bits per character. Random keys reach about 5 to 6 bits; words and hexadecimal hashes stay lower.
A part that one pattern has replaced is not looked at again by a later one. Each secret becomes [REDACTED:kind], [REDACTED] or eight stars, as you choose.
Worked example
In the example log the redactor replaces 6 secrets on 5 lines: the password in the postgres:// link, the Bearer token, the AWS key ID and the password in the JSON line, the GitHub token and the JSON Web Token. The last line has no secret and stays as it is.
Limits you should know
- Patterns find secrets in the forms they know. A secret in another form (a password in a sentence, a key split over two lines) can stay. Ordinary text can be hidden by mistake, such as bypass=1 with "names that end with it". Read the result before you share it.
- The log is read in this browser, is never saved and is not put into the CSV file. The redacted log is what you copy or download.
- Hidden parts shown on the screen only can still be seen by anyone beside you.