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

60 Коммитов

Автор SHA1 Сообщение Дата
Aaron Meihm dba7d958de [minor] add default fswatch profiles for darwin/windows, currently empty 2017-02-27 17:00:58 -06:00
Aaron Meihm dddd044688 [doc] fix typo in fswatch documentation 2017-02-27 16:59:24 -06:00
Aaron Meihm 0072184fd7 [doc] add documentation for fswatch module 2017-02-27 16:54:44 -06:00
Aaron Meihm b9bf973b19 [minor] ignore paths in walk we encounter an error entering 2017-02-27 15:48:45 -06:00
Aaron Meihm 95ca0f14a0 [minor] fswatch support for module config file for monitoring paths 2017-02-27 15:28:00 -06:00
Aaron Meihm a2d8334a90 [medium] update fswatch to use platform specific notification mechanisms
makes use of fsnotify to utilize os file system notification mechanisms
(e.g., inotify) rather than periodic polling for changes.
2017-02-27 14:58:37 -06:00
Aaron Meihm 6fc175c94c [medium] addition of fswatch module
fswatch is a simple file system monitoring module that takes advantage
of the persistent module framework in MIG to do continuous file
integrity scans of specific paths on the file system. When changes are
detected, alerts are generated and appear in the agent's log file.
2017-02-27 14:57:36 -06:00
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 bbd4b8d2e4 [minor] remove upgrade module and additional references to module 2016-12-21 15:08:49 -06:00
Aaron Meihm bfec483d5c [medium] persistent module config file support
Adds the ability for persistent modules to read a configuration file
that can be used to control their behavior.

In some cases, we may want a persistent module to be configurable. A new
configuration variable PERSISTCONFIGDIR has been added which indicates a
directory the agent will look in for persistent module configs. When the
agent starts a persistent module, it will determine if modulename.cfg
exists in the config directory; if so the agent will load the config and
send it to the newly executed module, which it will read on stdin. The
module can then read this configuration, and configure itself as needed
before it begins it's primary execution functions.

Modules specify the configuration format within the module code itself,
so each module that makes use of this can have it's own configuration
parameters.
2016-12-16 15:42:16 -06: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 73acf16f96 [minor] document examplepersist and other persistent mod code added 2016-10-18 11:48:39 -05:00
Aaron Meihm 192860ae0e [minor] dynamic socket registration for persistent modules
We will want to use different socket types for persistent module
communication depending on the platform, e.g., unix sockets are not
available on Windows. This adds support for more dynamic registration of
the socket for a given running module. When the persistent module is
initialized, we allocate the listener and then notify the agent where we
area listening, so queries can dial the address as needed.
2016-10-17 15:47:30 -05:00
Aaron Meihm f6117e782e [minor] improve error handling in module stream io 2016-10-14 13:15:00 -05:00
Aaron Meihm f758ee2594 [minor] remove extra sleep 2016-10-09 00:01:11 -05:00
Aaron Meihm 2c10c2928f [minor] add an example persistent module 2016-10-08 23:38:20 -05:00
Aaron Meihm 33ac7d9ff6 [major] add support for persistent modules
Persistent modules are modules that are executed continuously by the
agent. They can perform background tasks, and can be queried using
mig-cmd or mig-console in the same way as regular modules.

The modules are executed by the agent on startup, and a management
channel is used to validate the module is running and collect logs from
the module.

Queries into the persistent module are handled initially through the
same code path as a normal module query; but in the case of a persistent
module an adapter is used to simulate the module IO and collect results
using a domain socket.
2016-10-08 23:29:48 -05:00
Aaron Meihm 853112bafc [minor] epm implementation for scribe module 2016-08-29 14:06:51 -05:00
Aaron Meihm e27686218e [minor] epm implementation for netstat module 2016-08-29 14:06:51 -05:00
Aaron Meihm e93187cfd6 [minor] epm implementation for file module 2016-08-29 14:06:51 -05:00
Aaron Meihm b1f1543e67 [minor] agent epm implementation
EPM (extra privacy mode) is an agent option that if enabled, will
inform modules they should apply additional masking on returned results.

For example, by default if the file module matches a search, the name of
the matching file will be returned. With this enabled, it may inform the
investigator that something on the system matched, but will not provide
meta-data.
2016-08-29 14:06:45 -05:00
Aaron Meihm 070fba3b4a [minor] handle pkg version invert using !, remove additional flag
Handles inverting version filter logic in similar manner to file module
content flag.
2016-05-24 14:03:55 -05:00
Aaron Meihm 38e0202cc6 [minor] optionally invert version filtering logic in pkg module 2016-05-22 14:19:05 -05:00
Aaron Meihm 360f1cbc64 [minor] support filtering by version in pkg module
Closes #182
2016-05-22 14:07:00 -05:00
Julien Vehent 54cc5c2fde [minor] type in file's buildResults 2016-05-09 12:56:43 -04:00
Julien Vehent 293a63e2d8 [minor] various nits on file module 2016-05-08 09:07:19 -04:00
Julien Vehent 2d54479a6a [minor] make 0 mean 'unlimited' in file module's maxdepth and matchlimit options 2016-05-08 09:06:16 -04:00
Julien Vehent 106090bb2c [minor] limit walking errors returned by file module, fixes #227 2016-05-08 09:04:40 -04:00
Yves AGOSTINI 9c55e4bdbe [medium/bug] windows bug in pathwalk, fixes #213 2016-05-02 09:12:29 +02: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
Julien Vehent 87ef301263 [minor] update location of scribe package 2016-03-18 15:14:30 -04:00
Arun Sori 50a787fb59 [minor] Fixes #144: Add NeighborIP functionality on linux 2016-03-14 19:44:00 +05:30
Aaron Meihm c128226f35 [minor/bug] remove some extra arguments causing problems in file help 2016-01-25 09:57:33 -06:00
Aaron Meihm 853d722a83 [medium] introduce optional action compression between client and agent 2016-01-22 10:33:52 -06:00
Kishor Bhat f722f992ae [medium] Decompress files before content inspect, resolves #108 2016-01-14 21:48:51 +05:30
Kishor Bhat bd13251564 [medium] unify hashes under sha2/sha3, fixes #155 2016-01-14 16:42:06 +05:30
Aaron Meihm a973b39368 [medium] add a runner plugin to process incoming scribe results 2016-01-13 14:03:33 -06:00
Aaron Meihm 4452b4ac31 [minor] include architecture in pkg module output
closes #168
2016-01-13 11:43:51 -06:00
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
Harry Jeffery 381c6e2616 [minor] use servers in /etc/ntp.conf for timedrift, fixes #116
Instead of picking ntp servers randomly from a hardcoded list we now
prepend our hardcoded list with the servers defined in /etc/ntp.conf and
then try each server sequentially until we find one that works.
2015-10-19 16:30:15 +01:00
Aaron Meihm 2e484240f9 [minor] issue in file module help with missing optional dash 2015-10-09 10:18:57 -05:00
Aaron Meihm 18a946c45c [doc] update file module docs to include returnsha256 option 2015-10-09 09:58:23 -05:00
Aaron Meihm 46d04aa60f [minor] clarify option names for file return hash 2015-10-09 09:54:34 -05:00
Aaron Meihm 54629efe85 [minor] add optional hashing for file module results
If the -hash option is present, include the SHA256 sum of the matched
file as part of the file info.
2015-10-07 16:47:29 -05:00
Julien Vehent 76f33f2dea [minor] Add base Version in MIG package, overrided by Makefile 2015-09-24 08:54:07 -04:00
Julien Vehent c046f407f9 [minor] fix filepath comparison in file module tests 2015-09-02 10:58:59 -04:00