Aller au contenu

Sensitive Data In Logs (ARCH4160)

Ce contenu n’est pas encore disponible dans votre langue.

Key java.logging.sensitive-data-in-logs · Severity error · Category logging

Logging sensitive data such as passwords, tokens, API keys, SSNs, or credit cards leaks those secrets into log sinks. Log files are often stored with weaker protection and broad access.

log.info("Login attempt: user={} password={}", username, password);
log.info("Login attempt: user={}", username);

Remove or mask sensitive fields from logs entirely; record only non-sensitive identifiers.