Skip to content

Commit

Permalink
tailcfg: add AcceptEnv field to SSHRule (tailscale#13523)
Browse files Browse the repository at this point in the history
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: tailscale/corp#22775

Signed-off-by: Mario Minardi <mario@tailscale.com>
  • Loading branch information
mpminardi authored Sep 23, 2024
1 parent dc86d35 commit 8d50871
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tailcfg/tailcfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,13 @@ type SSHRule struct {
// Action is the outcome to task.
// A nil or invalid action means to deny.
Action *SSHAction `json:"action"`

// AcceptEnv is a slice of environment variable names that are allowlisted
// for the SSH rule in the policy file.
//
// AcceptEnv values may contain * and ? wildcard characters which match against
// an arbitrary number of characters or a single character respectively.
AcceptEnv []string `json:"acceptEnv,omitempty"`
}

// SSHPrincipal is either a particular node or a user on any node.
Expand Down
2 changes: 2 additions & 0 deletions tailcfg/tailcfg_clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions tailcfg/tailcfg_view.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8d50871

Please sign in to comment.