Skip to content
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

Require admin MFA for get/list CAs with secrets #38529

Merged
merged 7 commits into from Feb 29, 2024

Conversation

Joerger
Copy link
Contributor

@Joerger Joerger commented Feb 22, 2024

Changelog: When teleport is configured to require MFA for admin actions, MFA is required to get certificate authority secrets. Ex: tctl auth export --keys or tctl get cert_authority/host/root.example.com --with-secrets.

Note: this also impact tctl edit cert_authority. With this PR, MFA will be prompted before and after the edit. The first prompt is to retrieve the secret, and the second is to update.

@rosstimothy
Copy link
Contributor

I wasn't able to retrieve CAs with secrets while testing this.

./build/tctl -d get cert_authority/host/local.dev --with-secrets
ERROR REPORT:
Original Error: *interceptors.RemoteError access denied to perform action "read" on "cert_authority"
Stack Trace:
	github.com/gravitational/teleport/api@v0.0.0/client/client.go:4297 github.com/gravitational/teleport/api/client.(*Client).GetCertAuthority
	github.com/gravitational/teleport/lib/auth/clt.go:242 github.com/gravitational/teleport/lib/auth.(*Client).GetCertAuthority
	github.com/gravitational/teleport/tool/tctl/common/resource_command.go:1821 github.com/gravitational/teleport/tool/tctl/common.(*ResourceCommand).getCollection
	github.com/gravitational/teleport/tool/tctl/common/resource_command.go:241 github.com/gravitational/teleport/tool/tctl/common.(*ResourceCommand).Get
	github.com/gravitational/teleport/tool/tctl/common/resource_command.go:205 github.com/gravitational/teleport/tool/tctl/common.(*ResourceCommand).TryRun
	github.com/gravitational/teleport/tool/tctl/common/tctl.go:245 github.com/gravitational/teleport/tool/tctl/common.TryRun
	github.com/gravitational/teleport/tool/tctl/common/tctl.go:105 github.com/gravitational/teleport/tool/tctl/common.Run
	github.com/gravitational/teleport/tool/tctl/main.go:29 main.main
	runtime/proc.go:271 runtime.main
	runtime/asm_arm64.s:1222 runtime.goexit
User Message: access denied to perform action "read" on "cert_authority"

@Joerger Joerger force-pushed the joerger/require-admin-mfa-for-ca-secrets branch from 67e154b to 3d9be98 Compare February 28, 2024 17:57
@smallinsky smallinsky self-requested a review February 28, 2024 19:04
@Joerger
Copy link
Contributor Author

Joerger commented Feb 28, 2024

I wasn't able to retrieve CAs with secrets while testing this.

./build/tctl -d get cert_authority/host/local.dev --with-secrets
ERROR REPORT:
Original Error: *interceptors.RemoteError access denied to perform action "read" on "cert_authority"
Stack Trace:
	github.com/gravitational/teleport/api@v0.0.0/client/client.go:4297 github.com/gravitational/teleport/api/client.(*Client).GetCertAuthority
	github.com/gravitational/teleport/lib/auth/clt.go:242 github.com/gravitational/teleport/lib/auth.(*Client).GetCertAuthority
	github.com/gravitational/teleport/tool/tctl/common/resource_command.go:1821 github.com/gravitational/teleport/tool/tctl/common.(*ResourceCommand).getCollection
	github.com/gravitational/teleport/tool/tctl/common/resource_command.go:241 github.com/gravitational/teleport/tool/tctl/common.(*ResourceCommand).Get
	github.com/gravitational/teleport/tool/tctl/common/resource_command.go:205 github.com/gravitational/teleport/tool/tctl/common.(*ResourceCommand).TryRun
	github.com/gravitational/teleport/tool/tctl/common/tctl.go:245 github.com/gravitational/teleport/tool/tctl/common.TryRun
	github.com/gravitational/teleport/tool/tctl/common/tctl.go:105 github.com/gravitational/teleport/tool/tctl/common.Run
	github.com/gravitational/teleport/tool/tctl/main.go:29 main.main
	runtime/proc.go:271 runtime.main
	runtime/asm_arm64.s:1222 runtime.goexit
User Message: access denied to perform action "read" on "cert_authority"

As discussed offline this is an expected RBAC denial given your roles

@Joerger Joerger added this pull request to the merge queue Feb 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 29, 2024
@Joerger Joerger added this pull request to the merge queue Feb 29, 2024
Merged via the queue into master with commit b01f2c3 Feb 29, 2024
34 checks passed
@Joerger Joerger deleted the joerger/require-admin-mfa-for-ca-secrets branch February 29, 2024 01:46
@public-teleport-github-review-bot

@Joerger See the table below for backport results.

Branch Result
branch/v15 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v15 size/sm tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants