tailcfg: add AcceptEnv field to SSHRule (#13523)
Add an `AcceptEnv` field to `SSHRule`. This will contain the collection of environment variable names / patterns that are specified in the `acceptEnv` block for the SSH rule within the policy file. This will be used in the tailscale client to filter out unacceptable environment variables. Updates: https://github.com/tailscale/corp/issues/22775 Signed-off-by: Mario Minardi <mario@tailscale.com>
This commit is contained in:
@@ -505,6 +505,7 @@ func (src *SSHRule) Clone() *SSHRule {
|
||||
}
|
||||
dst.SSHUsers = maps.Clone(src.SSHUsers)
|
||||
dst.Action = src.Action.Clone()
|
||||
dst.AcceptEnv = append(src.AcceptEnv[:0:0], src.AcceptEnv...)
|
||||
return dst
|
||||
}
|
||||
|
||||
@@ -514,6 +515,7 @@ var _SSHRuleCloneNeedsRegeneration = SSHRule(struct {
|
||||
Principals []*SSHPrincipal
|
||||
SSHUsers map[string]string
|
||||
Action *SSHAction
|
||||
AcceptEnv []string
|
||||
}{})
|
||||
|
||||
// Clone makes a deep copy of SSHAction.
|
||||
|
||||
Reference in New Issue
Block a user