-
Notifications
You must be signed in to change notification settings - Fork 289
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
Cross-platform SqlColumnEncryptionCertificateStoreProvider support #3014
base: main
Are you sure you want to change the base?
Cross-platform SqlColumnEncryptionCertificateStoreProvider support #3014
Conversation
* Only allow the use of the CurrentUser location for certificates. * Changed the PublishTestResults@2 step to ensure that failed tests are also published.
…t to fix problems importing these files on MacOS
…t to fix problems importing these files on MacOS
…' of https://github.com/edwardneal/SqlClient into feat/xplat-column-encryption-certificate-store-provider
Converting more unusually-embedded PFX files into embedded resources
6966d54
to
c199ddd
Compare
Eliminating possibility of a certificate with a private key having been previously added to the user certificate store.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3014 +/- ##
==========================================
+ Coverage 72.68% 72.71% +0.02%
==========================================
Files 285 284 -1
Lines 59155 59166 +11
==========================================
+ Hits 42998 43023 +25
+ Misses 16157 16143 -14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
This has reached the point where it needs a rough review by the SqlClient team. We can make Secondly: around half of this PR's additions and a quarter of its file changes are because I moved the certificates which were previously static byte arrays in the code to .pfx files which are included within the test assembly as embedded resources. In the process, I also added a password to these .pfx files - macOS didn't seem to import them as certificates without one. Is this going to fall afoul of any security policies against checking private keys into the repo, or is it not a problem if they're only used for the tests? If all's well, I'll likely cherry-pick some of the test changes included in this PR into a new one; it should clean up the diff a little and make it easier to review. |
I'm pretty sure the private keys and password won't pass credential scanners. Can the files be generated on the fly with random passwords? |
They can, and in some places they are - some of the tests launch a PowerShell script to do that. I'll work out a way to make this consistent across the tests... Edit: it looks like there are three or four different sets of hardcoded certificates; some have hardcoded passwords, some don't have passwords at all. I'm working on a common approach which does as you've suggested; that'll be a separate PR for ease of review. Second edit: I've decided to split this prerequisite into two PRs, the first of which is #3034. |
Wider idea: #3048.
SqlColumnEncryptionCertificateStoreProvider
is the only built-inSqlColumnEncryptionKeyStoreProvider
implementation which needs no significant code changes to enable cross-platform support out of the box. I've removed the Unix-specific guards on this and widened the test coverage.In the process, I've switched the Linux/macOS tests to use SqlColumnEncryptionCertificateStoreProvider rather than the Azure Key Vault provider. This doesn't seem to have had an impact on the code coverage statistics, but it's notable nonetheless.