@@ -4,20 +4,30 @@ resource "tailscale_acl" "acl" {
4
4
"tagOwners": {
5
5
"${ local . tags . server } ": [], // Not used for any ACL yet
6
6
"${ local . tags . initrd } ": [],
7
- "${ local . tags . ssh } ": []
7
+ "${ local . tags . ssh } ": [],
8
+ "${ local . tags . router } ": [],
9
+ "${ local . tags . subnet } ": []
8
10
},
9
- "acls ": [
11
+ "grants ": [
10
12
{
11
13
// Allow all members to connect to any node
12
- "action": "accept",
13
- "src": [
14
- "autogroup:member"
15
- ],
16
- "dst": [
17
- "*:*"
18
- ]
14
+ "src": [ "autogroup:member" ],
15
+ "dst": [ "*" ],
16
+ "ip": [ "*" ]
19
17
},
18
+ {
19
+ // Allow routers to connect to any node
20
+ "src": [ "${ local . tags . router } " ],
21
+ "dst": [ "*" ],
22
+ "ip": [ "*" ]
23
+ }
20
24
],
25
+ "autoApprovers": {
26
+ "exitNode": [ "tag:router" ],
27
+ "routes": {
28
+ "192.168.0.0/16": [ "tag:subnet" ]
29
+ }
30
+ },
21
31
"ssh": [
22
32
{
23
33
"action": "accept",
@@ -50,7 +60,17 @@ resource "tailscale_acl" "acl" {
50
60
"${ local . tags . initrd } :2222",
51
61
"100.113.5.10:80"
52
62
]
53
- }
63
+ },
64
+ {
65
+ // A router also should be able to access any node
66
+ "src": "${ local . tags . router } ",
67
+ "allow": [
68
+ "${ local . tags . initrd } :2222",
69
+ "${ local . tags . ssh } :22",
70
+ "${ local . tags . router } :443",
71
+ "100.113.5.10:80"
72
+ ]
73
+ },
54
74
],
55
75
"sshTests": [
56
76
{
0 commit comments