Convert the Filebeat auditd module to ECS#10192
Conversation
|
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:
|
cwurm
left a comment
There was a problem hiding this comment.
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.
Are we sure terminal and tty will never be both filled? What would happen if they were?
There was a problem hiding this comment.
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
| #input: | ||
|
|
||
| #-------------------------------- Auditd Module -------------------------------- | ||
| #--------------------------------- User Module --------------------------------- |
There was a problem hiding this comment.
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.
That this comes first causes filebeat.reference.yml to change Auditd Module to User Module.
There was a problem hiding this comment.
Ah you're right, I'll fix. This file is tricky.
| #input: | ||
|
|
||
| #-------------------------------- Auditd Module -------------------------------- | ||
| #--------------------------------- User Module --------------------------------- |
|
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. |
Caveats
Newly defined fields
Renames
TODO
user.