Added is on password handler SSH Strategy, and refactored the traceStrategy name

This commit is contained in:
Mario
2022-05-22 21:49:23 +02:00
parent e89f8446fe
commit 957d87c75d
2 changed files with 3 additions and 2 deletions

View File

@ -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,

View File

@ -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 {