Skip to content

Commit

Permalink
chore: log real raw command
Browse files Browse the repository at this point in the history
  • Loading branch information
smlx committed Oct 22, 2024
1 parent 642756d commit 9330fdd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/sshserver/sessionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,19 @@ func getSSHIntent(sftp bool, cmd []string) []string {
// handler is that the command is set to sftp-server. This implies that the
// target container must have a sftp-server binary installed for sftp to work.
// There is no support for a built-in sftp server.
func sessionHandler(log *slog.Logger, c K8SAPIService,
sftp, logAccessEnabled bool) ssh.Handler {
func sessionHandler(
log *slog.Logger,
c K8SAPIService,
sftp,
logAccessEnabled bool,
) ssh.Handler {
return func(s ssh.Session) {
sessionTotal.Inc()
ctx := s.Context()
log := log.With(slog.String("sessionID", ctx.SessionID()))
log.Debug("starting session",
slog.Any("rawCommand", s.Command()),
slog.Any("command", s.Command()),
slog.String("rawCommand", s.RawCommand()),
slog.String("subsystem", s.Subsystem()),
)
// parse the command line arguments to extract any service or container args
Expand Down

0 comments on commit 9330fdd

Please sign in to comment.