cmd/tailscale, ipn, feature/remoteconfig: add remote-config support

Add a new Prefs.RemoteConfig bool. When true, a c2n endpoint at
/remoteapi/localapi/* proxies into this node's LocalAPI at
/localapi/* with full read/write permission, giving the tailnet
admin the same API surface a local root/admin user has via the
tailscale CLI. All LocalAPI versions (v0, v1, ...) proxy through.

RemoteConfig is an alternative to Tailscale's default per-feature
double opt-in, in which both the tailnet admin and the local machine
owner must consent to each individual setting change. It is a single
client-side "I trust the tailnet admin" switch that, once on, hands
over full remote management of this node's settings and LocalAPI
without any further local prompt or confirmation.

This is only appropriate when the tailnet admin already owns the
machine (e.g. a corporate fleet device) or the local user has
explicitly delegated full control. It should never be enabled on a
personal/BYOD device with an untrusted tailnet admin. The trust
model is documented on the pref, on the hidden --remote-config CLI
flag, and on the feature/remoteconfig package.

The node advertises its RemoteConfig state to the control plane via
a new Hostinfo.RemoteConfig bool. This is only true when the feature
is both compiled in (buildfeatures.HasRemoteConfig) and its init
actually ran (feature.IsRegistered("remoteconfig")); tsnet builds
have the former but not the latter and correctly report false.

The handler lives in feature/remoteconfig and can be omitted with the
ts_omit_remoteconfig build tag. tsnet's TestDeps guards against
accidentally pulling it in.

Updates tailscale/corp#18043

Change-Id: I72ce10a90a0e4e738c72c940af3af64c986160b2
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2026-07-07 12:10:34 -07:00
committed by Brad Fitzpatrick
parent 2051c5f358
commit c1ae2bb1f8
23 changed files with 444 additions and 1 deletions
+11 -1
View File
@@ -188,7 +188,8 @@ type CapabilityVersion int
// - 139: 2026-05-22: Client understands [NodeAttrEmitRuntimeMetrics]
// - 140: 2026-05-27: Client understands [NodeAttrDisableUDPGRO], [NodeAttrDisableUDPGSO], [NodeAttrDisableTUNUDPGRO], [NodeAttrDisableTUNTCPGRO]
// - 141: 2026-05-28: Client understands [NodeAttrNeverGSOEqualTail]
const CurrentCapabilityVersion CapabilityVersion = 141
// - 142: 2026-07-06: Client understands c2n /remoteapi/localapi/* proxy
const CurrentCapabilityVersion CapabilityVersion = 142
// ID is an integer ID for a user, node, or login allocated by the
// control plane.
@@ -896,6 +897,15 @@ type Hostinfo struct {
ShieldsUp bool `json:",omitzero"` // indicates whether the host is blocking incoming connections
ShareeNode bool `json:",omitzero"` // indicates this node exists in netmap because it's owned by a shared-to user
NoLogsNoSupport bool `json:",omitzero"` // indicates that the user has opted out of sending logs and support
// RemoteConfig is whether the node has both linked
// feature/remoteconfig into its binary and enabled
// Prefs.RemoteConfig: it has delegated full remote management of
// its prefs and LocalAPI to the tailnet admin via the
// /remoteapi/localapi/* c2n endpoint. See feature/remoteconfig for
// the trust model.
RemoteConfig bool `json:",omitzero"`
// WireIngress indicates that the node would like to be wired up server-side
// (DNS, etc) to be able to use Tailscale Funnel, even if it's not currently
// enabled. For example, the user might only use it for intermittent
+1
View File
@@ -167,6 +167,7 @@ var _HostinfoCloneNeedsRegeneration = Hostinfo(struct {
ShieldsUp bool
ShareeNode bool
NoLogsNoSupport bool
RemoteConfig bool
WireIngress bool
IngressEnabled bool
AllowsUpdate bool
+1
View File
@@ -51,6 +51,7 @@ func TestHostinfoEqual(t *testing.T) {
"ShieldsUp",
"ShareeNode",
"NoLogsNoSupport",
"RemoteConfig",
"WireIngress",
"IngressEnabled",
"AllowsUpdate",
+9
View File
@@ -550,6 +550,14 @@ func (v HostinfoView) ShareeNode() bool { return v.ж.ShareeNode }
// indicates that the user has opted out of sending logs and support
func (v HostinfoView) NoLogsNoSupport() bool { return v.ж.NoLogsNoSupport }
// RemoteConfig is whether the node has both linked
// feature/remoteconfig into its binary and enabled
// Prefs.RemoteConfig: it has delegated full remote management of
// its prefs and LocalAPI to the tailnet admin via the
// /remoteapi/localapi/* c2n endpoint. See feature/remoteconfig for
// the trust model.
func (v HostinfoView) RemoteConfig() bool { return v.ж.RemoteConfig }
// WireIngress indicates that the node would like to be wired up server-side
// (DNS, etc) to be able to use Tailscale Funnel, even if it's not currently
// enabled. For example, the user might only use it for intermittent
@@ -649,6 +657,7 @@ var _HostinfoViewNeedsRegeneration = Hostinfo(struct {
ShieldsUp bool
ShareeNode bool
NoLogsNoSupport bool
RemoteConfig bool
WireIngress bool
IngressEnabled bool
AllowsUpdate bool