Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Aaron Meihm 84169977b8 Merge branch 'master' into issue-291-win-netstat 2016-12-22 15:06:53 -06:00
Rob Murtha 77dae55003 [medium] netstat windows support
closes #291
2016-12-22 11:31:47 -05:00
Aaron Meihm 7ca2887a98 [medium/bug] resolve bufio issues under high agent/module comms
When a message between a module and the agent is read by either,
ReadInput is used which uses buffered IO to read a single line. A bug
existed here where a new bufio Reader was being allocated each time.

Under normal circumstances there would be no issue, since a single line
is generally sent to the module from the agent and read. However, in a
case where a large number of messages were being exchanged between the
agent and the module (e.g., persistent modules) it was possible the
bufio reader could have buffered more than one line. Since a new buffer
was being allocated each time, this resulted in loss of partial message
data, and usually ended up generating JSON unmarshaling errors since
part of the JSON structure was missing.

This was resolved by introducing a new ModuleReader and ModuleWriter
type that is used to read/write between the agent and modules.
ModuleReader allocates the buffered reader on creation once, so we only
ever have the single buffered reader for the lifetime of the module
execution.
2016-12-16 09:55:21 -06:00
Aaron Meihm e27686218e [minor] epm implementation for netstat module 2016-08-29 14:06:51 -05:00
Aaron Meihm 212e131291 [minor/bug] correctly set ipmask in darwin netstat module HasIPConnected
net.ParseIP will return IPv4 addresses as a 16 byte value (result comes
from net.IPv4()). Rather than use the length of the return value, try to
convert it to an IPv4 address to test the address family and set the
mask accordingly.

Closes #187
2016-04-27 21:42:52 -05:00
Aaron Meihm ad8eccecb0 [minor] netstat module on linux, look for ipv4 mapped ipv6 addresses
Connections to for example tcp6 sockets are stored in IPv6 related /proc
net files (e.g., /proc/net/tcp6). Also scan these files when searching
for an IPv4 address.
2016-04-27 21:42:45 -05:00
Aaron Meihm 1689b39ca5 [minor/bug] fix hexToIP6 inet6 conversion of proc hex addresses
hexToIP6 was handling hex inet6 addresses as found in /proc/net/tcp6 in
the same way as inet. They need to be handled a bit differently; now
convert address in groups of 4 byte words where each word is reversed.
2016-04-27 21:42:29 -05:00
Aaron Meihm 9b96dc19a0 [minor/bug] add stub functions for HasSeenIP for darwin and windows
These functions need to be implemented, but this fixes current build
errors on these platforms.

Closes #199
2016-03-24 19:00:32 -05:00
Arun Sori 50a787fb59 [minor] Fixes #144: Add NeighborIP functionality on linux 2016-03-14 19:44:00 +05:30
Aaron Meihm 94ac7cbf54 [medium] modify netstat module to better handle network namespaces
This adds an option (-namespaces) that triggers interrogation of network
activity using /proc/<pid>/net/* vs. /proc/net/*. This has the advantage
that it gives an agent visibility of network communcations related to
all namespaces on the system, vs. just the default namespace. Previously
if a process had connections active in another namespace, they would not
be visible to MIG.

At this time the functionality is optional, but may be moved to the
default in the future.
2015-11-04 10:54:15 -06:00
Julien Vehent 200a5a6164 [doc] add newline after license header to ignore it in godoc 2015-08-27 10:41:13 -04:00
Julien Vehent 91928a9fcd [minor] add import comment to packages declarations 2015-08-26 14:15:40 -04:00
Julien Vehent e9aa7febf9 [major] reorganize repository structure for `go get mig.ninja/mig`
This is a major change to the structure of the repository and the Makefile,
but a minor change in terms of functionalities. It simply changes the structure
of the directories to be compliant with Go's idiomatic build methods.

I also bought the domain `mig.ninja` and will now be using that as
a standard import path for everything. The magic to serve everything
under mig.ninja/mig will be documented elsewhere.
2015-08-25 18:01:22 -04:00