Skip to content

pushers: add rabbitmq#259

Closed
CapacitorSet wants to merge 2 commits into
honeytrap:masterfrom
CapacitorSet:rabbitmq
Closed

pushers: add rabbitmq#259
CapacitorSet wants to merge 2 commits into
honeytrap:masterfrom
CapacitorSet:rabbitmq

Conversation

@CapacitorSet
Copy link
Copy Markdown
Contributor

@CapacitorSet CapacitorSet commented Mar 16, 2018

Fixes #254.

Pushes JSON messages to a configurable RabbitMQ queue.

Example config:

[channel.rabbitmq]
type="rabbitmq"
address="amqp://guest:guest@localhost:5672/"
queue="honeytrap"

@nl5887
Copy link
Copy Markdown
Contributor

nl5887 commented Apr 19, 2018

Seems to be missing github.com/streadway/amqp package. But why is travis not complaining about that?

@CapacitorSet
Copy link
Copy Markdown
Contributor Author

https://travis-ci.org/honeytrap/honeytrap/jobs/365278898#L790

I think it's because go get automatically finds the import and downloads the dependency, so it doesn't need to be specified explicitly (unlike eg. with godep).

@nl5887
Copy link
Copy Markdown
Contributor

nl5887 commented Apr 22, 2018

We're using vendorized packages using dep. Could you run dep ensure to keep the vendorized packages up-to-date?

@CapacitorSet
Copy link
Copy Markdown
Contributor Author

I ran dep ensure, but now it doesn't compile because of an error in the canary code:

$ go build -v
github.com/honeytrap/honeytrap/event
github.com/honeytrap/honeytrap/vendor/github.com/glycerine/rbuf
github.com/honeytrap/honeytrap/listener/canary/arp
github.com/honeytrap/honeytrap/listener/canary/ethernet
github.com/honeytrap/honeytrap/listener/canary/icmp
github.com/honeytrap/honeytrap/listener/canary/tcp
github.com/honeytrap/honeytrap/pushers
github.com/honeytrap/honeytrap/director/lxc
github.com/honeytrap/honeytrap/director
github.com/honeytrap/honeytrap/listener
github.com/honeytrap/honeytrap/director/forward
github.com/honeytrap/honeytrap/listener/agent
github.com/honeytrap/honeytrap/listener/canary
github.com/honeytrap/honeytrap/listener/socket
github.com/honeytrap/honeytrap/listener/netstack
# github.com/honeytrap/honeytrap/listener/canary
listener/canary/canary_linux.go:984:23: c.buffer.ReadUint32 undefined (type *rbuf.FixedSizeRingBuf has no field or method ReadUint32)

I'll look into that later.

@CapacitorSet
Copy link
Copy Markdown
Contributor Author

Fixed.

@nl5887
Copy link
Copy Markdown
Contributor

nl5887 commented Apr 26, 2018

Looked up the ReadUint32 code, this is the original code:

func (b *FixedSizeRingBuf) ReadUint32() (uint32, error) {
        buff := [2]byte{}

        _, err := b.ReadAndMaybeAdvance(buff[:], true)
        if err != nil {
                return 0, err
        }

        return uint32(buff[0])<<8 + uint32(buff[1]), nil
}

Looks like that the ReadUint32 reads a Uint16 and casts it to a Uint32.

@CapacitorSet
Copy link
Copy Markdown
Contributor Author

Whoops, I'll fix that.

@CapacitorSet
Copy link
Copy Markdown
Contributor Author

Fixed.

@nl5887
Copy link
Copy Markdown
Contributor

nl5887 commented Apr 28, 2018

merged

@nl5887 nl5887 closed this Apr 28, 2018
@CapacitorSet CapacitorSet deleted the rabbitmq branch April 28, 2018 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants