-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
FEATURE: Add setting for encryption key #3426
base: 8.3
Are you sure you want to change the base?
FEATURE: Add setting for encryption key #3426
Conversation
f26ad1a
to
209032e
Compare
Usually we put the cache for this into the database, in case the filesystem does not suffice (e.g. if it's non-persistent or the setup scales over multiple server)… |
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 am not opposed to this. I wonder, though, if there should be some check for the key, to make sure it's not just 123
when it is set…
Plaintext secrets in the database might be a way, but have a bad touch to me.
Would keep it simple stupid. Its comment states the default length, which is sufficient in my eyes. Ok? |
True. Point taken.
Yeah, fine. I guess anyone caring enough to set it, will do it right. |
I tweaked the PR description a bit. It would be awesome if you could rebase this on Flow 8.3 though, as it's clearly not in scope for the security-only versions before that. Oh, and – thanks for the PR! I don't mean to sound hostile. 😇 |
With this the encryption key can be defined in a setting: Neos: Flow: security: cryptography: encryptionKey: 'something-random-usually-40-chars-long' When defined it is not received from cache anymore. Resolves: neos#3425
209032e
to
f3ab6f4
Compare
Okay, I interpreted 7.3 as lowest maintained branch. Is rebased!
No, you don't. Questions and discussions are absolutely fine 👍 |
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.
Ok, fine with me.
I requested review from a few people and have one last question (to those): In theory this must go into 8.4, as it is marked as a feature. But… is it? WDYT?
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.
Thank you for your PR. This makes sence. I left one comment to discuss.
I'd rather vote for 8.4 but also fine with sneaking it into 8.3.
@@ -98,6 +98,10 @@ Neos: | |||
|
|||
cryptography: | |||
|
|||
# A private, unique key used for encryption tasks. Normally 40 characters long and received from a persistent | |||
# filesystem cache. If set to a non-empty string, the cache is not involved anymore. | |||
encryptionKey: '' |
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.
Wouldn't it make sence to set this to null
instead? Would clearly say, that this property is not set.
encryptionKey: '' | |
encryptionKey: null |
With this the encryption key can be defined in a setting. When defined it is not received from cache anymore.
Ideally set this from an environment variable, so it doesn't have to be in your codebase…
Resolves: #3425
Upgrade instructions
None – but feel free to use the new feature. For existing projects, set the encryption key to the value found in the cache,
Data/Persistent/Cache/Data/Flow_Security_Cryptography_HashService/encryptionKey
usually.Review instructions
Set the new setting to a non-empty string and see that
\Neos\Flow\Security\Cryptography\HashService::generateHmac()
returns a Hmac generated with your new encryption key.Checklist
FEATURE|TASK|BUGFIX
Reviewer - Breaking Changes are marked with!!!
and have upgrade-instructions