0

Two questions: in EF we are using an interceptor defined in the Web.Config:

We are interested to move to ASP.Net Core but understood that in EF Core there is no interceptor and is not in the road map.

1- I was wondering if by chance someone found a similar pattern to intercept in a way the process as we keep the connection string away from the users and the interceptor give us the opportunity to have a log of the requests?

2- ASP.NET also allows the encryption/decryption (asp.net_regiis) of the complete Web.Config, is it possible to do something similar with the JSON or other possibilities?

Leok
  • 31
  • 1
  • 3
  • What do you want the interceptor for? Interceptors are a way of implementing patterns or features, they aren't patterns themselves. You can use global filters for example to handle multi-tenant data or soft deletes. They aren't needed to secure connection strings anyway – Panagiotis Kanavos Mar 20 '19 at 14:42
  • And 2) .NET Core offers **far** more secure options for protecting secrets, that can be configures with a couple of lines. That's covered in [the Configuration docs](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#file-configuration-provider) - using a Key management service is a *lot* more secure than encrypting strings in a single machine, which is what `asp.net_regiis` does – Panagiotis Kanavos Mar 20 '19 at 14:45
  • Check the [Security](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2#security) section in `Configuration in ASP.NET Core`, and the [ASP.NET Core Data Protection](https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/introduction?view=aspnetcore-2.2) article. The first one shows how configuration can be secured using various providers. The second one shows how to protect sensitive data in general, not just settings. The two can be combined to create eg a provider that uses a key stored in Key Vault to encrypt/decrypt settings – Panagiotis Kanavos Mar 20 '19 at 14:49

0 Answers0