-
Notifications
You must be signed in to change notification settings - Fork 3
Implement entity_id. Issue #155 #171
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
Conversation
|
|
|
I've decided to go for a stupidly simple entity_id, the only requirement is too be unique, so pid + boot time should be enough in linux, no point in trying to match other implementations as everyone does differently anyway. |
d5ec11a to
8175572
Compare
quark.c
Outdated
| } | ||
|
|
||
| static void | ||
| process_entity_id(struct quark_queue *qq, struct quark_process *qp) |
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 don't see qq being used. Nuke it?
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.
Good catch! I adapted from the old code and didn't realize it, will zap it.
This implements entity id as defined in https://www.elastic.co/docs/reference/ecs/ecs-process#field-process-entity-id I don't want to link with libresolv just to get b64_ntop, so include our own portable version (musl also doesn't have it). Entity id's only requirement is to be unique, so use pid number + boot time, which should be enough.
nicholasberlin
left a comment
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
This implements the 12 byte entity id as defined in https://www.elastic.co/docs/reference/ecs/ecs-process#field-process-entity-idWe can't depend on dynamic linking of md or openssl, so include a standlone MIT licensed sha256 implementation from https://github.com/ilvn/SHA256, they claim to be formally verified, so that's something.We now also have to link against resolv so we can get the base64 functions, that's ok, beats already links against it.This is a WIP as I want to make sure we compute the very same entity_id as gosysinfo and friends.