Skip to content

[Auditbeat] Fix process metricset when not root#9497

Merged
cwurm merged 3 commits intoelastic:feature-auditbeat-hostfrom
cwurm:fix_process_non_root
Dec 14, 2018
Merged

[Auditbeat] Fix process metricset when not root#9497
cwurm merged 3 commits intoelastic:feature-auditbeat-hostfrom
cwurm:fix_process_non_root

Conversation

@cwurm
Copy link
Copy Markdown
Contributor

@cwurm cwurm commented Dec 11, 2018

The process metricset did not behave very well when being run as a user other than root. It would try to read the private process information of all processes on a system, and output the resulting permission errors.

This changes it to catch permission errors to allow running it as any user. It will only report on processes that are readable.

This should also allow re-enabling the unit and system test that were failing in CI.

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/secops

Copy link
Copy Markdown
Contributor

@webmat webmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Straightforward, love it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@cwurm cwurm force-pushed the fix_process_non_root branch from 4a4bf94 to 65fc87b Compare December 14, 2018 10:29
@cwurm cwurm merged commit 9a680f7 into elastic:feature-auditbeat-host Dec 14, 2018
cwurm pushed a commit to cwurm/beats that referenced this pull request Dec 16, 2018
Allow the `process` metricset to run as any user by catching permission errors when trying to read other user's private process information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants