Show HN: A Mutating Webhook to automatically strip PII from K8s logs
aragoss
23 points
4 comments
May 05, 2026
Related Discussions
Found 5 related stories in 88.3ms across 8,303 title embeddings via pgvector HNSW
- Show HN: Open-Source Article 12 Logging Infrastructure for the EU AI Act systima · 39 pts · March 03, 2026 · 52% similar
- Show HN: Throwaway – open-source disposable email checker and API weddpros · 11 pts · April 30, 2026 · 51% similar
- Show HN: Kloak, A secret manager that keeps K8s workload away from secrets neo2006 · 49 pts · April 25, 2026 · 50% similar
- Show HN: I replaced Google Analytics with my own tool – no cookies, <1KB script VictorChanet · 12 pts · April 06, 2026 · 50% similar
- Tell HN: GitHub might have been leaking your webhook secrets. Check your emails. ssiddharth · 24 pts · April 14, 2026 · 50% similar
Discussion Highlights (4 comments)
aragoss
Hey HN, About 3 months ago I posted here the first version of Pii-shield, the tool that sanitizes logs to hide api-keys using Shannon entropy, Luhn algorithm for credit cards, and regex for custom pii data. The tool itself worked well, but manual injecting sidecars to huge clusters was too complicated, that's why I wanted to rewrite the delivery mechanism, and turn the project into a Kubernetes Operator (Mutating Webhook). In that process I resolved following issues: 1. Replaced the old tail -f | pii-shield pipe with native Go mechanism, which waits for logs files creation to avoid CrashLoopBackOff. 2. If a main container finish it's work, the sidecar continues working and trying to read the logs files. To fix it the Operator injects the agent into the initContainers array with RestartPolicy: Always, so now Kubernetes will know how to behave and kill the sidecar gracefully. 3. If a main container works under root with umask 0077, the nonroot sidecar can't read the the file because of Permission Denied error. Instead of changing user's manifests, the webhook does it automatically, it checks the SecurityContext of a pod, and injects fsGroup: 65532. Now everything is packed into one helm chart. You just describe one simple label pii-shield.io/inject: "true", and the Operator will do the rest of the work, with no code changing. Would be happy to hear you thoughts about it.
dlcarrier
I saw PII and K8 and thought this was talking about early 2000's processors from Intel (Pentium II) and AMD (K8 is the 1st-gen Athlon 64), respectively.
deferredgrant
The hard part is not only catching PII. It is doing that without destroying the debugging signal people needed from the logs in the first place.
dev360
This is interesting - I wonder how hard it would be to do this with a transformer model.