-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
add automatic state store encryption #3589
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3589 +/- ##
==========================================
- Coverage 60.64% 60.28% -0.37%
==========================================
Files 97 99 +2
Lines 8790 8968 +178
==========================================
+ Hits 5331 5406 +75
- Misses 3078 3160 +82
- Partials 381 402 +21
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I found this thing in how it is serializing into byte[] prior to encrypting. Can we have an E2E test showing that this works? Also, I think we should wrap this as a experimental feature.
I added a test to ensure base64 values get encrypted and decrypted successfully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Artur on this, since we are modifying one of the most basic features of Dapr, we need to have an E2E for it for sure as well as wrap it in a feature flag as experimental for the first release and then later release it completely.
pkg/encryption/encryption.go
Outdated
secondaryEncryptionKey = "secondaryEncryptionKey" | ||
errPrefix = "failed to extract encryption key" | ||
AES256Algorithm = "AES256" | ||
FeatureName = "encryption" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: please, use this enum instead:
dapr/pkg/config/configuration.go
Line 40 in a30488d
PubSubRouting Feature = "PubSub.Routing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, name it State.Encryption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the first time I see the "centralized" list.. it's mostly an anti-pattern in Go as packages are expected to be self-governed and all encompassing, also test dependencies or 3rd parties wanting to use the feature names now need to pull the dependencies of configuration. I made that change for now but will probably open an issue to disperse these among their respective packages.
This PR brings automatic state encryption with key rotation support to all Dapr state stores.
Closes #1090.