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

110 Коммитов

Автор SHA1 Сообщение Дата
Zack Mullaly 0d161acb07
Removing unused variable 2018-10-29 15:35:19 -04:00
Tristan Weir 8c24601740 Update import statements to point to github.com/mozilla/mig/ 2018-07-11 10:11:22 -07:00
Zack Mullaly 7c929b22fa Fixed format string errors that were blocking make test 2018-02-27 15:15:02 -05:00
Aaron Meihm c8f12b65f1 dispatch: rename Details to Event 2017-09-21 15:47:40 -05:00
Aaron Meihm a532a39f12 dispatch: update documentation with various new parameters for SNS 2017-09-21 15:18:13 -05:00
Aaron Meihm ea08e7ec53 dispatch: remove region configuration parameter
The region will by defaulted to the region the instance is executing in.
2017-09-21 15:17:46 -05:00
Aaron Meihm ff9f893005 dispatch: optionally format records for mozdef 2017-09-21 14:29:43 -05:00
Aaron Meihm b4949aa1fd dispatch: add start of sns output mode 2017-09-20 16:00:48 -05:00
Aaron Meihm 5a6b98887d audit: add descriptions around rate and backlog limit options in doc 2017-09-20 15:04:02 -05:00
Aaron Meihm ab29f79ae9 dispatch: generate warning if messages are being dropped 2017-09-20 15:04:02 -05:00
Aaron Meihm 263c517f1d audit: make buffering channel size configurable 2017-09-20 15:04:02 -05:00
Aaron Meihm c53ddf51c8 audit: make including raw audit message optional 2017-09-20 15:04:02 -05:00
Aaron Meihm bb845cbd1e dispatch: wrap dispatched message in record header 2017-09-20 15:00:41 -05:00
Aaron Meihm bcc795666f send tags and environment with persist module config 2017-09-20 15:00:41 -05:00
Aaron Meihm dbb9fcce39 fswatch: use new alerting channel for alerts 2017-09-20 15:00:41 -05:00
Aaron Meihm 11d8638cfa update other persistent modules for new alert channel in handler 2017-09-20 15:00:41 -05:00
Aaron Meihm 3fb3e9745d add audit and dispatch modules for Linux
This adds two new modules, audit and dispatch with additional
modifications to the agent.

The audit module can be used to read and parse the kernel audit trail on
Linux systems. The agent can then log the audit messages, or write them
to the dispatch module.

The dispatch module is a general module used for alert forwarding from
the agent. If the dispatch module is running, any alerts the agent
receives from persistent modules will be forwarded to the active
dispatch module, where the dispatch module can write the message to a
remote endpoint.
2017-09-20 15:00:41 -05:00
Aaron Meihm 463bb4896e file: fix issue with tests on darwin 2017-08-31 10:46:51 -05:00
Aaron Meihm a6f2e1c2e0 file: decompression tests 2017-08-22 12:51:27 -05:00
Aaron Meihm c47c8eecf8 file: with privacy mode enabled, mask walking errors too 2017-08-22 12:13:10 -05:00
Aaron Meihm 1de0581334 file: add test for EnhancePrivacy filter 2017-08-22 12:08:45 -05:00
Aaron Meihm ab8bc38833 file: add test case for search where root path is a symlink directory 2017-08-22 11:03:36 -05:00
Aaron Meihm 249584f2ba file: add tests for validation of module result Errors 2017-08-22 10:58:10 -05:00
Aaron Meihm 0cdae841a1 file: as part of test file system, create a directory symlink 2017-08-22 10:58:10 -05:00
Aaron Meihm 8e79038c7d file: move error conditions tests to correct section of table 2017-08-22 10:58:10 -05:00
Aaron Meihm ee8fb48c5a file: fix bug with maxerror handling when matchall was false
Don't use MaxErrors from the matched file var, as the Search field has
not been set here. Use MaxErrors from the parent Search type we are
currently inspecting checks for instead.
2017-08-22 10:37:51 -05:00
Aaron Meihm acb833472a memory: update return value ordering in some masche function calls
The hard and soft error return values were reordered in the masche
library in commit 7746414
2017-08-21 20:17:50 -05:00
Aaron Meihm 53cfc5288b add sshkey module
sshkey scans the file system on remote agents for SSH keys, and where
identified returns fingerprints for the keys.

Where private keys and public keys are identified, fingerprints will be
returned for these keys if possible.

The module also identifies authorized_keys files, and returns the
fingerprints of any public keys present in the authorized_keys file,
allowing correlation between identified public/private fingerprints and
the hosts the keys have access to.
2017-08-21 20:03:36 -05:00
Aaron Meihm 1a3fdf156f file: update maxdepth test will multiple paths 2017-08-21 19:51:55 -05:00
Aaron Meihm 6a3c7f5af7 file: don't log module output in test output 2017-08-21 19:51:55 -05:00
Aaron Meihm 96f901ece0 file: fix bug in maxdepth handling with multiple paths in a search
In cases where multiple paths are present in a single search (e.g.,
-path is used more than once with the mig command line) the maxdepth
option was not behaving correctly.

pathWalk would examine the paths in scope for a search to determine if
it should be considered. Upon finding one, it would not break out of the
loop, so depending on the ordering, the search may not be marked as
current even if it was under the root of a search path.

This was resulting in the current directory depth not being consistently
reduced upon returning from pathWalk, causing the current depth to
continuously increase for a given search.
2017-08-21 17:21:55 -05:00
Aaron Meihm d7af2513e0 file: adds matchlimit test 2017-08-21 16:58:48 -05:00
Aaron Meihm d0e77beaf8 file: honor matchlimit, uses channels for result processing
The matchlimit option to the file module was not working correctly due
to a couple reasons.

First, it relied on the Totalhits value in the module statistics to
compare the number of hits to the match limit. This value was compiled
in buildResults, so was 0 throughout module execution. Because of this
matchlimit would never be exceeded.

Also, the comparison to Totalhits was only occuring on directory entry.
This means if the match limit was hit while scanning a single directory,
it would continue to scan files exceeding the match limit.

This modifies the way results are processed by Search types, so
individual checks submit matched files via a channel to the parent
Search entry. The Search entry can then maintain a list of matches, and
increment Totalhits as required while the processing is occuring instead
of in buildResults.

Closes #382
2017-08-21 16:58:33 -05:00
Aaron Meihm 543fe004fb file: add test for MatchAll 2017-08-21 13:14:19 -05:00
Aaron Meihm 800a3508a2 file: adds tests which perform search using file as a path component 2017-08-21 13:05:53 -05:00
Aaron Meihm 349d26a0d2 file: some cleanup of tests, unify various test tables
Reworks test tables so all tests execute from a single table, and test
file system creation is separated from the individual tests themselves.
This should permit more complicated test cases. This also removes
various Linux specific path elements so the tests should work on all
platforms.
2017-08-21 12:51:49 -05:00
Aaron Meihm 700832b3d4 file: remove files created while executing tests 2017-08-21 12:51:49 -05:00
Aaron Meihm 254b2fa489 file: export member types of SearchResults
Since we need to export SearchResults, also export it's member types so
they are directly usable outside the package and visible in godoc.
2017-08-21 12:51:49 -05:00
Aaron Meihm f3a8b5f9e5 file: add comment to exported SearchResults type
SearchResults needs to be exported as it is used in modules which
reference the file module as a dependency (e.g., scribe, others).
2017-08-21 12:51:49 -05:00
Aaron Meihm 75de19cd75 file: JsonResults -> JSONResults 2017-08-21 12:51:49 -05:00
Aaron Meihm d366003445 file: remove else blocks that end in a return 2017-08-21 12:51:49 -05:00
Aaron Meihm 6ca741f255 file: remove explicit assignment of the zero value to var definitions 2017-08-21 12:51:49 -05:00
Aaron Meihm 77dccc6de5 file: don't export Parameters, which is only used locally 2017-08-21 12:51:49 -05:00
Aaron Meihm 7c12770f41 file: omit bool type declaration which is inferred 2017-08-21 12:51:49 -05:00
Aaron Meihm 40e84c67ea file: standardize package godoc comment 2017-08-21 12:51:49 -05:00
Aaron Meihm 4d60a0b6be file: don't skip adding path separator if directory entry is a symlink
If a file symlink existed in the root of a search path (e.g., /tmp was
being searched and /tmp/file was a symlink) path separators were not
being added correctly, resulting in no separator between the directory
path and the file name.

This caused subsequent checks (e.g., trying to follow and open the
symlink for content inspection) to fail, resulting in errors being
included in the module error log.
2017-08-18 15:22:44 -05:00
Aaron Meihm de41ae30a0 Merge pull request #335 from ameihm0912/yara
Yara module
2017-04-12 09:58:25 -05:00
Aaron Meihm bff54881db [minor] remove direct doc link from ping module code 2017-04-11 16:00:34 -05:00
Aaron Meihm 378dd9d8ce [doc] documentation for yara module 2017-04-03 15:35:55 -05:00
Aaron Meihm 5fd4941043 [medium] yara module, base implementation
Adds a yara module that supports scanning of files on agent systems
using yara rules. Based on go-yara.
2017-04-03 15:35:55 -05:00