Skip to content

Support resource label filtering in role where clauses for lock and workload_identity resources #69553

Description

@andrew-h-teleport

What would you like Teleport to do?
Allow teleport roles to restrict actions (read, list, create, update, delete) on lock and workload_identity resources using metadata label conditions in a role's where clause. For example:
where: equals(resource.metadata.labels["key"], "value")

(I suspect this limitation applies to other resource types too.)

What problem does this solve?
Allows admins to apply more granular access to resources.

If a workaround exists, please include it.
No real workaround beyond being selective and using the where clause where it is supported. Grant un-scoped access for lock and workload_identity resources while applying resource-label filtering to supported resources like user and bot:

kind: role
version: v7
metadata:
  name: example
spec:
  allow:
    rules:
      # Resource-label filtering works for user and bot
      - resources: [user, bot]
        verbs: [read, list, create, update, delete]
        where: equals(resource.metadata.labels["key"], "value")
      # Unscoped permissions currently required for lock and workload identity
      - resources: [workload_identity, lock]
        verbs: [read, list, create, update, delete]

Metadata

Metadata

Assignees

No one assigned

    Labels

    c-vaInternal Customer Referencefeature-requestUsed for new features in Teleport, improvements to current should be #enhancements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions