Menu

Your logger redaction only hides the fields you remembered
📰

Your logger redaction only hides the fields you remembered

DEV Community: node·Umud Hasanli·1 day ago
#KG227H2t
#devtonodejs#devto#dev#redact#flare
Reading 0:00
15s threshold

Every leaked secret I have seen started the same way. Someone wrote logger.info({ user }) , the code looked harmless, and user carried a session token. Now that token lives in the log aggregator, the error tracker and a few vendors' systems, for as long as they keep logs.

Most loggers have an answer for this. pino has a redact option, and you can write a winston format. Both work the same way: you list the paths that are sensitive, and those fields are masked.

The trouble is the list. It only covers what you remembered. The leak is always somewhere else:

a free-text note field where a customer pasted an API key

a nested payload from a third-party SDK you never looked inside

an error message that includes the request URL, with a token in the query string

Read the values, not the names

I built flare-redact to check the content itself.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.