ssh/tailssh: check if user matching autogroup:nonroot is root

Add a check to ensure that the user being matched to an
autogroup:nonroot rule is in fact a non-root user on the system.

Updates https://github.com/tailscale/corp/issues/43245

Signed-off-by: Mario Minardi <mario@tailscale.com>
This commit is contained in:
Mario Minardi
2026-07-27 17:18:34 -06:00
committed by Mario Minardi
parent f3ec43d7dd
commit e48e7b730a
5 changed files with 166 additions and 13 deletions
+3 -2
View File
@@ -1779,8 +1779,9 @@ func (e *Env) initVnet() {
e.server.ControlServer().SSHPolicy = &tailcfg.SSHPolicy{
Rules: []*tailcfg.SSHRule{{
Principals: []*tailcfg.SSHPrincipal{{Any: true}},
SSHUsers: map[string]string{"*": "="},
Action: &tailcfg.SSHAction{Accept: true},
// Allow permissive login + root login by default
SSHUsers: map[string]string{"*": "=", "root": "root"},
Action: &tailcfg.SSHAction{Accept: true},
}},
}
break