From 69e01ca7f87d38fce6c29b76d161c313c141c0d3 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 4 Nov 2026 21:15:40 +0000 Subject: [PATCH] policy/v2: reject policy DERP nodes on tailscale.com like SaaS SaaS also rejects its DERP servers' IPs; that needs its live server list. Updates #2918 --- hscontrol/policy/v2/derpmap_compat_test.go | 23 ++++- .../v2/tailscale_nodeattrs_compat_test.go | 2 + ...trs-derpmap-node-tailscale-certname.hujson | 92 +++++++++++++++++++ ...attrs-derpmap-node-tailscale-domain.hujson | 84 +++++++++++++++++ ...erpmap-node-tailscale-hostname-case.hujson | 78 ++++++++++++++++ ...trs-derpmap-node-tailscale-hostname.hujson | 84 +++++++++++++++++ ...nodeattrs-derpmap-node-tailscale-io.hujson | 78 ++++++++++++++++ ...nodeattrs-derpmap-node-tailscale-ip.hujson | 92 +++++++++++++++++++ ...rs-derpmap-node-tailscale-lookalike.hujson | 78 ++++++++++++++++ ...rs-derpmap-node-tailscale-subdomain.hujson | 84 +++++++++++++++++ .../nodeattrs-derpmap-node-ts-net.hujson | 78 ++++++++++++++++ hscontrol/policy/v2/types.go | 27 ++++-- hscontrol/servertest/policy_test.go | 3 + 13 files changed, 796 insertions(+), 7 deletions(-) create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-certname.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-domain.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname-case.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-io.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-ip.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-lookalike.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-subdomain.hujson create mode 100644 hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-ts-net.hujson diff --git a/hscontrol/policy/v2/derpmap_compat_test.go b/hscontrol/policy/v2/derpmap_compat_test.go index 4ca97c14c..736ce5f35 100644 --- a/hscontrol/policy/v2/derpmap_compat_test.go +++ b/hscontrol/policy/v2/derpmap_compat_test.go @@ -18,6 +18,17 @@ import ( "github.com/stretchr/testify/require" ) +// derpMapSkipReasons lists the policies SaaS rejects for a reason headscale +// cannot check. An entry headscale starts to reject fails, so a fix must +// delete it. +// +// TAILSCALE_DERP_IPS — SaaS rejects a custom node on the IP of one of its +// DERP servers. That takes Tailscale's live server list; the one in the +// tailscale.com module is a stale fallback. +var derpMapSkipReasons = map[string]string{ + "nodeattrs-derpmap-node-tailscale-ip": "TAILSCALE_DERP_IPS", +} + func TestDERPMapPolicyCompat(t *testing.T) { files, err := filepath.Glob(filepath.Join("testdata", "nodeattrs_results", "nodeattrs-derpmap-*.hujson")) require.NoError(t, err) @@ -32,15 +43,25 @@ func TestDERPMapPolicyCompat(t *testing.T) { err = pol.validate() } + if reason, ok := derpMapSkipReasons[tf.TestID]; ok { + require.NoError(t, err, "headscale refuses this policy; delete derpMapSkipReasons[%q]", tf.TestID) + t.Skip(reason) + } + if tf.Input.APIResponseCode == http.StatusOK { require.NoError(t, err) return } + msg := tf.Input.APIResponseBody.Message + require.Error(t, err) - msg := tf.Input.APIResponseBody.Message + // SaaS names its own DERP servers by host; headscale has no list of + // them and rejects them by their domain. + msg = strings.Replace(msg, "Tailscale host name", "Tailscale hostname or subdomain", 1) + if !strings.HasPrefix(msg, "json:") { assert.Contains(t, err.Error(), msg) } diff --git a/hscontrol/policy/v2/tailscale_nodeattrs_compat_test.go b/hscontrol/policy/v2/tailscale_nodeattrs_compat_test.go index ed4242a69..6638b80db 100644 --- a/hscontrol/policy/v2/tailscale_nodeattrs_compat_test.go +++ b/hscontrol/policy/v2/tailscale_nodeattrs_compat_test.go @@ -130,7 +130,9 @@ func parsePrefixes(t *testing.T, name string, s []string) []netip.Prefix { // NO_USER_ROLES — `autogroup:admin` and `autogroup:owner` depend on // user-role and tailnet-ownership concepts headscale does not // model. +// TAILSCALE_DERP_IPS — see derpMapSkipReasons. var nodeAttrsSkipReasons = map[string]string{ + "nodeattrs-derpmap-node-tailscale-ip": "TAILSCALE_DERP_IPS", "nodeattrs-ippool-g1-admin": "IPPOOL_ALLOCATOR", "nodeattrs-ippool-g2-group": "IPPOOL_ALLOCATOR", "nodeattrs-ippool-g3-mixed": "IPPOOL_ALLOCATOR", diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-certname.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-certname.hujson new file mode 100644 index 000000000..4c3f56dac --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-certname.hujson @@ -0,0 +1,92 @@ +// nodeattrs-derpmap-node-tailscale-certname +// +// Policy derpMap custom node with a Tailscale CertName -- checked too? +// +// Steps: 1 +// Captured at: 2026-11-04T21:09:20Z +// tool version: tscap/a796688a6592161fffcf039f7772775b07f08842 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-certname", + "description": "Policy derpMap custom node with a Tailscale CertName -- checked too?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:09:20.486737469Z", + "tool_version": "tscap/a796688a6592161fffcf039f7772775b07f08842", + "tailnet": "odin@example.com", + "error": true, + "input": { + "api_response_code": 400, + "api_response_body": { + "message": "custom DERP Region 900 cannot use Tailscale host name \"derp1h.tailscale.com\"" + }, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node with a Tailscale CertName -- checked too?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-certname\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"derp900.example.com\", \"CertName\": \"derp1h.tailscale.com\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-certname.hujson", + "full_policy": { + "derpMap": {"Regions": {"900": {"Nodes": [{ + "CertName": "derp1h.tailscale.com", + "HostName": "derp900.example.com", + "Name": "900a", + "RegionID": 900 + }], "RegionCode": "custom", "RegionID": 900}}}, + "tagOwners": {"tag:server": ["odin@example.com"]} + } + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:09:30.265389738Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": { + "derpMap": {"Regions": {"900": {"Nodes": [{ + "CertName": "derp1h.tailscale.com", + "HostName": "derp900.example.com", + "Name": "900a", + "RegionID": 900 + }], "RegionCode": "custom", "RegionID": 900}}}, + "tagOwners": {"tag:server": ["odin@example.com"]} + }, + "status": 200, + "response": { + "message": "custom DERP Region 900 cannot use Tailscale host name \"derp1h.tailscale.com\"" + } + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-domain.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-domain.hujson new file mode 100644 index 000000000..f193cb756 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-domain.hujson @@ -0,0 +1,84 @@ +// nodeattrs-derpmap-node-tailscale-domain +// +// Policy derpMap custom node host name tailscale.com itself -- rejected? +// +// Steps: 1 +// Captured at: 2026-11-04T21:09:34Z +// tool version: tscap/a796688a6592161fffcf039f7772775b07f08842 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-domain", + "description": "Policy derpMap custom node host name tailscale.com itself -- rejected?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:09:34.307610003Z", + "tool_version": "tscap/a796688a6592161fffcf039f7772775b07f08842", + "tailnet": "odin@example.com", + "error": true, + "input": { + "api_response_code": 400, + "api_response_body": { + "message": "custom DERP Region 900 cannot use Tailscale hostname or subdomain \"tailscale.com\"" + }, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node host name tailscale.com itself -- rejected?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-domain\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"tailscale.com\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-domain.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "tailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:09:42.014587433Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "tailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": { + "message": "custom DERP Region 900 cannot use Tailscale hostname or subdomain \"tailscale.com\"" + } + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname-case.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname-case.hujson new file mode 100644 index 000000000..5db908726 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname-case.hujson @@ -0,0 +1,78 @@ +// nodeattrs-derpmap-node-tailscale-hostname-case +// +// Policy derpMap custom node with a Tailscale host name in upper case -- case-insensitive check? +// +// Steps: 1 +// Captured at: 2026-11-04T21:09:46Z +// tool version: tscap/a796688a6592161fffcf039f7772775b07f08842 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-hostname-case", + "description": "Policy derpMap custom node with a Tailscale host name in upper case -- case-insensitive check?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:09:46.052823974Z", + "tool_version": "tscap/a796688a6592161fffcf039f7772775b07f08842", + "tailnet": "odin@example.com", + "input": { + "api_response_code": 200, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node with a Tailscale host name in upper case -- case-insensitive check?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-hostname-case\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"DERP1H.Tailscale.COM\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-hostname-case.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "DERP1H.Tailscale.COM", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:09:53.970931393Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "DERP1H.Tailscale.COM", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": {} + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname.hujson new file mode 100644 index 000000000..88fd362e9 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-hostname.hujson @@ -0,0 +1,84 @@ +// nodeattrs-derpmap-node-tailscale-hostname +// +// Policy derpMap custom node with a Tailscale DERP host name -- rejected? +// +// Steps: 1 +// Captured at: 2026-11-04T21:09:58Z +// tool version: tscap/a796688a6592161fffcf039f7772775b07f08842 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-hostname", + "description": "Policy derpMap custom node with a Tailscale DERP host name -- rejected?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:09:58.034013739Z", + "tool_version": "tscap/a796688a6592161fffcf039f7772775b07f08842", + "tailnet": "odin@example.com", + "error": true, + "input": { + "api_response_code": 400, + "api_response_body": { + "message": "custom DERP Region 900 cannot use Tailscale host name \"derp1h.tailscale.com\"" + }, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node with a Tailscale DERP host name -- rejected?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-hostname\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"derp1h.tailscale.com\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-hostname.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp1h.tailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:10:07.024021764Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp1h.tailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": { + "message": "custom DERP Region 900 cannot use Tailscale host name \"derp1h.tailscale.com\"" + } + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-io.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-io.hujson new file mode 100644 index 000000000..f2d127574 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-io.hujson @@ -0,0 +1,78 @@ +// nodeattrs-derpmap-node-tailscale-io +// +// Policy derpMap custom node on tailscale.io -- is tailscale.io reserved too? +// +// Steps: 1 +// Captured at: 2026-11-04T21:12:18Z +// tool version: tscap/9b5baac1f1e8ab33896273893a21d7312d2d6dc8 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-io", + "description": "Policy derpMap custom node on tailscale.io -- is tailscale.io reserved too?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:12:18.198153102Z", + "tool_version": "tscap/9b5baac1f1e8ab33896273893a21d7312d2d6dc8", + "tailnet": "odin@example.com", + "input": { + "api_response_code": 200, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node on tailscale.io -- is tailscale.io reserved too?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-io\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"derp.tailscale.io\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-io.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp.tailscale.io", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:12:25.751797661Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp.tailscale.io", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": {} + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-ip.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-ip.hujson new file mode 100644 index 000000000..1ff667f79 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-ip.hujson @@ -0,0 +1,92 @@ +// nodeattrs-derpmap-node-tailscale-ip +// +// Policy derpMap custom node with a Tailscale DERP IPv4 -- checked too? +// +// Steps: 1 +// Captured at: 2026-11-04T21:10:11Z +// tool version: tscap/a796688a6592161fffcf039f7772775b07f08842 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-ip", + "description": "Policy derpMap custom node with a Tailscale DERP IPv4 -- checked too?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:10:11.103231592Z", + "tool_version": "tscap/a796688a6592161fffcf039f7772775b07f08842", + "tailnet": "odin@example.com", + "error": true, + "input": { + "api_response_code": 400, + "api_response_body": { + "message": "custom DERP Region 900 cannot use Tailscale IP address \"199.38.181.93\"" + }, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node with a Tailscale DERP IPv4 -- checked too?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-ip\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"derp900.example.com\", \"IPv4\": \"199.38.181.93\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-ip.hujson", + "full_policy": { + "derpMap": {"Regions": {"900": {"Nodes": [{ + "HostName": "derp900.example.com", + "IPv4": "199.38.181.93", + "Name": "900a", + "RegionID": 900 + }], "RegionCode": "custom", "RegionID": 900}}}, + "tagOwners": {"tag:server": ["odin@example.com"]} + } + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:10:19.782998905Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": { + "derpMap": {"Regions": {"900": {"Nodes": [{ + "HostName": "derp900.example.com", + "IPv4": "199.38.181.93", + "Name": "900a", + "RegionID": 900 + }], "RegionCode": "custom", "RegionID": 900}}}, + "tagOwners": {"tag:server": ["odin@example.com"]} + }, + "status": 200, + "response": { + "message": "custom DERP Region 900 cannot use Tailscale IP address \"199.38.181.93\"" + } + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-lookalike.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-lookalike.hujson new file mode 100644 index 000000000..6075807c9 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-lookalike.hujson @@ -0,0 +1,78 @@ +// nodeattrs-derpmap-node-tailscale-lookalike +// +// Policy derpMap custom node host name ending in tailscale.com without a dot -- accepted? +// +// Steps: 1 +// Captured at: 2026-11-04T21:10:23Z +// tool version: tscap/a796688a6592161fffcf039f7772775b07f08842 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-lookalike", + "description": "Policy derpMap custom node host name ending in tailscale.com without a dot -- accepted?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:10:23.839181078Z", + "tool_version": "tscap/a796688a6592161fffcf039f7772775b07f08842", + "tailnet": "odin@example.com", + "input": { + "api_response_code": 200, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node host name ending in tailscale.com without a dot -- accepted?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-lookalike\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"derp.nottailscale.com\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-lookalike.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp.nottailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:10:32.023228581Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp.nottailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": {} + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-subdomain.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-subdomain.hujson new file mode 100644 index 000000000..c1f96d27d --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-tailscale-subdomain.hujson @@ -0,0 +1,84 @@ +// nodeattrs-derpmap-node-tailscale-subdomain +// +// Policy derpMap custom node on a tailscale.com subdomain that is no DERP host -- which wording? +// +// Steps: 1 +// Captured at: 2026-11-04T21:11:52Z +// tool version: tscap/9b5baac1f1e8ab33896273893a21d7312d2d6dc8 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-tailscale-subdomain", + "description": "Policy derpMap custom node on a tailscale.com subdomain that is no DERP host -- which wording?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:11:52.296113337Z", + "tool_version": "tscap/9b5baac1f1e8ab33896273893a21d7312d2d6dc8", + "tailnet": "odin@example.com", + "error": true, + "input": { + "api_response_code": 400, + "api_response_body": { + "message": "custom DERP Region 900 cannot use Tailscale hostname or subdomain \"foo.tailscale.com\"" + }, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node on a tailscale.com subdomain that is no DERP host -- which wording?\",\n \"id\": \"nodeattrs-derpmap-node-tailscale-subdomain\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"foo.tailscale.com\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-tailscale-subdomain.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "foo.tailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:12:02.286491285Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "foo.tailscale.com", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": { + "message": "custom DERP Region 900 cannot use Tailscale hostname or subdomain \"foo.tailscale.com\"" + } + }] + }] +} diff --git a/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-ts-net.hujson b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-ts-net.hujson new file mode 100644 index 000000000..7dbb306d1 --- /dev/null +++ b/hscontrol/policy/v2/testdata/nodeattrs_results/nodeattrs-derpmap-node-ts-net.hujson @@ -0,0 +1,78 @@ +// nodeattrs-derpmap-node-ts-net +// +// Policy derpMap custom node on ts.net -- is ts.net reserved too? +// +// Steps: 1 +// Captured at: 2026-11-04T21:12:06Z +// tool version: tscap/9b5baac1f1e8ab33896273893a21d7312d2d6dc8 +// schema version: 1 +{ + "schema_version": 1, + "test_id": "nodeattrs-derpmap-node-ts-net", + "description": "Policy derpMap custom node on ts.net -- is ts.net reserved too?", + "category": "nodeattrs", + "captured_at": "2026-11-04T21:12:06.326246353Z", + "tool_version": "tscap/9b5baac1f1e8ab33896273893a21d7312d2d6dc8", + "tailnet": "odin@example.com", + "input": { + "api_response_code": 200, + "tailnet": { + "dns": {"magic_dns": false, "nameservers": [], "search_paths": [], "split_dns": {}}, + "settings": {} + }, + "scenario_hujson": " \n{\n \"category\": \"nodeattrs\",\n \"description\": \"Policy derpMap custom node on ts.net -- is ts.net reserved too?\",\n \"id\": \"nodeattrs-derpmap-node-ts-net\",\n \"options\": {\"capture\": \"none\"},\n \"policy\": {\n \"tagOwners\": {\"tag:server\": [\"odin@example.com\"]},\n \"derpMap\": {\"Regions\": {\"900\": {\"RegionID\": 900, \"RegionCode\": \"custom\", \"Nodes\": [{\"Name\": \"900a\", \"RegionID\": 900, \"HostName\": \"derp.ts.net\"}]}}}\n },\n \"tailnet\": {\n \"dns\": {\"magic_dns\": false, \"nameservers\": [], \"search_paths\": [], \"split_dns\": {}},\n \"settings\": {}\n },\n \"topology\": \"../_topologies/dns.hujson\"\n}\n", + "scenario_path": "scenarios/nodeattrs/nodeattrs-derpmap-node-ts-net.hujson", + "full_policy": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp.ts.net", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}} + }, + "topology": {"users": [ + {"id": 1, "name": "odin", "email": "odin@example.com"}, + {"id": 2, "name": "thor", "email": "thor@example.org"} + ], "nodes": {"ivysaur": { + "hostname": "ivysaur", + "tags": [], + "ipv4": "100.81.7.2", + "ipv6": "fd7a:115c:a1e0::2", + "user": "thor", + "routable_ips": [], + "approved_routes": [] + }, "server": { + "hostname": "server", + "tags": ["tag:server"], + "ipv4": "100.81.7.3", + "ipv6": "fd7a:115c:a1e0::3", + "routable_ips": [], + "approved_routes": [] + }, "user-tid": { + "hostname": "user-tid", + "tags": [], + "ipv4": "100.81.7.1", + "ipv6": "fd7a:115c:a1e0::1", + "user": "odin", + "routable_ips": [], + "approved_routes": [] + }}}, + "captures": {}, + "steps": [{ + "name": "validate", + "at": "2026-11-04T21:12:14.158947157Z", + "result": "observed", + "actions": [{ + "kind": "api", + "principal": "admin", + "method": "POST", + "path": "/tailnet/-/acl/validate", + "header": {"Content-Type": "application/hujson"}, + "body": {"derpMap": {"Regions": {"900": { + "Nodes": [{"HostName": "derp.ts.net", "Name": "900a", "RegionID": 900}], + "RegionCode": "custom", + "RegionID": 900 + }}}, "tagOwners": {"tag:server": ["odin@example.com"]}}, + "status": 200, + "response": {} + }] + }] +} diff --git a/hscontrol/policy/v2/types.go b/hscontrol/policy/v2/types.go index 9c1ca7d52..a5278af9b 100644 --- a/hscontrol/policy/v2/types.go +++ b/hscontrol/policy/v2/types.go @@ -200,6 +200,7 @@ var ( ErrDERPRegionNoNodes = errors.New("must specify at least one node in DERP Region") ErrDERPRegionNullNode = errors.New("null node in DERP Region") ErrDERPNodeRegionID = errors.New("doesn't match its region") + ErrDERPTailscaleName = errors.New("cannot use Tailscale hostname or subdomain") ErrDERPOmitDefaultsNoRegions = errors.New("OmitDefaultRegions specified but no custom DERP regions specified") ErrProtocolNoSpecificPorts = errors.New("protocol does not support specific ports") ErrTestEmptyAssertions = errors.New("test entry must have at least one of \"accept\" or \"deny\"") @@ -3492,9 +3493,10 @@ func validateProtocolPortCompatibility(protocol Protocol, destinations []AliasWi } // validateDERPMap checks a policy derpMap the way Tailscale SaaS does, with -// its wording: an added region uses an ID in 900-999, has a node, and every -// ID in it matches the key it sits under. A null region only removes one, so -// it is not checked. HomeParams are decoded but never sent, as on SaaS. +// its wording: an added region uses an ID in 900-999, has a node, every ID in +// it matches the key it sits under, and no node is on tailscale.com. A null +// region only removes one, so it is not checked. HomeParams are decoded but +// never sent, as on SaaS. func validateDERPMap(dm *tailcfg.DERPMap) []error { if dm == nil { return nil @@ -3529,14 +3531,27 @@ func validateDERPMap(dm *tailcfg.DERPMap) []error { } for _, node := range region.Nodes { - switch { - case node == nil: + if node == nil { errs = append(errs, fmt.Errorf("%w %d", ErrDERPRegionNullNode, id)) - case node.RegionID != id: + + continue + } + + if node.RegionID != id { errs = append(errs, fmt.Errorf( "custom DERP Region %d has node %q with RegionID %d that %w", id, node.Name, node.RegionID, ErrDERPNodeRegionID)) } + + // SaaS keeps custom regions off Tailscale's own servers. It also + // rejects their IPs, which takes a live list of them. + for _, name := range []string{node.HostName, node.CertName} { + if name == "tailscale.com" || strings.HasSuffix(name, ".tailscale.com") { + errs = append(errs, fmt.Errorf("custom DERP Region %d %w %q", id, ErrDERPTailscaleName, name)) + + break + } + } } } diff --git a/hscontrol/servertest/policy_test.go b/hscontrol/servertest/policy_test.go index 741129cfe..e92a44362 100644 --- a/hscontrol/servertest/policy_test.go +++ b/hscontrol/servertest/policy_test.go @@ -319,11 +319,14 @@ var rejectedPolicySkipReasons = map[string]string{ "routes-exit-family-ipv4/refused": aclDefaultRouteAccepted, "routes-exit-family-ipv6/refused": aclDefaultRouteAccepted, + + "nodeattrs-derpmap-node-tailscale-ip/refused": tailscaleDERPIPs, } const ( noTailnetDomains = "NO_TAILNET_DOMAINS: headscale does not check user:*@domain or localpart:*@domain against the tailnet's domains" aclDefaultRouteAccepted = "ACL_DEFAULT_ROUTE_ACCEPTED: headscale accepts literal 0.0.0.0/0 and ::/0 ACL destinations; SaaS rejects them and requires * or autogroup:internet" + tailscaleDERPIPs = "TAILSCALE_DERP_IPS: SaaS refuses a policy derpMap node on a Tailscale DERP server's IP; that takes its live server list" ) // TestRejectedPolicyLeavesLivePolicyCompat posts every policy SaaS refused to