mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-23 14:56:49 +09:00
policy/v2: match the login user in SSHCheckParams
The client picks the check rule by login user; the server took the first rule for the node pair, so a root login could get a 12h localpart period instead of "always", or be approved after its rule was removed while another user's rule remained. Hold URLs now carry the concrete user: tailssh never expanded the encoded $LOCAL_USER. Updates #3508
This commit is contained in:
1 parent
dceb584c89
commit
957a332d5d
9 files changed
+416
-82
No files matched your search
@@ -1260,12 +1260,13 @@ func (s *State) SSHPolicy(node types.NodeView) (*tailcfg.SSHPolicy, error) {
|
||||
return s.polMan.SSHPolicy(s.cfg.ServerURL, node)
|
||||
}
|
||||
|
||||
// SSHCheckParams resolves the SSH check period for a source-destination
|
||||
// node pair from the current policy.
|
||||
// SSHCheckParams resolves the SSH check period for src logging in to dst
|
||||
// as localUser from the current policy.
|
||||
func (s *State) SSHCheckParams(
|
||||
srcNodeID, dstNodeID types.NodeID,
|
||||
localUser string,
|
||||
) (time.Duration, bool) {
|
||||
return s.polMan.SSHCheckParams(srcNodeID, dstNodeID)
|
||||
return s.polMan.SSHCheckParams(srcNodeID, dstNodeID, localUser)
|
||||
}
|
||||
|
||||
// Filter returns the current network filter rules and matches.
|
||||
|
||||
Reference in new issue
Block a user