Why this matters
Transport security and auditable changes are SOC 2 essentials.
Install HSTS in Ktor, require HTTPS redirects, and emit structured audit events for role changes with callId/traceId.
Transport security and auditable changes are SOC 2 essentials.
Side-by-side examples engineers can pattern-match during review.
install(HSTS) { maxAge = 0 }install(HSTS) { includeSubDomains = true; maxAgeInSeconds = 31536000 }
call.application.environment.log.info("{"action":"role.change","user":"$uid","trace_id":"${call.callId}"}")install(HSTS) { maxAgeInSeconds = 31536000 }install(HSTS) { maxAgeInSeconds = 0 }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.