[management,client] Report the remote-jobs opt-in to management

The dashboard needs to know which peers have opted out of remote jobs so
it can reflect that in the UI, the same way it surfaces the SSH server
flag. Report RemoteJobsAllowed as peer system-info: the client sets it on
the reported flags (like ServerSSHAllowed), the proto Flags message
carries it, and management decodes it onto the peer meta and exposes it
on the peers API as remote_jobs_allowed.

Kept out of the components/network-map path: unlike ServerSSHAllowed it
does not participate in firewall-rule calculation, so it only rides the
reporting flags, not ComponentPeer.
This commit is contained in:
mlsmaycon
2026-08-11 11:45:04 +00:00
committed by Maycon Santos
parent 7da4127c7d
commit 1d93c5ec3f
12 changed files with 993 additions and 953 deletions

View File

@@ -357,6 +357,7 @@ func (a *Auth) setSystemInfoFlags(info *system.Info) {
a.config.EnableSSHLocalPortForwarding,
a.config.EnableSSHRemotePortForwarding,
a.config.DisableSSHAuth,
a.config.RemoteJobsAllowed,
)
}

View File

@@ -711,6 +711,7 @@ func loginToManagement(ctx context.Context, client mgm.Client, pubSSHKey []byte,
config.EnableSSHLocalPortForwarding,
config.EnableSSHRemotePortForwarding,
config.DisableSSHAuth,
config.RemoteJobsAllowed,
)
return client.Login(sysInfo, pubSSHKey, config.DNSLabels)
}

View File

@@ -1252,6 +1252,7 @@ func (e *Engine) applyInfoFlags(info *system.Info) {
e.config.EnableSSHLocalPortForwarding,
e.config.EnableSSHRemotePortForwarding,
e.config.DisableSSHAuth,
&e.config.RemoteJobsAllowed,
)
}

View File

@@ -65,6 +65,7 @@ type Info struct {
RosenpassEnabled bool
RosenpassPermissive bool
ServerSSHAllowed bool
RemoteJobsAllowed bool
DisableClientRoutes bool
DisableServerRoutes bool
@@ -90,12 +91,16 @@ func (i *Info) SetFlags(
disableDNS, disableFirewall, blockLANAccess, blockInbound, disableIPv6 bool, syncMessageVersion *int,
enableSSHRoot, enableSSHSFTP, enableSSHLocalPortForwarding, enableSSHRemotePortForwarding *bool,
disableSSHAuth *bool,
remoteJobsAllowed *bool,
) {
i.RosenpassEnabled = rosenpassEnabled
i.RosenpassPermissive = rosenpassPermissive
if serverSSHAllowed != nil {
i.ServerSSHAllowed = *serverSSHAllowed
}
if remoteJobsAllowed != nil {
i.RemoteJobsAllowed = *remoteJobsAllowed
}
i.DisableClientRoutes = disableClientRoutes
i.DisableServerRoutes = disableServerRoutes

View File

@@ -676,6 +676,7 @@ func extractPeerMeta(ctx context.Context, meta *proto.PeerSystemMeta) nbpeer.Pee
RosenpassEnabled: meta.GetFlags().GetRosenpassEnabled(),
RosenpassPermissive: meta.GetFlags().GetRosenpassPermissive(),
ServerSSHAllowed: meta.GetFlags().GetServerSSHAllowed(),
RemoteJobsAllowed: meta.GetFlags().GetRemoteJobsAllowed(),
DisableClientRoutes: meta.GetFlags().GetDisableClientRoutes(),
DisableServerRoutes: meta.GetFlags().GetDisableServerRoutes(),
DisableDNS: meta.GetFlags().GetDisableDNS(),

View File

@@ -615,6 +615,7 @@ func toSinglePeerResponse(peer *nbpeer.Peer, groupsInfo []api.GroupMinimum, dnsD
RosenpassEnabled: &peer.Meta.Flags.RosenpassEnabled,
RosenpassPermissive: &peer.Meta.Flags.RosenpassPermissive,
ServerSshAllowed: &peer.Meta.Flags.ServerSSHAllowed,
RemoteJobsAllowed: &peer.Meta.Flags.RemoteJobsAllowed,
},
}
@@ -670,6 +671,7 @@ func toPeerListItemResponse(peer *nbpeer.Peer, groupsInfo []api.GroupMinimum, dn
RosenpassEnabled: &peer.Meta.Flags.RosenpassEnabled,
RosenpassPermissive: &peer.Meta.Flags.RosenpassPermissive,
ServerSshAllowed: &peer.Meta.Flags.ServerSSHAllowed,
RemoteJobsAllowed: &peer.Meta.Flags.RemoteJobsAllowed,
},
}
}

View File

@@ -142,6 +142,7 @@ type Flags struct {
RosenpassEnabled bool
RosenpassPermissive bool
ServerSSHAllowed bool
RemoteJobsAllowed bool
DisableClientRoutes bool
DisableServerRoutes bool
@@ -602,6 +603,7 @@ func (f Flags) isEqual(other Flags) bool {
return f.RosenpassEnabled == other.RosenpassEnabled &&
f.RosenpassPermissive == other.RosenpassPermissive &&
f.ServerSSHAllowed == other.ServerSSHAllowed &&
f.RemoteJobsAllowed == other.RemoteJobsAllowed &&
f.DisableClientRoutes == other.DisableClientRoutes &&
f.DisableServerRoutes == other.DisableServerRoutes &&
f.DisableDNS == other.DisableDNS &&

View File

@@ -1000,6 +1000,7 @@ func infoToMetaData(info *system.Info) *proto.PeerSystemMeta {
RosenpassEnabled: info.RosenpassEnabled,
RosenpassPermissive: info.RosenpassPermissive,
ServerSSHAllowed: info.ServerSSHAllowed,
RemoteJobsAllowed: info.RemoteJobsAllowed,
DisableClientRoutes: info.DisableClientRoutes,
DisableServerRoutes: info.DisableServerRoutes,

View File

@@ -984,6 +984,10 @@ components:
description: Indicates whether SSH access this peer is allowed or not
type: boolean
example: true
remote_jobs_allowed:
description: Indicates whether the peer has opted into management-requested remote jobs (e.g. debug bundles)
type: boolean
example: true
disable_client_routes:
description: Indicates whether client routes are disabled on this peer or not
type: boolean

View File

@@ -4285,6 +4285,9 @@ type PeerLocalFlags struct {
// LazyConnectionEnabled Indicates whether lazy connection is enabled on this peer
LazyConnectionEnabled *bool `json:"lazy_connection_enabled,omitempty"`
// RemoteJobsAllowed Indicates whether the peer has opted into management-requested remote jobs (e.g. debug bundles)
RemoteJobsAllowed *bool `json:"remote_jobs_allowed,omitempty"`
// RosenpassEnabled Indicates whether Rosenpass is enabled on this peer
RosenpassEnabled *bool `json:"rosenpass_enabled,omitempty"`

File diff suppressed because it is too large Load Diff

View File

@@ -234,6 +234,11 @@ message Flags {
bool disableSSHAuth = 15;
bool disableIPv6 = 16;
// remoteJobsAllowed mirrors the peer's local opt-in for management-requested
// remote jobs (e.g. debug bundles). Reported so the dashboard can surface
// peers that have opted out.
bool remoteJobsAllowed = 17;
}
// PeerCapability represents a feature the client binary supports.