-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always encrypted support #165
Comments
@andsj073 it's definitely the goal that we support Always Encrypted for exactly the reason you described. I'm sorry to hear that you weren't able to get it working. We'll need to research this more closely and add some documentation providing the right steps, once we figure them out. :) In the meantime, do let us know if you are able to make any progress on getting this scenario working. |
@cgillum In my Durable Function implementation I needed to register the AKV provider to the SQLClient library, like this:
And add the Using SSMS to encrypt the Payloads.Text column and storing the Master key in Key Vault. Setting up access of the Function App service assigned MI to the Key Vault. It all works so far that a NewEvents row is added with a corresponding Instances row and a Payloads row, with the data in the Text column encrypted. However, thereafter the Orchestration Function is never executed successfully and the NewEvents row remains in pending state. I guess that somewhere in the execution coming from the polling mechanism of the Durable Framework that polls the SQL TaskHub provider for new Events the underlying SQLClient provider does not have the AKV Provider registered and fails each time. |
@andsj073 thanks for the update on this. It's interesting that you were able to get it to work as far as encrypting data, but I'm curious to understand why it doesn't seem to be working for unencrypting the data. Is there any documentation you can point to that explains how this is normally expected to be set up? |
@cgillum But the polling for new events happens in another scope/context (by the Durable Functions framework) which doesn’t have the AKV prover registered - I’m guessing - which then fails. That would/could explain why a row with encrypted data is created but then nothing more. |
Makes sense. You never really know what the behavior will be when you call a global/static method like Based on what you've discovered, it seems like we may need to create a new API for registering custom column encryption key store providers when using the MSSQL provider. For Azure Functions, we can probably expose this via host.json settings, making it easier to configure. I see you're specifying a specific user-assigned client ID, so that would be one such setting. I assume there may be a few others that some users would want. |
@cgillum
complete code for replication
host.json
local.settings.json
|
Hello
I am wondering if it is already possible to enable Always Encrypted / Column Encryption on the TaskHub database?
And if not, if you are considering it?
I have tried to make it work but have so far been unsuccessful and guess it doesn't either.
So what do I want to accomplish and why?
I want to turn on SQL Server/Database Column Encryption on the Payloads.Text column of the TaskHub.
This because the Durable Function we are developing will handle highly sensitive data as payload and we want to protect it with application level encryption, thus ensuring that not even the database owners/admins can read the payload data (as they will not also have access to the master key in the Key Vault - i.e. technically enforcing strong segregation of duties).
I tried assigning the Function App of the Durable Function both System and User assigned managed identities (that were enabled as Users in the Database as well) with the right role assignment to the Key Vault key, and with the connection string parts Authentication=Active Directory Managed Identity; Column Encryption Setting=enabled
I also added the Nuget Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider to the Durable Functions project before deployment.
To no avail
Looking forward to hear you recommendations and/or if this will make it to the backlog for consideration
Thank you!
The text was updated successfully, but these errors were encountered: