[Bug] loading ACL policy: check with a host results in *v2.Host not supported" #1053

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

Originally created by @cchance27 on GitHub (Jun 27, 2025).

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

In 24.3 i was using 2 host names (defined under "hosts") in my ssh check's src... (ssh: src: ["hostname.whatever]), laptop and another computer to be the only valid ssh sources, but it stopped working when I upgraded to the latest release.

Error in logs was: Loading ACL policy: creating policy manager: parsing policy: parsing policy from bytes: type *v2.Host not supported"

I had updated my user rules to the trailing @ as required for the upgrade, then and after some tracing I found it was the use of hostnames in the src for the check on ssh that was breaking it...

I managed to work around it by switching to a tag on those machines which is fine but not sure if this was a bug or something, but the error was confusing and i didn't see a bug report or mention specifically of this issue anywhere.

Expected Behavior

SSH ACL policy to work with hostnames as they did in 0.24.3, or a better error maybe, or just docs that specify that it doesn't work with hostnames?

Steps To Reproduce

  1. use an acl with entries like...
{
	"Hosts": {
		"macbook.xxx.local": "100.64.0.1/32",
	},
        "tagOwners": ["...omitted..."],
	"acls": ["...omitted..."],
	"ssh": [
		{
			"action": "check",
			"src": ["macbook.xxx.local"],
			"dst": ["tag:cloud", "tag:home"],
			"users": ["opc", "pi"],
			"checkPeriod": "24h"
		}
	]
}
  1. start the service

Environment

- OS: Docker
- Headscale version: 0.26.1
- Tailscale version: 1.80.0

Runtime environment

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

Debug information

Don't think this is needed as its not a connection issue.

Originally created by @cchance27 on GitHub (Jun 27, 2025). ### 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 In 24.3 i was using 2 host names (defined under "hosts") in my ssh check's src... (ssh: src: ["hostname.whatever]), laptop and another computer to be the only valid ssh sources, but it stopped working when I upgraded to the latest release. Error in logs was: Loading ACL policy: creating policy manager: parsing policy: parsing policy from bytes: type *v2.Host not supported" I had updated my user rules to the trailing @ as required for the upgrade, then and after some tracing I found it was the use of hostnames in the src for the check on ssh that was breaking it... I managed to work around it by switching to a tag on those machines which is fine but not sure if this was a bug or something, but the error was confusing and i didn't see a bug report or mention specifically of this issue anywhere. ### Expected Behavior SSH ACL policy to work with hostnames as they did in 0.24.3, or a better error maybe, or just docs that specify that it doesn't work with hostnames? ### Steps To Reproduce 1. use an acl with entries like... ```json { "Hosts": { "macbook.xxx.local": "100.64.0.1/32", }, "tagOwners": ["...omitted..."], "acls": ["...omitted..."], "ssh": [ { "action": "check", "src": ["macbook.xxx.local"], "dst": ["tag:cloud", "tag:home"], "users": ["opc", "pi"], "checkPeriod": "24h" } ] } ``` 2. start the service ### Environment ```markdown - OS: Docker - Headscale version: 0.26.1 - Tailscale version: 1.80.0 ``` ### Runtime environment - [x] Headscale is behind a (reverse) proxy - [x] Headscale runs in a container ### Debug information Don't think this is needed as its not a connection issue.
adam added the bug label 2025-12-29 02:27:58 +01:00
adam closed this issue 2025-12-29 02:27:58 +01:00
Author
Owner

@nblock commented on GitHub (Jul 20, 2025):

but the error was confusing and i didn't see a bug report or mention specifically of this issue anywhere.

From the CHANGELOG for Headscale 0.26:

The SSH policy has been reworked to be more consistent with the rest of the
policy. In addition, several inconsistencies between our implementation and
Tailscale's upstream has been closed and this might be a breaking change for
some users. Please refer to the
upstream documentation
for more information on which types are allowed in src, dst and users.

This was one of the mentioned inconsistencies that got fixed; from the docs of the src key in the ssh policy:

The source where a connection originates from. This can be a user, group, tag, user:*@, or autogroup. This cannot be a bare wildcard *.

@nblock commented on GitHub (Jul 20, 2025): > but the error was confusing and i didn't see a bug report or mention specifically of this issue anywhere. From the [CHANGELOG for Headscale 0.26](https://github.com/juanfont/headscale/blob/main/CHANGELOG.md#0260-2025-05-14): > The SSH policy has been reworked to be more consistent with the rest of the policy. In addition, several inconsistencies between our implementation and Tailscale's upstream has been closed and this might be a breaking change for some users. Please refer to the [upstream documentation](https://tailscale.com/kb/1337/acl-syntax#tailscale-ssh) for more information on which types are allowed in `src`, `dst` and `users`. This was one of the mentioned inconsistencies that got fixed; from the [docs of the `src` key in the `ssh` policy](https://tailscale.com/kb/1193/tailscale-ssh#src): > The source where a connection originates from. This can be a user, group, tag, user:*@<domain>, or autogroup. This cannot be a bare wildcard *.
Author
Owner

@cchance27 commented on GitHub (Jul 21, 2025):

feels so weird that an acl wouldn't allow a hostname, i mean i guess for matching the tailscale standard, dropping hostname support just felt weird :S

@cchance27 commented on GitHub (Jul 21, 2025): feels so weird that an acl wouldn't allow a hostname, i mean i guess for matching the tailscale standard, dropping hostname support just felt weird :S
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1053