Users and groups
About 595 words
Users and groups aren't Tailscale entities. The policy file's groups section comes from the catalog's own Groups and Users, so membership is kept in one place: if you sync Users and Groups into Backstage from your identity provider, the tailnet groups follow.
Make a Group a tailnet group
Annotate the Group with the tailnet group's name:
apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
name: tailnet-admins
annotations:
specht-labs.de/tailnet-group: group:admins
spec:
type: team
children: []The rendered file gets a group:admins entry. Its members are the Group's Users, the ones the catalog relates to it with hasMember (from each User's spec.memberOf). Only direct members count. A child Group's members aren't added to the parent.
Give each User a login
A member is rendered as their Tailscale login, which comes from an annotation on the User:
apiVersion: backstage.io/v1alpha1
kind: User
metadata:
name: alice
annotations:
specht-labs.de/tailnet-login: alice@github
spec:
profile:
displayName: Alice
memberOf: [tailnet-admins]A member without the annotation is an error: user:default/bob is in group:admins but has no specht-labs.de/tailnet-login annotation. The file then lists the User's entity reference in place of a login, which Tailscale won't match to anyone, so fix the annotation rather than ignoring the error.
Name people in rules
In any Tailscale entity, write people in one of these ways:
| You write | It renders as | Notes |
|---|---|---|
group:admins | group:admins | The Group annotated with group:admins. If no Group has that annotation, the Backstage Group named admins. |
group:ops/admins | that Group's tailnet name | A Group by entity reference, with a namespace. |
user:alice | alice@github | The User alice, which must have a login annotation. |
user:ops/alice | her login | A User by entity reference, with a namespace. |
alice@github | alice@github | A login as it is. If a User has it as their login, the console links to that User. |
An annotation wins over a name match: if one Group is annotated group:admins and another is just called admins, group:admins means the annotated one.
A Group without the annotation can still be used. group:platform resolves to the Backstage Group platform and renders as group:platform, with that Group's Users as members.
Which groups end up in the file
The groups section lists:
- every Group with the
specht-labs.de/tailnet-groupannotation, whether or not a rule uses it; - every other Group that a rule names.
The annotated Groups appear in every policy in the catalog. A group named only inside a capability's values (a grant's app, a node attribute's app) counts as used if a Group by that tailnet name exists.
The comment above each group is the Group's display name, title or name, in that order.
Users as sources and destinations
user:alice and alice@github can be sources or destinations of a grant, owners of a tag, and test sources. In tests, write user:alice as the source and the plugin renders it as her login.
On her User page, the Tailscale card shows what Alice reaches through her own login and through every tailnet group she's a member of.
When you check locally
backstage-tailscale-diff doesn't run the catalog. It rebuilds the relations itself, and for membership it reads only each User's spec.memberOf. If your Groups list their members in spec.members instead, the local render has empty groups while Backstage's doesn't.
