Documentation
¶
Overview ¶
Package masking provides utilities for redacting sensitive data from HTTP events and log messages before storage.
Sensitive data includes: Authorization headers, Cookies, API keys, tokens, passwords, and secrets. Detection is based on field names and regex patterns.
Masking is applied automatically before storing event JSON and log messages in the database. The original unmasked data is still passed to Lua function handlers.
Index ¶
- func IsSensitiveBodyField(key string) bool
- func IsSensitiveKey(key string) bool
- func IsSensitiveQueryParam(key string) bool
- func MaskHTTPEvent(event events.HTTPEvent) events.HTTPEvent
- func MaskHeaders(headers map[string]string) map[string]string
- func MaskJSONBody(body string) string
- func MaskLogMessage(message string) string
- func MaskQueryParams(query map[string]string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSensitiveBodyField ¶
IsSensitiveBodyField checks if a JSON body field name suggests it contains sensitive data Uses exact match or prefix match to avoid false positives (e.g., "completion_tokens" should not match "token")
func IsSensitiveKey ¶
IsSensitiveKey checks if a key name suggests it contains sensitive data
func IsSensitiveQueryParam ¶
IsSensitiveQueryParam checks if a query parameter name suggests it contains sensitive data
func MaskHTTPEvent ¶
MaskHTTPEvent creates a copy of the HTTPEvent with sensitive data masked
func MaskHeaders ¶
MaskHeaders masks sensitive headers in a map
func MaskJSONBody ¶
MaskJSONBody attempts to parse the body as JSON and mask sensitive fields If parsing fails, returns the original body unchanged
func MaskLogMessage ¶
MaskLogMessage masks sensitive patterns in log messages
Types ¶
This section is empty.