[Bug 33934] New: 'No encryption_key in koha-conf.xml' needs more detail
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Bug ID: 33934 Summary: 'No encryption_key in koha-conf.xml' needs more detail Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org If encryption_key is not set in $KOHA_CONF we are raising an exception. This key was only needed for a couple of feature, but now we are using Koha::Encryption from the update DB process, and so the upgrade fails with no more info than 'No encryption_key in koha-conf.xml'. We need to provide more detail in this error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |28998 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28998 [Bug 28998] Encrypt borrowers.secret -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30649 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- https://lists.katipo.co.nz/pipermail/koha/2023-June/059566.html https://lists.katipo.co.nz/pipermail/koha/2023-June/059581.html Additionally the following answer can be very confusing: """ I added the lines: <!-- Encryption key for crypted password or sensitive data --> <encryption_key>__ENCRYPTION_KEY__</encryption_key> The update went through without a problem. """ https://lists.katipo.co.nz/pipermail/koha/2023-June/059582.html We must reject "__ENCRYPTION_KEY__", just in case... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 152074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152074&action=edit Bug 33934: Add more detail to 'No encryption_key in koha-conf.xml' If encryption_key is not set in $KOHA_CONF we are raising an exception. This key was only needed for a couple of feature, but now we are using Koha::Encryption from the update DB process, and so the upgrade fails with no more info than 'No encryption_key in koha-conf.xml'. We need to provide more detail in this error. Additionally we reject "__ENCRYPTION_KEY__", in case people will simple copy/paste that Test plan: Apply the patch Edit $KOHA_CONf, remove the encryption_key entry (or blank) restart_all Go to the about page and enable 2FA => warning on the about page, and 500 server-side are displaying more info about how to generate the missing entry Edit $KOHA_CONF and set the value to __ENCRYPTION_KEY__ restart_all => Same messages Edit $KOHA_CONF and set a correct value restart_all => No error, everything is working correctly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152074|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 152075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152075&action=edit Bug 33934: Add more detail to 'No encryption_key in koha-conf.xml' If encryption_key is not set in $KOHA_CONF we are raising an exception. This key was only needed for a couple of feature, but now we are using Koha::Encryption from the update DB process, and so the upgrade fails with no more info than 'No encryption_key in koha-conf.xml'. We need to provide more detail in this error. Additionally we reject "__ENCRYPTION_KEY__", in case people will simple copy/paste that Test plan: Apply the patch Edit $KOHA_CONf, remove the encryption_key entry (or blank) restart_all Go to the about page and enable 2FA => warning on the about page, and 500 server-side are displaying more info about how to generate the missing entry Edit $KOHA_CONF and set the value to __ENCRYPTION_KEY__ restart_all => Same messages Edit $KOHA_CONF and set a correct value restart_all => No error, everything is working correctly Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This fixes an issue that release notes| |can cause upgrades to Koha | |23.05 to fail with an error | |message that includes 'No | |encryption_key in | |koha-conf.xml'. It also | |requires the configuration | |entry in the instance | |koha-conf.xml to be | |something other than | |__ENCRYPTION_KEY__, for | |example: | |<encryption_key>mY$ecret%ey | |</encryption_key>. (It is | |recommended that the key is | |generated using pwgen 32) --- Comment #4 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. After removing the <encryption_key> entry in /etc/koha/sites/kohadev/koha-conf.xml and restarting, there is: - a warning in About Koha > System information about the encryption key missing - after enabling the TwoFactorAuthentication system preference, got to 'Manage two-factor authentication' for the koha user - you should get an error message pop up when trying to set up 2FA 2. If you try to add <encryption_key>__ENCRYPTION_KEY__</encryption_key> you will also get the warning and error message. 3. Changing __ENCRYPTION_KEY__ to something else will remove the warning and let you set up 2FA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152075|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 152076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152076&action=edit Bug 33934: Add more detail to 'No encryption_key in koha-conf.xml' If encryption_key is not set in $KOHA_CONF we are raising an exception. This key was only needed for a couple of feature, but now we are using Koha::Encryption from the update DB process, and so the upgrade fails with no more info than 'No encryption_key in koha-conf.xml'. We need to provide more detail in this error. Additionally we reject "__ENCRYPTION_KEY__", in case people will simple copy/paste that Test plan: Apply the patch Edit $KOHA_CONf, remove the encryption_key entry (or blank) restart_all Go to the about page and enable 2FA => warning on the about page, and 500 server-side are displaying more info about how to generate the missing entry Edit $KOHA_CONF and set the value to __ENCRYPTION_KEY__ restart_all => Same messages Edit $KOHA_CONF and set a correct value restart_all => No error, everything is working correctly Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- All working as described. Did we work out a better way to accomplish the DB update that was causing issues? Anyway, this can go PQA as is.. scripts happy, works clearly. Passing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This fixes an issue that |This fixes an issue that release notes|can cause upgrades to Koha |can cause upgrades to Koha |23.05 to fail with an error |23.05 to fail with an error |message that includes 'No |message that includes 'No |encryption_key in |encryption_key in |koha-conf.xml'. It also |koha-conf.xml'. It also |requires the configuration |requires the configuration |entry in the instance |entry in the instance |koha-conf.xml to be |koha-conf.xml to be |something other than |something other than |__ENCRYPTION_KEY__, for |__ENCRYPTION_KEY__. |example: |It is |<encryption_key>mY$ecret%ey |recommended that the key is |</encryption_key>. (It is |generated using pwgen 32 |recommended that the key is | |generated using pwgen 32) | --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Removing the example from the release notes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Martin Renvoize from comment #6)
All working as described. Did we work out a better way to accomplish the DB update that was causing issues?
See bug 30649 comment 35. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Very useful change 👍 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |matt.blenkinsop@ptfs-europe | |.com Version(s)|23.11.00 |23.11.00,23.05.01 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.11.00,23.05.01 |23.11.00,23.05.01,22.11.07 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #11 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31059 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 bugzilla@mediapipe.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@mediapipe.de --- Comment #12 from bugzilla@mediapipe.de --- After an upgrade to 23.05.01 I added <encryption_key>ohyienahm7Yofaxangie0pheingie9fo</encryption_key> to my koha-conf.xml under the bcrypt_settings. I restarted apache2 and memcached but it keeps showing me the error message that there is ‘No encryption_key in koha-conf.xml’. The key above is an example. Is it important where I place the encryption_key in the file? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to bugzilla from comment #12)
After an upgrade to 23.05.01 I added <encryption_key>ohyienahm7Yofaxangie0pheingie9fo</encryption_key> to my koha-conf.xml under the bcrypt_settings. I restarted apache2 and memcached but it keeps showing me the error message that there is ‘No encryption_key in koha-conf.xml’. The key above is an example. Is it important where I place the encryption_key in the file?
Try restarting Plack please too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Please keep in mind that this key shall not be shared! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- For purists, taken from Crypt::CBC -pass,-key The encryption/decryption passphrase. These arguments are interchangeable, but -pass is preferred ("key" is a misnomer, as it is not the literal encryption key). So our "encryption key" is a misnnomer too :) It is a passphrase used to generate the real encryption key. We say now: We recommend one of at least 32 bytes. It should be formally at least 16 bytes (AES blocksize) in order to be safe. So 32 is fine. Shouid we enforce a minimum length in Koha::Encryption? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33934 --- Comment #16 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #15)
For purists, taken from Crypt::CBC
-pass,-key The encryption/decryption passphrase. These arguments are interchangeable, but -pass is preferred ("key" is a misnomer, as it is not the literal encryption key).
So our "encryption key" is a misnnomer too :) It is a passphrase used to generate the real encryption key.
That's true although I think colloquially it's all right to call it the encryption key.
We say now: We recommend one of at least 32 bytes. It should be formally at least 16 bytes (AES blocksize) in order to be safe. So 32 is fine. Shouid we enforce a minimum length in Koha::Encryption?
Probably a good idea. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org