Open ieugen opened 8 months ago
Thanks Eugen, will try reply properly when I'm next doing batched work on Tempel 👍
Hi Eugen! Short response in the meantime since I'm currently juggling a few priorities-
You're must check both [given-password, given-mfa-token]
during log-in:
given-password
can be done as usual with Tempel (see the docs/demo/etc.).given-mfa-token
will depend on the particular MFA method you're using.With a typical TOTP (Time-Based One-Time Password), you'll have: expected-mfa-token = (fn [secret-mfa-key time])
.
How to store secret-mfa-key
?:
secret-mfa-key
inside user's encrypted dataSo checking [given-password given-mfa-token]
will mean:
given-password
by trying to decrypt user's data with Tempel.secret-mfa-token
. Check given-mfa-token
against secret-mfa-token
.Log user in iff both checks pass.
secret-mfa-key
outside user's encrypted dataSo checking [given-password given-mfa-token]
will mean:
given-password
by trying to decrypt user's data with Tempel.given-mfa-token
against secret-mfa-token
.Log user in iff both checks pass. You can check these in any order.
Option A is safer in that it protects secret-mfa-key
at rest, but option B should generally be sufficient and may be easier if you're integrating Tempel into a pre-existing system.
If your goal is to keep the user's application data fully encrypted at rest (and without any keys present on the system), then you'll need either:
Basically- if you want encryption at rest, then you need a secret from the service/user that you don't store but that the service/user can reliably provide.
I'm not sure off-hand which service/s might currently provide an appropriate (persistent) token, but the additional password choice would always work and provide wide compatibility.
That may be a reasonable choice if it's an opt-in for the user. I.e. user can opt-in to accepting the burden of keeping another password, in exchange for having their data encrypted at rest.
If the user forgets this password, they can use their service-level authentication to trigger an application-level password reset.
Hopefully the above makes sense? Please let me know if there's interest in:
Thank you for the detailed answer. I think this should end up in the documentation at some point.
+1 for adding HOTP/TOTP utils for Tempel. I think most implementations offer SHA1 TOTP by default but for security it should be SHA256 .
A different question (maybe another issue?). Have you considered the OWASP recommendations for password storage? Would it make sense to have an opinionated module that users can use and get Tempel with pre-configured options following OWASP recommendations ?
I know some people who do compliance find these certifications / recommendations very important.
I know they change over time so adding the year in the name would make it easy to check and switch: :owasp-2024-xxx
.
Thank you for the detailed answer. I think this should end up in the documentation at some point.
You're welcome. And will add in the next doc update before May/June's release 👍
A different question (maybe another issue?).
Yes, please do try to create separate issues for separate topics 👍 I've answered this question here.
Hi @ptaoussanis ,
I watched the demo https://www.youtube.com/watch?v=sULZVFhR848 and I quite like where the project is heading and that it provides a pretty good flow for solving common problems developers are facing when trying to adopt data encryption at rest.
I am curios how would tempel work with (more common IMO scenarios) of third party authentication systems - like OpenID Connect (SSO in general - social login).
I do imagine one option would be for users to setup a dedicated password for the keystore. Another things that could be addressed in the docs / future demos would be how tempel will handle multi factor authentication and WebAuthn or one time password systems.
The way I think about it right now it that users setup a dedicated password for the keystore that they have to enter after login. The password could be an OTP code perhaps ( a pin) ?! .
An example flow of using tempel with OTP would be great as I believe it's a common use case. As a side note I am doing DevOps and working with these ~ daily . SSO is quite important for auth and I would not go forward without it.
I did not give these too much thought but from the video I believe you have given security and encryption quite some thought. I hope you can share your ideas / examples around these subjects.
I am happy that I saw your demo now since I am working on a system where I need to store some JWT tokens encrypted at rest with the option of being able to decrypt them by admin. I hope to get some time to work with tempel on that soon.
p.s. Than you! for writing tempel !
Thanks, Eugen