tctl auth sign --format=db
doesn't work via proxy
#6937
Labels
bug
c-ar
Internal Customer Reference
cloud
Cloud
database-access
Database access related issues and PRs
Description
When trying to sign database certificate (for configuring self-hosted database) by invoking
tctl auth sign
remotely (which is the case of Teleport Cloud) users get this error:The impersonation feature fixed this issue for issuing user certs, but generating a database certificate (i.e. certificate you configure your onprem Postgres/MySQL instance with) follows a different path:
https://github.com/gravitational/teleport/blob/v7.0.0-dev.9/lib/auth/auth_with_roles.go#L2549-L2556.
Instead of hardcoding built-in roles
RoleDatabase
andRoleAdmin
to be able to call this API, we can change this to a resource-based approach and check if the caller's identity has "create" permissions fordb_server
resource which would mean they can generate the cert as well.The change should be fully backwards compatible since both "admin" and "database" built-in roles already have create permission for database servers.
The text was updated successfully, but these errors were encountered: