If I read the ACL documentation correctly, I cannot reference a host in an ACLs block without creating an entry for it in Hosts.
So - I have to define all my hosts in the ACL file even though they are defined as a part of being on a tailnet?
"ACLs": [
// Match absolutely everything. Comment out this section if you want
// to define specific ACL restrictions.
{
"action": "accept",
"src": ["group:admin"],
"dst": ["*:*"],
},
{
"action": "accept",
"src": ["group:toptal"],
"dst": ["demo-com:5432"],
},
],
Unless I have demo-com defined, the ACL doesnât validate.
"Hosts": {
"demo-com": "100.72.9.83",
},
This seems counter intuitive to me. If a host is already on my tailnet, then I shouldnât have to define it in the ACL. Thatâs how I feel it should work, but no matter what I do, if I donât define the host, the ACL manager complains.
Do I need to script this out to pull out all the hosts, and add them Hosts section? This feels unnecessary, Iâd like to know if Iâm doing something wrong.
"ACLs": [
// Match absolutely everything. Comment out this section if you want
// to define specific ACL restrictions.
{
"action": "accept",
"src": ["group:admin"],
"dst": ["*:*"],
},
{
"action": "accept",
"src": ["group:toptal"],
"dst": ["demo-com.###.ts.net:5432"],
},
nope, I just tried testing it on mine, and it appears that it doesnât work. Iâll play around for a bit and if I get it to work, I will let you know.
I think the only way around this would be to use tags. But that could also get tedious depending on how many different tags you would need.
We use different tags to define our different groups (Sales, Tech Services, Operations, etc). Then we allow access based on tags. But if you have no logical separation like we do, it may not work for you the same as it does for us.
If itâs something you want to explore, I would be happy to help. In our case, we use subnet routers because we have a large network with way too many hosts to have Tailscale on everything. We allow access to certain subnets based on tags.
Yeah, I think youâre spot on with the ACL tagging strategy. I get the feeling this is the only way to handle it, without defining everything in the ACL markup.
I have security concerns though, it seems any client can assign themselves a tag with --advertise-tags. If you have a bad actor on your tailnet, they could assign themselves a tag that you donât want them to have. I could be thinking wrong here, but seems like itâs possible.
Thatâs a great idea, and very obvious. Iâm kinda disappointed in myself I didnât consider that. We are also looking to manage a slew of nodes, and it feels daunting to manage them all via this ACL markup. Setting up single network gateways would be much more manageable. Thanks for the tips!
This allows us to specify which subnets certain groups have by name. Some of the above definitions overlap, for example, the âexperience-centerâ subnet is within the âcorp-networkâ definition. This allows me to give certain tags unrestricted access to the entire 10.99.0.0/16 network, and other tags only access to the 10.99.1.0/24 networks.
I just tested this, and what I see is if someone tries to advertise tags that they are not authorized for, it will fail. The tag will actually be applied, however, the key will expire (even if itâs set to never expire). This is great, because then as an admin, I can see that someone tried, and take appropriate action (either approve it, or not). The user that tried will get a notice that authorization failed.