mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-07 16:17:41 +00:00
ssh/tailssh: add more metadata to recording header
Updates tailscale/corp#9967 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
cc3806056f
commit
7a97e64ef0
@ -1366,12 +1366,16 @@ type CastHeader struct {
|
|||||||
Env map[string]string `json:"env"`
|
Env map[string]string `json:"env"`
|
||||||
|
|
||||||
// Tailscale-specific fields:
|
// Tailscale-specific fields:
|
||||||
SrcNode string `json:"srcNode"` // name
|
SrcNode string `json:"srcNode"` // node FQDN
|
||||||
SrcNodeID tailcfg.StableNodeID `json:"srcNodeID"`
|
SrcNodeID tailcfg.StableNodeID `json:"srcNodeID"`
|
||||||
SSHUser string `json:"sshUser"`
|
SrcNodeTags []string `json:"srcNodeTags"`
|
||||||
LocalUser string `json:"localUser"`
|
SSHUser string `json:"sshUser"` // as presented by the client
|
||||||
|
LocalUser string `json:"localUser"`
|
||||||
|
|
||||||
|
SrcNodeUserID tailcfg.UserID `json:"srcNodeUserID"` // if not tagged
|
||||||
|
SrcNodeUser string `json:"srcNodeUser"`
|
||||||
}
|
}
|
||||||
j, err := json.Marshal(CastHeader{
|
ch := CastHeader{
|
||||||
Version: 2,
|
Version: 2,
|
||||||
Width: w.Width,
|
Width: w.Width,
|
||||||
Height: w.Height,
|
Height: w.Height,
|
||||||
@ -1389,9 +1393,16 @@ type CastHeader struct {
|
|||||||
},
|
},
|
||||||
SSHUser: ss.conn.info.sshUser,
|
SSHUser: ss.conn.info.sshUser,
|
||||||
LocalUser: ss.conn.localUser.Username,
|
LocalUser: ss.conn.localUser.Username,
|
||||||
SrcNode: ss.conn.info.node.Name,
|
SrcNode: strings.TrimSuffix(ss.conn.info.node.Name, "."),
|
||||||
SrcNodeID: ss.conn.info.node.StableID,
|
SrcNodeID: ss.conn.info.node.StableID,
|
||||||
})
|
}
|
||||||
|
if !ss.conn.info.node.IsTagged() {
|
||||||
|
ch.SrcNodeUser = ss.conn.info.uprof.LoginName
|
||||||
|
ch.SrcNodeUserID = ss.conn.info.node.User
|
||||||
|
} else {
|
||||||
|
ch.SrcNodeTags = ss.conn.info.node.Tags
|
||||||
|
}
|
||||||
|
j, err := json.Marshal(ch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user