Properly clean up configkey values from oc_appconfig table when disabling encryption#35980
Properly clean up configkey values from oc_appconfig table when disabling encryption#35980
configkey values from oc_appconfig table when disabling encryption#35980Conversation
Codecov Report
@@ Coverage Diff @@
## master #35980 +/- ##
=========================================
Coverage 64.75% 64.75%
- Complexity 19408 19409 +1
=========================================
Files 1285 1285
Lines 75830 75845 +15
Branches 1336 1336
=========================================
+ Hits 49101 49116 +15
Misses 26335 26335
Partials 394 394
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
9f355e9 to
223f482
Compare
223f482 to
4fb37ec
Compare
|
I'm wondering if we should decrypt the files. What could happen if there are encrypted files and we disable the encryption? What happen to those files if we enable encryption (either master key or user key) afterwards? I guess that we can't decrypt the files ouselves before disabling encryption, but if there is any risk we should at least warn the admin. |
|
Lets say if admin disables encryption before decrypting the file(s), the admin always have the chance to recover the files, if he/she knows what type of encryption was used.
At this point the files which are encrypted cannot be decrypted. Because the encryption is disabled. Now to recover the encrypted files, admin has to enable encryption and select the type of encryption which was used. In this example user-key encryption. And login to the respective user(s), the encrypted files will be decrypted if user tries to download them. If the admin attemtps for masterkey then previously encrypted files will not be decrypted. All I see is the admin should be aware of previously used encryption here. |
|
Maybe we should call to PM to decide what to do, mainly because the admin will reenable encryption with the wrong type (or we should assume so).
|
|
My 2 cents: do not allow disabling encryption if we notice there are still encrypted files in FS. This way we are 100% on the safe side. And this can easily be achieved by querying the filecache for files having the If we do not want to consider this option, the alternative should be to allow disable but throw a warning when trying to disable encryption. |
|
@micbar there is no response here to your ping on Oct 21. |
|
@cdamken @pmaier1 may we have your thoughts on this, please? My idea on this at #35980 (comment) |
|
This is not making any progress. |
I would add that and finalize this PR. Then this can be reviewed and merged. |
|
@phil-davis this needs a PM decision and already pinged several times #35980 (comment) |
4fb37ec to
7be8ac7
Compare
2e80810 to
a59779e
Compare
|
@pako81 does the current state match your proposal in #35980 (comment) ? |
|
@VicDeo yes, looks fine from my POV - thx |
a59779e to
65a5021
Compare
|
Just to double-check, did you test running the command without encryption? I think |
65a5021 to
dbfb761
Compare
true. I explicitly casted the result to boolean. Is it better now? |
…pconfig table when disabling encryption Signed-off-by: Sujith H <sharidasan@owncloud.com>
dbfb761 to
c7823aa
Compare
|
No idea about the failures:
https://hub.docker.com/r/owncloudci/core/tags |
|
I restarted drone - it's having a bad day. |
Follow-up of #35756 because of changes in the branching model.
Description
Currently, we have the problem that we do not correctly clean up the configkey values in the oc_appconfig table when disabling encryption.
Specifically the useMasterKey key for the encryption app, which stays set to 1. This seems to lead to the encryption_enabled key for core to remain set to no so when trying to reenable the encryption app and running encryption:select-encryption-type masterkey, this will fail.
The same has been observed for user-keys encryption. This PR fixes this behavior by properly cleaning up the configkey values and making re-enabling of encryption possible.
Related Issue
How Has This Been Tested?
Manually by first activating encryption by running:
occ app:enable encryption,occ encryption:enable,occ encryption:select-encryption-type masterkey -yandencryption:encrypt-allThen disable it with
occ app:disable encryption,occ encryption:disableRe-enabling encryption once again and check that when running
occ encryption:select-encryption-type masterkey, no error is triggered.Tested the same with user-keys encryption.
Types of changes
Checklist: