Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file integrity metricset to Metricbeat audit module [WIP] #4486

Closed

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jun 9, 2017

This metricset monitors files or directories for changes. When a file is changed it will calculate a MD5, SHA1, and SHA256 hash.

metricbeat.modules:
- module: audit
  metricsets: [file]
  file.paths:
    binaries:
    - /usr/bin
    - /usr/sbin

Tested on darwin, linux, and windows.

This metricset monitors files or directories for changes. When a file is changed it will calculate a MD5, SHA1, and SHA256 hash.

```
metricbeat.modules:
- module: audit
  metricsets: [file]
  file.paths:
    binaries:
    - /usr/bin
    - /usr/sbin
```
@andrewkroh andrewkroh added enhancement in progress Pull request is currently in progress. Metricbeat Metricbeat labels Jun 9, 2017

m5 := md5.New()
s1 := sha1.New()
s256 := sha256.New()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all three, at the same time, useful/needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it depends on how you are using this info. The threat intel that I see is usually inconsistent in the hashing algorithms used. So you might get a hashes reported from one source that always provides SHA1 and another source that always provides SHA256. So for this hash matching use case it is useful to have all three.

import (
"time"

"github.com/fsnotify/fsnotify"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that we get experience with this 👍

@tsg
Copy link
Contributor

tsg commented Jun 12, 2017

Cool, just to make sure, this is not based on the Audit framework, but uses fsnotify to know when a file changes, right?

@andrewkroh
Copy link
Member Author

That's correct, this is based on inotify (linux), fsevents (macos), and ReadDirectoryChangesW (windows).

I plan to re-open this PR against auditbeat after it's merged, but I'll leave this open until then in case anyone has comments.

@andrewkroh
Copy link
Member Author

Closed in favor of #4562

@andrewkroh andrewkroh closed this Jun 27, 2017
@andrewkroh andrewkroh deleted the feature/audit-file-metricset branch July 5, 2017 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement in progress Pull request is currently in progress. Metricbeat Metricbeat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants