powerapi-ng / hwpc-sensor

Hardware Performance Counters monitoring agent for containers.
BSD 3-Clause "New" or "Revised" License
14 stars 16 forks source link

Supports running the sensor with an unprivileged user #23

Closed gfieni closed 2 years ago

gfieni commented 2 years ago

PR overview:

Currently, the default capability set to the executable is CAP_SYS_ADMIN because most Linux LTS distributions (RHEL 7, Debian 10, Ubuntu 20.04) don't support the more restrictive CAP_PERFMON capability available since Linux 5.8. However, this capability can be set when building the image with the FILE_CAPABILITY build arg.

To run the sensor with a minimal set of capabilities with Docker:

docker run -it --rm --cap-drop ALL --cap-add CAP_SYS_ADMIN powerapi/hwpc-sensor

Close: #10