Trust loopback forwarded headers and pin the Data Protection key ring

UseForwardedHeaders runs first with KnownProxies exactly loopback and
ForwardLimit 1; Data Protection always uses application name "Bifrost";
the startup validator refuses production without DataProtection:KeysPath.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 05:26:38 +02:00
commit 2e0de9601c
4 changed files with 207 additions and 4 deletions

View file

@ -66,6 +66,11 @@ public sealed class StartupConfigurationValidator(
failures.Add("Connection string 'Bifrost' must be configured.");
}
if (string.IsNullOrWhiteSpace(configuration["DataProtection:KeysPath"]))
{
failures.Add("DataProtection:KeysPath must be configured for production.");
}
if (failures.Count > 0)
{
throw new InvalidOperationException(