From 957d87c75d84c676bec89d810b8b7419a3065d34 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 22 May 2022 21:49:23 +0200 Subject: [PATCH] Added is on password handler SSH Strategy, and refactored the traceStrategy name --- main.go | 4 ++-- protocols/secureShellStrategy.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 0760488..0eb48b8 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,7 @@ func main() { hypertextTransferProtocolStrategy := &protocols.HypertextTransferProtocolStrategy{} // Init protocol manager, with simple log on stout trace strategy and default protocol HTTP - protocolManager := protocols.InitProtocolManager(traceStrategyStdout, hypertextTransferProtocolStrategy) + protocolManager := protocols.InitProtocolManager(traceStrategyStdoutAndRabbitMQ, hypertextTransferProtocolStrategy) for _, beelzebubServiceConfiguration := range beelzebubServicesConfiguration { switch beelzebubServiceConfiguration.Protocol { @@ -70,7 +70,7 @@ func failOnError(err error, msg string) { } } -func traceStrategyStdout(event tracer.Event) { +func traceStrategyStdoutAndRabbitMQ(event tracer.Event) { log.WithFields(log.Fields{ "status": event.Status, "event": event, diff --git a/protocols/secureShellStrategy.go b/protocols/secureShellStrategy.go index 21d50ef..6353040 100644 --- a/protocols/secureShellStrategy.go +++ b/protocols/secureShellStrategy.go @@ -81,6 +81,7 @@ func (SSHStrategy *SecureShellStrategy) Init(beelzebubServiceConfiguration parse Password: password, Client: ctx.ClientVersion(), RemoteAddr: ctx.RemoteAddr().String(), + ID: uuid.New().String(), }) matched, err := regexp.MatchString(beelzebubServiceConfiguration.PasswordRegex, password) if err != nil {