Sensitive Data Logging (ARCH9128)
Ce contenu n’est pas encore disponible dans votre langue.
Key swift.security.sensitive-data-logging · Severity error · Category security · CWE CWE-532
Flags log / print calls that write a credential-named value (password, token, API key) into the log store.
Incorrect
Section titled “Incorrect”logger.info("login ok for \(user) with \(password)")Correct
Section titled “Correct”logger.info("login ok for \(user.id, privacy: .private)")Log an identifier or a masked form; mark it .private in os.Logger; never the secret itself.