How would you prevent and test sensitive-data leakage through telemetry?
Answer
Define an allowlist of operational fields and classify data before it reaches logs, metrics, spans or propagated baggage. Exercise credentials, tokens, personal data, payment values and confidential payloads through success, validation, exception and retry paths, then search every collector and backend representation for raw and encoded variants. Verify redaction at the earliest safe boundary, access control, retention and deletion, and ensure diagnostic usefulness survives without copying full requests or secrets.
Strong answer includes
- tests all telemetry signals and propagation fields
- covers exceptional as well as successful paths
- checks access and retention in addition to redaction
Practical example
During a security-focused test pass, an engineer submits a payment request with a real-looking card number and an invalid CVV to trigger a validation error, then searches every log line, span attribute, metric label and exception stack trace produced by that request for the card number in plain text, base64-encoded form, and partially masked form. They find the raw card number leaking into an exception message logged by a third-party payment SDK on the failure path only, something that would have been missed if only the success path had been tested.