mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
Added is on password handler SSH Strategy, and refactored the traceStrategy name
This commit is contained in:
4
main.go
4
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,
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user