Package com.ganteater.ae.logfilter


package com.ganteater.ae.logfilter
Utilities for masking or redacting sensitive information from already-rendered log text.

This package defines a small string-based filtering SPI. Implementations of LogFilter take an input String (typically a formatted log message, serialized payload, or key/value string) and return a transformed version with sensitive values masked.

Filters

  • MaskEmail masks email addresses using AEUtils.maskEmail(String).
  • MaskJSON redacts values for a configured field name by replacing the matched value with **** using a regular expression. It is not a JSON parser.

Configuration

Filters are constructed with a Map<String, String> of parameters. For MaskJSON, parameter name specifies the field/key to redact.

Usage

 import com.ganteater.ae.logfilter.LogFilter;
 import com.ganteater.ae.logfilter.MaskEmail;
 import com.ganteater.ae.logfilter.MaskJSON;

 import java.util.Map;

 LogFilter emailFilter = new MaskEmail(Map.of());
 String safeText = emailFilter.filter("contact me at user@example.com");

 LogFilter passwordFilter = new MaskJSON(Map.of("name", "password"));
 String safeJson = passwordFilter.filter("{\"password\":\"secret\"}");