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{}
|
hypertextTransferProtocolStrategy := &protocols.HypertextTransferProtocolStrategy{}
|
||||||
|
|
||||||
// Init protocol manager, with simple log on stout trace strategy and default protocol HTTP
|
// 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 {
|
for _, beelzebubServiceConfiguration := range beelzebubServicesConfiguration {
|
||||||
switch beelzebubServiceConfiguration.Protocol {
|
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{
|
log.WithFields(log.Fields{
|
||||||
"status": event.Status,
|
"status": event.Status,
|
||||||
"event": event,
|
"event": event,
|
||||||
|
@ -81,6 +81,7 @@ func (SSHStrategy *SecureShellStrategy) Init(beelzebubServiceConfiguration parse
|
|||||||
Password: password,
|
Password: password,
|
||||||
Client: ctx.ClientVersion(),
|
Client: ctx.ClientVersion(),
|
||||||
RemoteAddr: ctx.RemoteAddr().String(),
|
RemoteAddr: ctx.RemoteAddr().String(),
|
||||||
|
ID: uuid.New().String(),
|
||||||
})
|
})
|
||||||
matched, err := regexp.MatchString(beelzebubServiceConfiguration.PasswordRegex, password)
|
matched, err := regexp.MatchString(beelzebubServiceConfiguration.PasswordRegex, password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user