-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for MFA for DB access #8270
Conversation
6c29961
to
eb23e3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some code org suggestions. Also, can we test this somehow? We can't probably test real 2fa in tests but at least the business logic of requiring 2nd factor we should be able to.
2b5fc7a
to
2a5053b
Compare
2a5053b
to
5e7931f
Compare
938f87f
to
a949398
Compare
// If the cert expiration time is less than 5s consider cert as expired and don't add | ||
// it to the user profile as an active database. | ||
if time.Until(cert.NotAfter) < 5*time.Second { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be fine but seems a little "arbitrary" TBH. What's the reasoning for this? Ideally, the comment should explain not "what" but "why".
@klizhentas Can I ask for UX changes review ?
So a user can just connect to a DB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bot.
What
Introduce MFA per db connection.
UX Changes:
require_session_mfa
tsh db connect databasename
right now will call under the hood thedatabaseLogin
function if db cert expired or if is missing. Thetsh db login databasenama
call is superflous if user wants to connect to the database using predefine db cli client binaries likepostgresBin
mysqlBin
tsh db ls
command.tsh login
command.