Destinations
About 617 words
Every name in a grant's dst is a destination, and the plugin sorts each one into a class. This guide shows how to read the classes and what to do about the warning you get for a device reached without a reason. Why destinations are classified explains the thinking behind it.
The classes
| Class | A destination is in it when | Warning |
|---|---|---|
| Service | it's a svc: name | only for * ports |
| peer mesh | some grant has it both as a source and as a destination | none |
| capability target | some grant to it carries app capabilities | only for * ports |
| autogroup | it's an autogroup: name | none |
| everything | it's * | none |
| device | none of the above | for a declared tag without a reason |
*, svc: and autogroup: names are classed by how they're written. For every other name, the peer mesh check comes before the capability check, so a tag that's both is a peer mesh.
The console's access map groups destinations by class, and backstage-tailscale-diff prints them:
Our tailnet: 20 entities, 10 parts, 81 lines
Services: svc:grafana, svc:payments
peer meshes: tag:batch
devices: tag:serverFix a device warning
A grant to a tag that is none of the other classes produces a warning on the tag entity:
tag:server is reached as a device, not a Service (tailscale:default/grant-admins-servers): move the traffic to a Service, or say why on its tag entity (specht-labs.de/tailnet-device-reason)You have two ways out.
Move the traffic to a Service
If the devices offer something specific on known ports, publish it as a Tailscale Service and grant the Service. Let the tagged devices host it with an auto approver:
spec:
type: autoApprovers
target: tailscale:my-tailnet
owner: group:platform
services:
svc:server-ui: [tag:server]Then point the grant at svc:server-ui in place of tag:server. Until you've moved the grant, the warning says which Services the tag already serves: …, though it serves svc:server-ui: move the traffic to a Service….
Say why the devices are reached directly
Some traffic has to go to the devices themselves: SSH-like access to every host, a backup server pulling from each machine, a monitoring agent scraped on each node. Write the reason on the tag entity:
apiVersion: specht-labs.de/v1alpha1
kind: Tailscale
metadata:
name: tag-server
title: Servers
annotations:
specht-labs.de/tailnet-device-reason: Backups pull from every server's own address.
spec:
type: tag
target: tailscale:my-tailnet
owner: group:platform
tag: tag:server
owners: [group:admins]The warning goes away and the destination stays in the device class. The access map stops marking the tag as a device without a reason, and the CLI prints the reason next to it: devices: tag:server (Backups pull from every server's own address.).
The warning only covers tags declared in the policy. A grant to an undeclared tag is already an error, and grants to hosts, addresses, users or groups are devices without a warning.
Name the ports
Two grants get a warning for ip: ['*']:
- a grant to a Service on every port:
reaches every port of svc:payments: name the ports. On some hosts a Service's address passes every port through to the device, not just those it serves; - a grant with
appcapabilities on every port:carries tailscale.com/cap/tsidp on every port: name the port the app listens on.
Replace * with the ports the Service or app uses, for example ip: [tcp:443].
A peer mesh on * (a tag reaching itself on every port) gets no warning.
