-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make it possible to use OC login credentials for external storage #12635
Comments
Note that there is already a magic variable "$user" which can be put into any configuration field and will be automatically replaced with the user name. Maybe a similar approach (even if it's done internally) could be used to replace the password. |
There are two problems. One is that not every storage uses a username and password, so this option cannot be available for all storage types. In addition, having yet another configuration option on storages is going to make the UI even more cluttered: see #9663. Then you have the problem of storage types that already, or at least should, support multiple authentication types (SFTP with password/key?) - how do you manage those? It quickly becomes clear that our current approach to the config UI is insufficient. |
Thanks for your input. But the part about having multiple auth types (key instead of password) will need to be kept in mind. Maybe not all backends will support using the credentials. For SFTP with password and one with key, I think this could be done now by registering two backends, one called "SFTP (password based)" and one calls "SFTP (key based)". But ideally storage backends might need to be decoupled from their auth. One idea would be to hav |
@PVince81 That sounds like a perfect solution, however I'd put 'Use login credentials' as a separate auth type, so there are no redundant username + password fields as we have at the moment. However, it would be registered as a sub-type of password auth, so a storage backend only needs to register itself for password auth to get both standard password auth and the modified login credentials auth. We still haven't worked out how to store the login credentials for sharing purposes though... |
Hmm yeah... fixing sharing was actually the main reason for this requirement. |
First requirement was to store password encrypted in |
Seems like this guy already tried introducing |
Just had a discussion with @icewind1991 and @schiesbn and we raised the idea of using an algorithm similar to the encryption app to encrypt the password. When user "user1" shares a mount point "SFTP" with users "user2" and "user3", the password is encrypted with the share keys of user1, user2 and user3 using "multikeyencrypt". (it is similar to when a file is shared with users "user2" and "user3" with the encryption app enabled). @LukasReschke what do you think ? |
The recovery key approach could also help, which gives the admin access to any file (or encrypted mount password in this specific case). |
In my opinion: Massive overkill without any real gain instead of making the code harder and potential introducing more funny bugs and unexpected behaviour again. The point here is: Against what do we want protect? - Let's just assume that as administrator you always get the password if you want to. Therefore you've nothing to hide from him. An initial encryption with a per-instance key is already a "sufficient" protection against looking at the file by mistake. Then we have a malicious attacker left which is somehow able to snoop on the file system - admittedly, that is a problem, but we can make this already harder by storing some additional parts of the encryption secret in the database. That would be trivially to implement with the new crypto wrapper. And once an attacker has already access to the database and the local filesystem you can be pretty sure that he anyways will be able to execute arbitrary code. (actually - he easily is able to once he can write into the DB) Do we really want to introduce some more magic that no user really can understand the reasoning behind only for the sake of having the password stored in an marginally better way? Supposedly, not storing the password at all would be the best solution but that would require the backend to support ticket-like systems (such as Kerberos). |
Yes, good arguments. Supporting ticket-like systems like Kerberos would fit well with the "alternative auth" concept. |
Closing in favor of #16305 |
The idea is that any storage backend can have an option "use OC login credentials" so it will use the current user's credentials instead of requiring the admin to specify any.
So far the SMB_OC external storage already does this. This approach/code should be make generic to allow any external storage to do so.
Since recently the password is already stored in the session in encrypted form (right, @LukasReschke ?)
Some comments from @LukasReschke here: #12216 (comment)
@nickvergessen @MTRichards @craigpg @karlitschek @Xenopathic
The text was updated successfully, but these errors were encountered: