[Bug] <title>ACL does not work with exit node #796

Closed
opened 2025-12-29 02:24:09 +01:00 by adam · 2 comments
Owner

Originally created by @salamdamai on GitHub (Sep 19, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have this ACL:

{

"groups": {

"group:internal": ["david@example.com"],

"group:external": ["susan@example.com"]

},

"acls": [

{

"action": "accept",

"src": ["group:internal"],

"dst": ["group:internal:*",

"group:external:*"]

},

{

"action": "accept",

"src": ["group:external"],

"dst": ["group:external:*",

"100.64.0.9/32:80,443"]

}

]

}

"100.64.0.9" is an exit node. I only want to use this exit node for browsing purpose. My iphone is part of the group:external. When I use this server as an exit node, I am not able to browse the net. But if I change it to:

"0.0.0.0/0:*"

or

"100.64.0.9/0:*"

I am able to browse the internet. But the down side is that I can ssh from my iphone into that exit node, which I do not want. How do I solve this dillema? Even worse, I can ssh to other headscale cliets that are defined in group:internal. So definitely "100.64.0.9/0:*" should never be tried.

Expected Behavior

I expect, the exit nodes can be used for sepecific ports, e.g., 80 and 443 for browsing purpose but should not allow me to ssh into it.

Steps To Reproduce

Copy paste the above ACL into a file. e.g., acl_policy.json.

In config.yaml, find the section:

policy:
mode: file
path: "/etc/headscale/acl_policy.json"

restart the headscale-docker.

Environment

- OS: The exit node and the headscale servers are debian bookworm
- Headscale version:0.23.0
- Tailscale version:1.74.0

Runtime environment

  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

Anything else?

No response

Originally created by @salamdamai on GitHub (Sep 19, 2024). ### Is this a support request? - [X] This is not a support request ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior I have this ACL: { "groups": { "group:internal": ["[david@example.com](mailto:david@example.com)"], "group:external": ["[susan@example.com](mailto:susan@example.com)"] }, "acls": [ { "action": "accept", "src": ["group:internal"], "dst": ["group:internal:*", "group:external:*"] }, { "action": "accept", "src": ["group:external"], "dst": ["group:external:*", "100.64.0.9/32:80,443"] } ] } "100.64.0.9" is an exit node. I only want to use this exit node for browsing purpose. My iphone is part of the group:external. When I use this server as an exit node, I am not able to browse the net. But if I change it to: "0.0.0.0/0:*" or "100.64.0.9/0:*" I am able to browse the internet. But the down side is that I can ssh from my iphone into that exit node, which I do not want. How do I solve this dillema? Even worse, I can ssh to other headscale cliets that are defined in group:internal. So definitely "100.64.0.9/0:*" should never be tried. ### Expected Behavior I expect, the exit nodes can be used for sepecific ports, e.g., 80 and 443 for browsing purpose but should not allow me to ssh into it. ### Steps To Reproduce Copy paste the above ACL into a file. e.g., acl_policy.json. In config.yaml, find the section: policy: mode: file path: "/etc/headscale/acl_policy.json" restart the headscale-docker. ### Environment ```markdown - OS: The exit node and the headscale servers are debian bookworm - Headscale version:0.23.0 - Tailscale version:1.74.0 ``` ### Runtime environment - [X] Headscale is behind a (reverse) proxy - [X] Headscale runs in a container ### Anything else? _No response_
adam added the bug label 2025-12-29 02:24:09 +01:00
adam closed this issue 2025-12-29 02:24:09 +01:00
Author
Owner

@ChibangLW commented on GitHub (Sep 19, 2024):

Please use proper formatting for your json.

{
    "groups": {
        "group:internal": [
            "[david@example.com](mailto:david@example.com)"
        ],
        "group:external": [
            "[susan@example.com](mailto:susan@example.com)"
        ]
    },
    "acls": [
        {
            "action": "accept",
            "src": [
                "group:internal"
            ],
            "dst": [
                "group:internal:*",
                "group:external:*"
            ]
        },
        {
            "action": "accept",
            "src": [
                "group:external"
            ],
            "dst": [
                "group:external:*",
                "100.64.0.9/32:80,443"
            ]
        }
    ]
}

This is more of a support request than a bug. If you tag your exit node with, e.g. tag:exit you could use following rule to get your desired behavior. I tested this only with v0.22, so no guaranties it works with latest v0.23. The port 0 on the tag is the important bit.

{
    "action": "accept",
    "src": [
        "group:external"
    ],
    "dst": [
        "tag:exit:0",
        "0.0.0.0/0:*"
    ]
}
@ChibangLW commented on GitHub (Sep 19, 2024): Please use proper formatting for your json. ```json { "groups": { "group:internal": [ "[david@example.com](mailto:david@example.com)" ], "group:external": [ "[susan@example.com](mailto:susan@example.com)" ] }, "acls": [ { "action": "accept", "src": [ "group:internal" ], "dst": [ "group:internal:*", "group:external:*" ] }, { "action": "accept", "src": [ "group:external" ], "dst": [ "group:external:*", "100.64.0.9/32:80,443" ] } ] } ``` This is more of a support request than a bug. If you tag your exit node with, e.g. `tag:exit` you could use following rule to get your desired behavior. I tested this only with v0.22, so no guaranties it works with latest v0.23. The port `0` on the tag is the important bit. ```json { "action": "accept", "src": [ "group:external" ], "dst": [ "tag:exit:0", "0.0.0.0/0:*" ] } ```
Author
Owner

@salamdamai commented on GitHub (Sep 20, 2024):

Hi
you may close this. I will rewrite my ACL in that format. I tested 0.23.0 with autogroup:internet. It resolves the issue. I did not know that it was a bug. I reached out the discord. I thought this was a limitation or a bug. But finally someone suggested to use autogroup"internet to resolve this issue. You may close this. I just dont know if something is a support issue or a bug. After I did not part to search the internet and discord, I decided submitting this as a bug was the only way to go. Thank you.

@salamdamai commented on GitHub (Sep 20, 2024): Hi you may close this. I will rewrite my ACL in that format. I tested 0.23.0 with autogroup:internet. It resolves the issue. I did not know that it was a bug. I reached out the discord. I thought this was a limitation or a bug. But finally someone suggested to use autogroup"internet to resolve this issue. You may close this. I just dont know if something is a support issue or a bug. After I did not part to search the internet and discord, I decided submitting this as a bug was the only way to go. Thank you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#796