ACLs in depth
Patterns that age well. Five rules of thumb you can apply to any tailnet, plus a worked example.
1Rule of thumb #1: tag your servers, never your users
Users (humans) are identities; they should appear in groups. Servers are roles; they should appear as tag:. ACLs reference user groups as sources and tag-bound servers as destinations.
This keeps rules stable. If you replace your home server, you re-tag the new one and ACLs continue to work without edits.
2Rule of thumb #2: IoT devices have no outbound
A tagged IoT device should never have a rule with "src": ["tag:iot"]. They should be reachable from your phone or server (so you can control them), but they shouldn't initiate connections to anything.
This is your defense against compromise. A pwned doorbell can't pivot to your laptop if no rule allows it to.
3Rule of thumb #3: least-privilege per port, not per host
Wide rule: "dst": ["tag:server:*"]. Narrow rule: "dst": ["tag:server:22", "tag:server:443"]. Use the narrow form whenever practical — it limits what a compromised user account can pivot to.
4Rule of thumb #4: separate guests from family from servers
Even tiny tailnets benefit from groups. A "guest" group with media-only access keeps your friend's lent laptop from poking at your home server. Three groups (adults, kid, guests) covers most home setups.
5Rule of thumb #5: write the test cases
Tailscale lets you write ACL tests in the same policy file:
"tests": [
{ "src": "alice@home", "accept": ["tag:server:22"], "deny": ["tag:iot:80"] },
{ "src": "guest@friends", "accept": ["tag:media:*"], "deny": ["tag:server:*"] }
]
The admin console runs these on every save. They prevent you from breaking things by accident — the policy refuses to save if a test fails.
6A worked example: family + guest tailnet
{
"groups": {
"group:adults": ["alice@home", "bob@home"],
"group:kid": ["kid@home"],
"group:guests": ["guest@friends"]
},
"tagOwners": {
"tag:server": ["group:adults"],
"tag:media": ["group:adults"],
"tag:ai": ["group:adults"],
"tag:iot": ["group:adults"]
},
"acls": [
// Adults: full access. Kept simple because they're trusted.
{ "action": "accept", "src": ["group:adults"], "dst": ["*:*"] },
// Kid: media + IoT control, no servers, no AI.
{ "action": "accept", "src": ["group:kid"], "dst": ["tag:media:*", "tag:iot:*"] },
// Guests: media only.
{ "action": "accept", "src": ["group:guests"], "dst": ["tag:media:*"] },
// Servers can reach the AI rig (e.g. for inference). One-way.
{ "action": "accept", "src": ["tag:server"], "dst": ["tag:ai:*"] }
// Notice: no rule with src=tag:iot. IoT can't initiate anything.
],
"tests": [
{ "src": "alice@home", "accept": ["tag:server:*", "tag:media:*", "tag:iot:*"] },
{ "src": "kid@home", "accept": ["tag:media:*"], "deny": ["tag:server:*"] },
{ "src": "guest@friends", "accept": ["tag:media:*"], "deny": ["tag:server:*", "tag:iot:*"] }
]
}
Open the ACL sandbox, paste this in, see the matrix.