Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update DataProtection config (#493)

Leendert de Borstc93884c306d4
diff --git a/apps/server/AliasVault.Admin/appsettings.json b/apps/server/AliasVault.Admin/appsettings.json
index e91f3221a..e71c413f5 100644
--- a/apps/server/AliasVault.Admin/appsettings.json
+++ b/apps/server/AliasVault.Admin/appsettings.json
@@ -7,7 +7,8 @@
"LogLevel": {
"Default": "Warning",
"Microsoft.AspNetCore.Hosting.Diagnostics" : "Error",
- "Microsoft.AspNetCore.Server.Kestrel": "Error"
+ "Microsoft.AspNetCore.Server.Kestrel": "Error",
+ "Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager": "Error"
}
},
"AllowedHosts": "*"
diff --git a/apps/server/AliasVault.Api/appsettings.json b/apps/server/AliasVault.Api/appsettings.json
index 0b0e6bf1e..8df606a2a 100644
--- a/apps/server/AliasVault.Api/appsettings.json
+++ b/apps/server/AliasVault.Api/appsettings.json
@@ -5,7 +5,8 @@
"Microsoft.AspNetCore.Server.Kestrel": "Error",
"Microsoft.AspNetCore.Hosting.Diagnostics" : "Error",
"Microsoft.EntityFrameworkCore": "Warning",
- "Microsoft.Hosting.Lifetime": "Information"
+ "Microsoft.Hosting.Lifetime": "Information",
+ "Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager": "Error"
}
},
"Jwt": {
diff --git a/apps/server/Services/AliasVault.SmtpService/appsettings.json b/apps/server/Services/AliasVault.SmtpService/appsettings.json
index 7feaf2020..05e1c7806 100644
--- a/apps/server/Services/AliasVault.SmtpService/appsettings.json
+++ b/apps/server/Services/AliasVault.SmtpService/appsettings.json
@@ -3,7 +3,8 @@
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
- "Microsoft.EntityFrameworkCore": "Warning"
+ "Microsoft.EntityFrameworkCore": "Warning",
+ "Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager": "Error"
}
},
"DatabaseProvider": "postgresql",
diff --git a/apps/server/Services/AliasVault.TaskRunner/appsettings.json b/apps/server/Services/AliasVault.TaskRunner/appsettings.json
index 7feaf2020..05e1c7806 100644
--- a/apps/server/Services/AliasVault.TaskRunner/appsettings.json
+++ b/apps/server/Services/AliasVault.TaskRunner/appsettings.json
@@ -3,7 +3,8 @@
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
- "Microsoft.EntityFrameworkCore": "Warning"
+ "Microsoft.EntityFrameworkCore": "Warning",
+ "Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager": "Error"
}
},
"DatabaseProvider": "postgresql",
diff --git a/apps/server/Utilities/Cryptography/AliasVault.Cryptography.Server/DataProtectionExtensions.cs b/apps/server/Utilities/Cryptography/AliasVault.Cryptography.Server/DataProtectionExtensions.cs
index f9f1b041a..62b2f3d28 100644
--- a/apps/server/Utilities/Cryptography/AliasVault.Cryptography.Server/DataProtectionExtensions.cs
+++ b/apps/server/Utilities/Cryptography/AliasVault.Cryptography.Server/DataProtectionExtensions.cs
@@ -47,11 +47,14 @@ public static class DataProtectionExtensions
if (isContainer)
{
// When running in containers, don't use certificate-based key protection due to Linux keystore limitations
- dataProtectionBuilder.UseCryptographicAlgorithms(new Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorConfiguration()
- {
- EncryptionAlgorithm = Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.EncryptionAlgorithm.AES_256_CBC,
- ValidationAlgorithm = Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ValidationAlgorithm.HMACSHA256,
- });
+ // Keys are protected by database access controls, TLS, and container isolation
+ dataProtectionBuilder
+ .UseCryptographicAlgorithms(new Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel.AuthenticatedEncryptorConfiguration()
+ {
+ EncryptionAlgorithm = Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.EncryptionAlgorithm.AES_256_CBC,
+ ValidationAlgorithm = Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ValidationAlgorithm.HMACSHA256,
+ })
+ .SetDefaultKeyLifetime(TimeSpan.FromDays(90));
}
else
{