Why this matters
Prevents leakage of sensitive data and improves audit quality for SOC 2.
Wrap logger to filter emails and tokens using regex before logging; include trace_id in every entry.
Prevents leakage of sensitive data and improves audit quality for SOC 2.
Side-by-side examples engineers can pattern-match during review.
log.Printf("login %s token=%s", email, token)logger.Info("auth.login", zap.String("email_hash", hash(email)), zap.String("trace_id", tid))logger.Info("export", zap.String("trace_id", tid))log.Println(email)From the same buckets as this rule.
Public services must require TLSv1.2 or higher and set HSTS (max-age ≥ 15552000, includeSubDomains). Reject plaintext HTTP and weak ciphers; cookies must be Secure and HttpOnly with SameSite set.