Skip to content

always require MFA when joining a session if at least one role requires session MFA#39602

Merged
capnspacehook merged 9 commits intomasterfrom
capnspacehook/mod-sessions-role-mfa
Mar 23, 2024
Merged

always require MFA when joining a session if at least one role requires session MFA#39602
capnspacehook merged 9 commits intomasterfrom
capnspacehook/mod-sessions-role-mfa

Conversation

@capnspacehook
Copy link
Copy Markdown
Contributor

@capnspacehook capnspacehook commented Mar 19, 2024

The OS login used when joining sessions is -teleport-internal-join which caused RBAC not to match the role where the require_session_mfa role option is set. Instead require MFA when the OS login is -teleport-internal-join and at least one role has the require_session_mfa role option set.

Previously reviewed here: https://github.com/gravitational/teleport-private/pull/1420

Fixes https://github.com/gravitational/teleport-private/issues/619.

Manual cases tested to ensure no regressions:

DB Access:
- MFA tap is required
Desktop Access:
- Attempting to start a session no keys registered shows an error message
- Attempting to start a session with a webauthn registered pops up the "Verify Your Identity" dialog
  - Hitting "Cancel" shows an error message
  - Hitting "Verify" causes your browser to prompt you for MFA
  - Cancelling that browser MFA prompt shows an error
  - Successful MFA verification allows you to connect
Server && Kubernetes Access:
- Starting a session requires MFA
- Joining a session requires MFA
- Moderators are required to periodically preform MFA tap

All tests were preformed with Auth require_session_mfa=true, as a user with a role that has require_session_mfa=true set, and with both Auth and the user's role requiring per-session MFA.

changelog: fix MFA checks not being prompted when joining a session

@capnspacehook capnspacehook added mfa Issues related to Multi Factor Authentication moderated-sessions backport/branch/v13 labels Mar 19, 2024
@github-actions github-actions Bot requested review from espadolini and lxea March 19, 2024 23:12
@capnspacehook capnspacehook requested review from rosstimothy and removed request for espadolini and lxea March 19, 2024 23:12
Copy link
Copy Markdown
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small question.

Comment thread lib/srv/authhandlers_test.go
@capnspacehook
Copy link
Copy Markdown
Contributor Author

capnspacehook commented Mar 22, 2024

Manual tests didn't show any breakage so I'll go ahead and merge this.

@capnspacehook capnspacehook enabled auto-merge March 22, 2024 21:27
@capnspacehook
Copy link
Copy Markdown
Contributor Author

@r0mant can I get a bypass for the flaky test detector, it's timing out

@r0mant
Copy link
Copy Markdown
Collaborator

r0mant commented Mar 22, 2024

/excludeflake *

@capnspacehook capnspacehook added this pull request to the merge queue Mar 23, 2024
Merged via the queue into master with commit 9a8e92a Mar 23, 2024
@capnspacehook capnspacehook deleted the capnspacehook/mod-sessions-role-mfa branch March 23, 2024 00:26
@public-teleport-github-review-bot
Copy link
Copy Markdown

@capnspacehook See the table below for backport results.

Branch Result
branch/v13 Failed
branch/v14 Failed
branch/v15 Failed

capnspacehook added a commit that referenced this pull request Mar 25, 2024
…es session MFA (#39602)

* extend role 'join_sessions' so MFA can be required at the role level when joining sessions

* add test cases

* update operator CRDs

* remove change to 'join_sessions', instead require MFA if any roles require it

* add comment

* address feedback

* add additional test cases

* add authhandler test

* fix role from test case not getting used in test
github-merge-queue Bot pushed a commit that referenced this pull request Mar 26, 2024
…es session MFA (#39602) (#39814)

* extend role 'join_sessions' so MFA can be required at the role level when joining sessions

* add test cases

* update operator CRDs

* remove change to 'join_sessions', instead require MFA if any roles require it

* add comment

* address feedback

* add additional test cases

* add authhandler test

* fix role from test case not getting used in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mfa Issues related to Multi Factor Authentication moderated-sessions size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants