You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this provider via GitHub actions to source control (almost) all configuration for a tailnet.
As a result, I need to
initially manually set up a federated identity for use by the provider with a set of "config write" privileged permissions.
this Terraform then creates another, lower privilege, federated identity for GHA workload federation (potentially via different repos/workflows). This identity only has auth_keys and device:core:read privileges for a given tag to support ephemeral device registration on the tailnet, similar to:
resource"tailscale_federated_identity""ephemeral_device_federated_identity" {
description="GitHub Actions Ephemeral Device Registration"scopes=["auth_keys", "devices:core:read"]
tags=["tag:ephemeral"]
issuer="https://token.actions.githubusercontent.com"subject="repo:my-org/my-repo:ref:refs/heads/master"# Only allow token to be generated off master
}
The problem here is a chicken-vs-egg type of problem on permissions and tag:ephemeral.
I only seem to be able to use the "privileged" federated identity to create/edit the "low privilege" federated identity with the auth_keys scope if the Terraform identity also has the auth_keys scope.
Creating/editing this scope seems to require the relevant tag tag:ephemeral to already exist
Tags are part of Access Controls, and my access controls are supposed to be "externally managed" by Terraform.
So now the tag is both "needs to be manually created" and "should be externally controlled" at the same time.
flowchart LR
D[Tailscale Terraform\nAccess Controls config creation]
E[Tailscale Terraform\nFederated Identity]
A[Tailscale low privilege\nEphemeral Device\nFederated Identity creation]
B[auth_keys scope]
C[tag:ephemeral created]
A -->|requires| B
A -->|requires| E
B -->|requires| C
C -->|requires| D
D -->|requires| E
E -->|requires| B
Loading
Perhaps this is just intrinsic to the permissions model and not specific to the provider; but I wonder if there are scopes/techniques available to break the circular dependency on creation of the tag:ephemeral tag here while still using two different federated identities.
tailscale_federated_identity.ephemeral_device_federated_identity: Modifying... [id=***]
╷
│ Error: Failed to update federated identity
│
│ with tailscale_federated_identity.ephemeral_device_federated_identity,
│ on tailscale.tf line 55, in resource "tailscale_federated_identity" "ephemeral_device_federated_identity":
│ 55: resource "tailscale_federated_identity" "ephemeral_device_federated_identity" {
│
│ actor cannot set scopes: [auth_keys devices:core:read] (403)
╵
Ideally if intending to use Terraform to manage ones ACLs, and other federated identities - it'd be better to not have this circular dependency on tag creation via the auth_keys scope ... somehow. Is there a way?
I use this provider via GitHub actions to source control (almost) all configuration for a tailnet.
As a result, I need to
auth_keysanddevice:core:readprivileges for a given tag to support ephemeral device registration on the tailnet, similar to:The problem here is a chicken-vs-egg type of problem on permissions and
tag:ephemeral.auth_keysscope if the Terraform identity also has theauth_keysscope.tag:ephemeralto already existPerhaps this is just intrinsic to the permissions model and not specific to the provider; but I wonder if there are scopes/techniques available to break the circular dependency on creation of the
tag:ephemeraltag here while still using two different federated identities.Ideally if intending to use Terraform to manage ones ACLs, and other federated identities - it'd be better to not have this circular dependency on
tagcreation via theauth_keysscope ... somehow. Is there a way?