Why destinations are classified
About 620 words
A grant's destination can name a thing or a set of machines. svc:payments names a Tailscale Service: whatever hosts it, clients reach it at the Service's address, on the ports the Service offers. tag:server names every device that carries the tag, now and later, each at its own address.
The plugin takes the view that a Service is what a destination should be, and that reaching devices directly needs a reason. It sorts every destination into a class so the reasons are visible, and warns about the destinations that have none.
A grant to a tag says less than it seems
A grant from group:admins to tag:server on tcp:443 reads like "admins use the server's web UI". What it allows is wider: port 443 on every device that has the tag, including the ones that get it next year for some other purpose. Nothing in the grant records which program on port 443 it was meant for.
A grant to a Service records it. svc:server-ui stands for one thing, the auto approvers say which devices may host it, and the hosts can change without touching the grant. When the catalog annotates an API with specht-labs.de/tailnet-dst: svc:…, the grant even says which API it's for.
Devices with a reason
Some traffic has to reach devices at their own address, and the plugin recognises the common cases without being told:
- Peer mesh. A destination that the same grant also has as a source, such as a tag that reaches itself: every member reaches every other member at its own address. Cluster nodes, replicas talking to each other and build runners sharing a cache work this way. There's no single thing to put behind a Service.
- Capability target. A destination that a grant with
appcapabilities reaches. An app that reads the capabilities Tailscale passes it (an identity provider, a proxy that checks who's calling) matches them on its own address, so the grant has to reach that device. - Autogroup.
autogroup:internet,autogroup:selfand the like are defined by Tailscale and are what they are. - Everything.
*as a destination is a break-glass grant. It isn't meant to be precise.
For anything else, write the reason on the tag entity with specht-labs.de/tailnet-device-reason. The destination stays a device, but it's a device someone thought about. The warning is there for the grants nobody thought about.
Every port of a Service
A grant to a Service on * gets its own warning, even though the Service only offers some ports. On some hosts a Service's address passes every port through to the device, not only the ports the Service serves, so * can reach more than the Service. Name the ports, and the grant means the same everywhere.
backstage-tailscale-diff reads * to a Service as the ports the catalog's APIs list for it, so replacing * with those ports shows no difference there.
Capabilities on every port
A grant with app capabilities on * gets a warning for the same kind of reason. The capabilities are for one app, listening on one port, but the grant also opens every other port of the destination. Naming the app's port keeps the grant to what the capabilities are for.
The console's view
The access map groups destinations by class: Services, peer meshes, capability targets, autogroups, devices, everything. A device tag without a reason is marked, so you can see at a glance how much of the tailnet is reached by name and how much by machine.
