-
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] System module: Uniquely identify processes, sockets, users, and packages #10463
Comments
Pinging @elastic/secops |
@webmat @MikePaquette Is there any ECS field that would fit this purpose? I think |
I see now that
Sort of matches, but not quite.. |
How about |
I was literally thinking to use BTW in Metricbeat's windows-service metricset we do this to create a |
I think this is uniquely identifying a process by each instance it is created, right?
Since you're using process id and start. So for example, if I run |
@FrankHassanabad yes, that's the idea |
I don't have a strong preference on the field name. Another question is what hashing algorithm we should use. Internally, the Auditbeat system module uses xxhash for change detection (e.g. to detect if a running process has already existed the last time around). However, since this use is more exposed (the value will be stored in Elasticsearch, together with other data that could be from third parties) maybe there's a case to be made for something more "standard", e.g. SHA-1 or SHA-256? SHA comes out of the box for pretty much every programming language, it's FIPS compliant, it's what other tools in the wider ecosystem accept (e.g. it's one of the file hashes Virus Total accepts), and SHA-1 is the default for the file hash in Auditbeat's |
+1 on I don't have a preference for the hash algorithm either. I agree the SHA1 will likely make troubleshooting easier. Is speed the argument for xxhash? |
I like where this discussion is going. ECS would not define what the content of this field would be, as it can be implementation-specific. For the naming of the field, I actually quite like I'll add this to the mountain of things to address officially in ECS soon ;-) |
ping @ruflin new pattern emerging ^ |
I think so. |
Ok, so how about we use |
Implements `{entity}.entity_id` as a SHA-256 hash as proposed in elastic#10463. Closes elastic#10463. (cherry picked from commit c047ef7)
While putting together dashboards for the Auditbeat system module I realized that with the current data model it's not possible to visualize the number of processes, sockets, users, and packages since there is no way to identify a unique entity.
For example, each process can and often will have multiple events of different types (when it starts, when it ends, and when it's reported by a regular state update). There's no one identifying field at the moment to count them properly: process names, executables, args, pid, ppid are all not unique. The same for sockets, users, and packages. Only the host dataset has a
host.id
field already that should be unique.I'm proposing to introduce new fields that identify those entities.
As a field name, I'm still torn between:
{entity}.id
- we already havehost.id
doing the same for hosts, but unfortunately, there isuser.id
so that wouldn't work there.{entity}.hash
- not filled anywhere afaik, so no conflicts. But doesn't follow the convention ofhost.id
.As for the value, I'm thinking a hash of some of the fields of the entity and the
host.id
:pid + start + host.id
inode + source.ip + source.port + destination.ip + destination.port + host.id
. The possibility of inode reuse with the same IP/port combinations seems remote.user.id + user.name + host.id
. At least on Linux, this is not foolproof as the user could be deleted and re-created. But I don't think there's really anything we can do since on Linux/etc/passwd
is just a text file that can be theoretically edited at will. More likely is that multiple users would share a UID ("virtual" users, some mailservers do this, e.g. Dovecot) in which case our UID to username lookup in various places would probably be off already.name + version + host.id
. I guess it would be possible to remove a package and install it with the same name and version but from a different source and we'd treat it as the same, but again I don't think there's much we can do about that. At the moment, at least.login
does not send state and so cardinality is not a problem - every event is unique. That only applies when all the data is from the system module though, not when logins are also reported by theauditd
module. For that, we would need an ID that is stable across modules. But I think we can treat that as out of scope for now.The text was updated successfully, but these errors were encountered: