ingestion safety: fail-closed pii masking + health visibility - #243
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Makes ingestion fail-closed and gives visibility to silent failures.
Security
console.warn.maskLogBatchnow reports per-record failures and the ingestion service rejects exactly those records before the reservoir write (the whole batch if rule compilation itself fails). Rejected records are reported back to the client in the new optionalrejected: [{ index, reason: 'pii_masking_failed' }]response field and aspartialSuccess.rejectedLogRecordson the OTLP logs endpoint. Every rejection increments theingestion.pii_rejectedcounter. Unmasked data can no longer reach any storage engine.Added
GET /api/v1/admin/stats/ingestion-healthendpoint aggregating the last 24h of the new counters (pii_rejected,detection_enqueue_failed,exception_enqueue_failed,identifier_failed) plus SIEM enrichment status (GeoLite2/IPsum), shown in an admin dashboard card that turns red on failures. Detection/exception job enqueues now retry once and, on a second failure, log loudly instead of failing silently.Fixed
catch {}; GeoLite2/IPsum warn once per outage).getStatsdate-filter tests strengthened (exact assertions instead oftoBeGreaterThanOrEqual(0)).en-USlocale (digests and alert emails no longer depend on the server locale).