Why this matters
TLS and managed keys satisfy SOC 2 encryption requirements.
Use app.UseHsts(); app.UseHttpsRedirection(); store DataProtection keys in Azure Key Vault or KMS with rotation.
TLS and managed keys satisfy SOC 2 encryption requirements.
Side-by-side examples engineers can pattern-match during review.
app.UseRouting(); // no HTTPS or HSTSapp.UseHsts(); app.UseHttpsRedirection(); services.AddDataProtection().PersistKeysToAzureBlobStorage(blob) /* or KeyVault /;app.UseHsts();app.UseDeveloperExceptionPage(); // in productionFrom 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.