Skip to content

Harden authentication cookie Secure policy#379

Merged
cdcavell merged 8 commits into
mainfrom
feature/issue-372-secure-auth-cookie
Jul 19, 2026
Merged

Harden authentication cookie Secure policy#379
cdcavell merged 8 commits into
mainfrom
feature/issue-372-secure-auth-cookie

Conversation

@cdcavell

@cdcavell cdcavell commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • change the local authentication cookie default from CookieSecurePolicy.SameAsRequest to CookieSecurePolicy.Always
  • add an explicit ProjectTemplate:Authentication:Cookie:AllowInsecureHttp override for local Development only
  • reject the insecure HTTP override during startup validation in every non-Development environment, even when application authentication is currently disabled
  • pass the host environment into authentication registration so the policy is resolved deliberately
  • document the HTTPS requirement, reverse-proxy behavior, and local plain-HTTP development path

Tests

Added coverage for:

  • secure cookies using CookieSecurePolicy.Always by default
  • the explicit Development override using CookieSecurePolicy.SameAsRequest
  • startup validation rejecting the override outside Development

Validation

GitHub Actions CI passed:

  • solution build and analyzer validation
  • dotnet format verification
  • full test suite
  • coverage generation and repository threshold enforcement
  • security-critical coverage thresholds
  • dependency review
  • CodeQL analysis
  • template smoke tests on Ubuntu, Windows, and macOS
  • Docker build, Compose startup, and health verification
  • non-default no-auth/SQL Server scaffold validation

Fixes #372

@cdcavell
cdcavell marked this pull request as ready for review July 19, 2026 21:22
@cdcavell
cdcavell merged commit 0cdedff into main Jul 19, 2026
10 checks passed
@cdcavell
cdcavell deleted the feature/issue-372-secure-auth-cookie branch July 19, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden authentication cookie Secure policy for HTTPS deployments

1 participant