-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
auditbeat/module/file_integrity: add file parsing processor #28802
Conversation
4d78099
to
f95c439
Compare
f95c439
to
3c7ee44
Compare
Query whether large test assets are OK. |
7bc083e
to
8584d29
Compare
Note that due to CVE-2021-41771 this may be unsafe to use until we are on go1.17.3. See https://groups.google.com/g/golang-dev/c/BC9Nelav6LU. |
46f8d2d
to
3b85d54
Compare
Given Plan9 is not a supported platform I can remove the tests and logic for this GOOS, instead just exiting the parser early when the obj type is plan9. This will also save test asset size. |
/test |
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
if len(fileParsers) != 0 && event.ParserResults == nil { | ||
event.ParserResults = make(common.MapStr) | ||
} | ||
for _, p := range fileParsers { | ||
err = p.Parse(event.ParserResults, path) | ||
if err != nil { | ||
event.errors = append(event.errors, err) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably have INFO level total work time logging and per processor DEBUG level work time logging.
// TODO: Implement globbing paths so that the user can write things like | ||
// "file.*.imports". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the best way to do this is to expand a RE2 pattern over the parser-available fields rather than inventing a new incomplete globbing syntax. The world already has enough of those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice enhancement. I think it would be good to explain how this feature works in the module docs. As a user I'd probably want to know:
- When are executables read? On every file change? Only when a file content hash changes?
- Does it stop reading after determining the file is not an exe format?
Can you transfer toutoumomoma into the Elastic GH org and get it setup into Jenkins.
/test |
1 similar comment
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for adding to the docs.
This is not for merging until go1.17.3 is our build tool. |
This pull request is now in conflicts. Could you fix it? 🙏
|
Hi! We're labeling this issue as |
1ca155d
to
975b7ee
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an awesome new feature. The code and docs look great. I know there is a lot of work hidden behind github.com/elastic/toutoumomoma. Leaving a few questions.
Leave improvement in code gen directives.
31ba7c6
to
05a8e2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the E2E test failure is unrelated to the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removal of flatbuffer changes LGTM
This pull request is now in conflicts. Could you fix it? 🙏
|
05a8e2a
to
a8b5dfb
Compare
a8b5dfb
to
fbebfc5
Compare
This pull request is now in conflicts. Could you fix it? 🙏
|
This adds a file parser and analyser framework along the lines of the approach described in #18048. The processor allows inspection of files visited during a scan or seen in events based on a document path configuration. A file analyser is also included that performs an analysis of executable or library object files for a variety of platforms, providing details of imports and other potential threat indicators.
What does this PR do?
This adds a file parser and analyser framework along the lines of the approach
described in #18048. The processor allows inspection of files visited
during a scan or seen in events based on a document path configuration.
A file analyser is also included that performs an analysis of executable or library
object files for a variety of platforms, providing details of imports and other
potential threat indicators.
The details shows an example event with a configuration examining elf headers.
Why is it important?
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Run
go test
in github.com/elastic/beats/auditbeat/module/file_integrityRelated issues
Use cases
See related issue.
Screenshots
N/A
Logs
N/A