Commit 2b09986a authored by Eric's avatar Eric

[update] add ftp log service

parent bba9f607
...@@ -10,3 +10,15 @@ type Command struct { ...@@ -10,3 +10,15 @@ type Command struct {
SystemUser string `json:"system_user"` SystemUser string `json:"system_user"`
Timestamp int64 `json:"timestamp"` Timestamp int64 `json:"timestamp"`
} }
type FTPLog struct {
User string `json:"user"`
Hostname string `json:"asset"`
OrgID string `json:"org_id"`
SystemUser string `json:"system_user"`
RemoteAddr string `json:"remote_addr"`
Operate string `json:"operate"`
Path string `json:"filename"`
DataStart string `json:"data_start"`
IsSuccess bool `json:"is_success"`
}
...@@ -74,7 +74,7 @@ func MustLoadServerConfigOnce() { ...@@ -74,7 +74,7 @@ func MustLoadServerConfigOnce() {
data["TERMINAL_HOST_KEY"] = "Hidden" data["TERMINAL_HOST_KEY"] = "Hidden"
msg, err := json.Marshal(data) msg, err := json.Marshal(data)
if err != nil { if err != nil {
logger.Error("Marsha server config error: %s", err) logger.Errorf("Marsha server config error: %s", err)
return return
} }
logger.Debug("Load config from server: " + string(msg)) logger.Debug("Load config from server: " + string(msg))
......
...@@ -100,3 +100,11 @@ func PushSessionCommand(commands []*model.Command) (err error) { ...@@ -100,3 +100,11 @@ func PushSessionCommand(commands []*model.Command) (err error) {
} }
return return
} }
func PushFTPLog(data *model.FTPLog) (err error) {
err = authClient.Post(FTPLogList, data, nil)
if err != nil {
logger.Error(err)
}
return
}
...@@ -22,6 +22,7 @@ const ( ...@@ -22,6 +22,7 @@ const (
SessionDetailURL = "/api/terminal/v1/sessions/%s/" // finish session的时候发送 SessionDetailURL = "/api/terminal/v1/sessions/%s/" // finish session的时候发送
SessionReplayURL = "/api/terminal/v1/sessions/%s/replay/" //上传录像 SessionReplayURL = "/api/terminal/v1/sessions/%s/replay/" //上传录像
SessionCommandURL = "/api/terminal/v1/command/" //上传批量命令 SessionCommandURL = "/api/terminal/v1/command/" //上传批量命令
FTPLogList = "/api/audits/v1/ftp-log/" // 上传 ftp日志
FinishTaskURL = "/api/terminal/v1/tasks/%s/" FinishTaskURL = "/api/terminal/v1/tasks/%s/"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment