diff --git a/server/activity.go b/server/activity.go index c1613ad..152db48 100644 --- a/server/activity.go +++ b/server/activity.go @@ -15,6 +15,7 @@ const ActivityPowerPrefix = "server:power." const ( ActivityConsoleCommand = models.Event("server:console.command") ActivitySftpWrite = models.Event("server:sftp.write") + ActivitySftpRead = models.Event("server:sftp.read") ActivitySftpCreate = models.Event("server:sftp.create") ActivitySftpCreateDirectory = models.Event("server:sftp.create-directory") ActivitySftpRename = models.Event("server:sftp.rename") diff --git a/sftp/handler.go b/sftp/handler.go index 74ba9eb..1a7304b 100644 --- a/sftp/handler.go +++ b/sftp/handler.go @@ -87,6 +87,8 @@ func (h *Handler) Fileread(request *sftp.Request) (io.ReaderAt, error) { } return nil, sftp.ErrSSHFxNoSuchFile } + + h.events.MustLog(server.ActivitySftpRead, FileAction{Entity: request.Filepath}) return f, nil }