mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
Improve new field on Event, and refactored the Protocol field with a Protocol enum
This commit is contained in:
@ -28,7 +28,7 @@ func (SSHStrategy *SecureShellStrategy) Init(beelzebubServiceConfiguration parse
|
|||||||
|
|
||||||
tr.TraceEvent(tracer.Event{
|
tr.TraceEvent(tracer.Event{
|
||||||
Msg: "New SSH Session",
|
Msg: "New SSH Session",
|
||||||
Protocol: beelzebubServiceConfiguration.Protocol,
|
Protocol: tracer.SSH,
|
||||||
RemoteAddr: sess.RemoteAddr().String(),
|
RemoteAddr: sess.RemoteAddr().String(),
|
||||||
Status: tracer.Start,
|
Status: tracer.Start,
|
||||||
ID: uuidSession.String(),
|
ID: uuidSession.String(),
|
||||||
|
@ -2,6 +2,7 @@ package tracer
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Tracer struct {
|
type Tracer struct {
|
||||||
@ -19,18 +20,32 @@ func (tracer *Tracer) TraceEvent(event Event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Event struct {
|
type Event struct {
|
||||||
RemoteAddr string
|
RemoteAddr string
|
||||||
Protocol string
|
Protocol Protocol
|
||||||
Command string
|
Command string
|
||||||
Status Status
|
Status Status
|
||||||
Msg string
|
Msg string
|
||||||
ID string
|
ID string
|
||||||
Environ string
|
Environ string
|
||||||
User string
|
User string
|
||||||
Password string
|
Password string
|
||||||
Client string
|
Client string
|
||||||
|
Headers http.Header
|
||||||
|
Cookies []*http.Cookie
|
||||||
|
UserAgent string
|
||||||
|
HostHTTPRequest string
|
||||||
|
Body string
|
||||||
|
HTTPMethod string
|
||||||
|
RequestURI string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Protocol int
|
||||||
|
|
||||||
|
const (
|
||||||
|
HTTP Protocol = iota
|
||||||
|
SSH
|
||||||
|
)
|
||||||
|
|
||||||
type Status int
|
type Status int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Reference in New Issue
Block a user