-
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
Convert the Filebeat auditd module to ECS #10192
Conversation
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.
+1 on the idea
Keeping
In essence, what I'm proposing is that the user object be defined like:
|
@cwurm Yes, I see what you mean. And to complete the part related to the group a little more, you're proposing this?
|
@webmat I saw
|
I've updated #9963 to the nested user format. Looks like this: https://github.com/elastic/beats/blob/b5319d7ed873f2d08c493781a85c963af04cfeb2/x-pack/auditbeat/module/system/process/_meta/data.json |
Ah, gotcha. Yes, this makes sense. I'll be going with this as well. |
@MikePaquette What do you think of this way of nesting user/group data, when reporting on the entities at play to determine effective rights? (See Christoph's comment above) |
When I try to move to this structure, I'm getting a mapping exception, because currently ECS defines I think we should actually consider making this change to ECS for 1.0.0 GA, and have |
To clarify, I would not go ahead and add all of these nested values for user/group IDs and names part of ECS for GA just yet. I'm proposing changing only this one field, |
I created elastic/ecs#304 to discuss this. We could get this changed and re-imported this week. In the meantime, I'll work around this and take this PR as far as it can go. |
Rebased, and temporarily introduced field name Let's see if we decide to go ahead with elastic/ecs#304, to see what we do next. |
Blocked by #10306. |
Caveat: defining temp field `user.group_` to avoid mapping error vs `user.group` which right now is a keyword field.
Not all fields are defined. Tsk tsk tsk!
Adding as aliases, of course.
… an action in Linux
Ready for final review. New tonight:
|
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 good, just two questions on mapping multiple fields into one, and a fix needed for the module header in the reference files.
dev-tools/ecs-migration.yml
Outdated
beat: filebeat | ||
|
||
- from: auditd.log.tty | ||
to: user.terminal |
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.
Are we sure terminal
and tty
will never be both filled? What would happen if they were?
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.
Yeah I agree it's not perfect. Here's what I considered:
- Based on the logs samples we have, only one of them is used at a time.
- Based on the docs I've seen, there isn't a big difference between the two (one's the "terminal", the other's the "terminal device"). I get the sense different auditd event sources use one of the two interchangeably. Even if you look for
terminal=
in the rhel7 log file, you'll see "/dev/pts/0" and "pts/0" being used interchangeably.
Another thing we could do is append it instead. So if both are set at the same time, you'll get `user.terminal: ["pts0", "/dev/pts/0"] instead of one of the two being overwritten.
Or perhaps we can leave tty where it is for now, only map terminal
to user.terminal
for now and revisit this later.
The last option seems the most straightforward in that it's making sure we don't introduce a bug (the overwrite), while still taking a step towards normalization (at least mapping terminal
).
Finally, the same potential overwrite is happening with the IP addresses. It's hard to tell from the PR body because the fields are sorted alphabetically. But in the pipeline it's more visible, as they're grouped by concern. Address manipulation is starting here
filebeat/filebeat.reference.yml
Outdated
@@ -69,7 +69,7 @@ filebeat.modules: | |||
# can be added under this section. | |||
#input: | |||
|
|||
#-------------------------------- Auditd Module -------------------------------- | |||
#--------------------------------- User Module --------------------------------- |
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.
I think this changed because the title
of the first key in fields.yml
is now User
(see https://github.com/elastic/beats/blob/master/dev-tools/mage/config.go#L245). You'll have to change the order in that file.
@@ -1,3 +1,120 @@ | |||
- key: user | |||
title: "User" |
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.
That this comes first causes filebeat.reference.yml
to change Auditd Module
to User Module
.
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.
Ah you're right, I'll fix. This file is tricky.
@@ -69,7 +69,7 @@ filebeat.modules: | |||
# can be added under this section. | |||
#input: | |||
|
|||
#-------------------------------- Auditd Module -------------------------------- | |||
#--------------------------------- User Module --------------------------------- |
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.
Same as above.
Ok, here's the latest development. The idea is to move forward a bit without introducing potential bugs. We can keep making things better later (even after 7.0, I would think).
I think it's good enough like this. The rest is incremental improvements that may require more in depth tought. |
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.
Sounds good, and LGTM.
Caveats
Newly defined fields
Renames
TODO
user.