From 459b157c3bf2dff41996297c92a4faf30ee8d4f0 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 4 Nov 2026 16:32:11 +0000 Subject: [PATCH] docs: note the posture attributes endpoint and its proxy setting trusted_proxies now feeds a stored, API-visible address, not only logs. Updates #2272 --- CHANGELOG.md | 1 + cmd/headscale/cli/oauth_client.go | 2 +- config-example.yaml | 4 ++-- docs/ref/integration/reverse-proxy.md | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f72a22aa..4991c9733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -193,6 +193,7 @@ the ACME DNS-01 challenge through a built-in DNS provider: `acmedns`, - Policy `tests` reject `autogroup:member` as a source. [#3649](https://github.com/juanfont/headscale/pull/3649) - Document `ssh-behavior-v1`. Headscale does not set it. [#3649](https://github.com/juanfont/headscale/pull/3649) - The v2 API sorts device lists by name. Devices report `connectedToControl`, `lastSeen` and `blocksIncomingConnections`. `fields=all` adds `sshEnabled`, `distro` and `clientConnectivity`. Add `POST /device/{id}/expire`. Settings report `routeSelection`. Errors use Tailscale's text and content types. A JSON policy read returns valid JSON. [#3649](https://github.com/juanfont/headscale/pull/3649) +- The v2 API adds `GET /device/{id}/attributes`, scoped `devices:posture_attributes:read`. It reports `ip:publicAddress`: the source IP of the node's latest control connection, stored on the node. Behind a reverse proxy, set `trusted_proxies` or it reports the proxy. [#3419](https://github.com/juanfont/headscale/pull/3419) - PostgreSQL connection settings are assembled into a `postgres://` URL with proper escaping, so a password (or host, user, database name) containing spaces, quotes or other reserved characters no longer truncates the DSN [#3477](https://github.com/juanfont/headscale/pull/3477) - Expiring or deleting a non-existent pre-auth key now returns an error instead of silently succeeding [#3324](https://github.com/juanfont/headscale/pull/3324) - Improve systemd service file hardening [#3341](https://github.com/juanfont/headscale/pull/3341) diff --git a/cmd/headscale/cli/oauth_client.go b/cmd/headscale/cli/oauth_client.go index 3d74b8254..3ccb752ab 100644 --- a/cmd/headscale/cli/oauth_client.go +++ b/cmd/headscale/cli/oauth_client.go @@ -23,7 +23,7 @@ func init() { oauthClientsCmd.AddCommand(listOAuthClientsCmd) createOAuthClientCmd.Flags(). - StringArrayP("scope", "s", nil, "Scope the client's tokens are granted (repeatable): auth_keys, oauth_keys, devices:core, devices:routes, policy_file, feature_settings, users (each with a :read variant), or all/all:read") + StringArrayP("scope", "s", nil, "Scope the client's tokens are granted (repeatable): auth_keys, oauth_keys, devices:core, devices:routes, devices:posture_attributes, policy_file, feature_settings, users (each with a :read variant), or all/all:read") createOAuthClientCmd.Flags(). StringArrayP("tag", "t", nil, "Tag the client's tokens may assign to devices (repeatable), e.g. tag:k8s-operator") createOAuthClientCmd.Flags().StringP("description", "d", "", "Human-readable description") diff --git a/config-example.yaml b/config-example.yaml index 9a788f44c..53dad8de1 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -26,8 +26,8 @@ metrics_listen_addr: 127.0.0.1:9090 # CIDR(s) of reverse proxies (e.g. 127.0.0.1/32) whose # True-Client-IP, X-Real-IP and X-Forwarded-For headers should # be honoured. Empty (default) ignores those headers; setting -# this without a proxy in front lets clients spoof their logged -# source IP. +# this without a proxy in front lets clients spoof their source +# IP in logs and in the v2 API's ip:publicAddress. trusted_proxies: [] # The Noise section includes specific configuration for the diff --git a/docs/ref/integration/reverse-proxy.md b/docs/ref/integration/reverse-proxy.md index 7cc289bb1..6c1078772 100644 --- a/docs/ref/integration/reverse-proxy.md +++ b/docs/ref/integration/reverse-proxy.md @@ -50,7 +50,8 @@ and indicates that the reverse proxy is in charge of terminating TLS. Headscale ignores `True-Client-IP`, `X-Real-IP` and `X-Forwarded-For` headers unless the request's TCP peer matches the `trusted_proxies` configuration option. Set this to the CIDR(s) your reverse proxy connects from so the real client IP -appears in access logs. +appears in access logs and in the v2 API's `ip:publicAddress` device attribute. Without it, every node reports the +proxy's address. ```yaml title="config.yaml" trusted_proxies: