Sensitive Data In Logs (ARCH2160)
Ce contenu n’est pas encore disponible dans votre langue.
Key python.logging.sensitive-data-in-logs · Severity error · Category logging
Logging sensitive identifiers such as passwords, tokens, secret keys, SSNs, or credit cards risks leaking those secrets to log sinks. Logs are often stored in less-protected environments.
Incorrect
Section titled “Incorrect”logger.info("Login attempt: user=%s password=%s", user, password)Correct
Section titled “Correct”logger.info("Login attempt: user=%s", user)Remove or mask sensitive fields in log messages; record only safe identifiers.