-
Notifications
You must be signed in to change notification settings - Fork 672
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
Keep hashed things tokens in the database #424
Comments
In order for this to happen, there are following things that need to be changed:
|
Hashing is one way encryption function that cannot be easily reversed. This is in contradiction with current API which can return plain thing key anytime. IMO we have two options:
I would like to hear other opinions regarding this @mainflux/contributors. |
Find appropriate solution with Vault (or similar) - it's a storage for keys and secrets. |
@drasko I like this idea of using Vault too. |
Needs more research and brainstorming, moving for |
Apart from this - I think we should separate thing I am saying this in light of the MQTT protocol, which indeed has an independent |
|
OK, then I guess it is just for us to decide do we encrypt, or we let user give us his key. I am more for the approach where we ecrypt, especially for the reasons that this way encryption key does not have to travel. So I would say that this issue would then consider:
|
I did something similar to this, do we want to encrypt or just hash? Would we need to retrieve that or just validate the hash? |
At this moment, I think we should encrypt, as I would expect that someone forgot/lost token written in the device flash and wants to retrieve it. If we just hash, then all we can do is reset, but this might be complicated for devices in the field - they would have to be re-flashed. But I might be wrong, and hash with reset might be the correct procedure. The rationale for this might be that if device "forgot" its token - there is something already wrong with the device's flash or firmware... @dborovcanin @nmarcetic what would be your opinions here? |
When you guys figure that out, let me know, I will have some time probably next week and I could work on this. |
@lpegoraro great, it would be highly appreciated. We'll let you know very soon. |
Hashing the thing key is not good for present Magistrala. Instead we can have like thing key encryption , So other users how have access to thing can able to view the thing key. For Initial implementation, we can have like common encryption secret for all the thing key in all domain. Challenges:If the encryption key changes , then we need to decrypt all the thing key with old encryption key and encrypt again with new key |
Sound good. I can get on with the implementation. |
Let's postpone this one. This is an important question and the decision will affect key components of the system. @drasko We will also require your help. |
FEATURE REQUEST
Things tokens are stored in a plaintext format in the things db.
Anyone with the read access to the database can see them.
I think they should be stored in a hashed format.
From security perspective, I think that this is a must have feature
The text was updated successfully, but these errors were encountered: