Bug 1822108 - /usr/libexec/netdata/plugins.d/apps.plugin is setuid root
Summary: /usr/libexec/netdata/plugins.d/apps.plugin is setuid root
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: netdata
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Didier Fabert (tartare)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-08 09:32 UTC by Juan Orti Alcaine
Modified: 2020-06-02 02:57 UTC (History)
1 user (show)

Fixed In Version: netdata-1.22.1-3.fc32 netdata-1.22.1-3.fc30 netdata-1.22.1-3.fc31 netdata-1.22.1-3.el8 netdata-1.22.1-3.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 03:12:34 UTC
Type: Bug


Attachments (Terms of Use)

Description Juan Orti Alcaine 2020-04-08 09:32:17 UTC
Description of problem:
The file /usr/libexec/netdata/plugins.d/apps.plugin is installed as setuid root, but in the Netdata documentation is stated that only the capabilities cap_dac_read_search,cap_sys_ptrace are needed.

https://docs.netdata.cloud/collectors/apps.plugin/#permissions

Version-Release number of selected component (if applicable):
netdata-1.21.0-1.fc33.x86_64

How reproducible:
Always

Steps to Reproduce:
1. dnf install netdata

Actual results:

$ ls -la /usr/libexec/netdata/plugins.d/apps.plugin
-rwsr-xr-x. 1 root root 103368 abr  7 23:47 /usr/libexec/netdata/plugins.d/apps.plugin

$ getcap -v /usr/libexec/netdata/plugins.d/apps.plugin
/usr/libexec/netdata/plugins.d/apps.plugin


Expected results:

$ ls -la /usr/libexec/netdata/plugins.d/apps.plugin
-rwxr-xr-x. 1 root root 103368 abr  7 23:47 /usr/libexec/netdata/plugins.d/apps.plugin

$ getcap -v /usr/libexec/netdata/plugins.d/apps.plugin
/usr/libexec/netdata/plugins.d/apps.plugin = cap_dac_read_search,cap_sys_ptrace+ep

Additional info:
I've not tested it, but something like this should work in the %files section:

%attr(0755,root,root) %caps(cap_dac_read_search,cap_sys_ptrace=ep) %{_libexecdir}/%{name}/plugins.d/apps.plugin

Comment 1 Juan Orti Alcaine 2020-04-09 09:43:58 UTC
I have checked that the netdata installer restricts execution of that file to others, setting the permissions of /usr/libexec/netdata/plugins.d/apps.plugin to 0750 root:netdata cap_dac_read_search,cap_sys_ptrace=ep

The netdata installer also makes other binaries root setuid, and restricted to others (4750 root:netdata)

/usr/libexec/netdata/plugins.d/slabinfo.plugin
/usr/libexec/netdata/plugins.d/ebpf_process.plugin
/usr/libexec/netdata/plugins.d/cgroup-network
/usr/libexec/netdata/plugins.d/perf.plugin

I'm not sure if those binaries require full root, but it will be worth exploring what's the minimum capabilities they need and restrict execution to the netdata group only.

Comment 2 Fedora Update System 2020-05-17 16:49:08 UTC
FEDORA-2020-aeb3b29305 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-aeb3b29305

Comment 3 Fedora Update System 2020-05-17 16:49:18 UTC
FEDORA-2020-4d87a62071 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-4d87a62071

Comment 4 Fedora Update System 2020-05-17 16:49:35 UTC
FEDORA-2020-c807d02b1f has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2020-c807d02b1f

Comment 5 Fedora Update System 2020-05-17 16:52:07 UTC
FEDORA-EPEL-2020-c3fca161ee has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-c3fca161ee

Comment 6 Fedora Update System 2020-05-17 16:52:22 UTC
FEDORA-EPEL-2020-ff11142989 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-ff11142989

Comment 7 Fedora Update System 2020-05-18 02:10:21 UTC
FEDORA-2020-aeb3b29305 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-aeb3b29305`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-aeb3b29305

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-05-18 03:11:47 UTC
FEDORA-2020-c807d02b1f has been pushed to the Fedora 30 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-c807d02b1f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-c807d02b1f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-05-18 03:12:19 UTC
FEDORA-2020-4d87a62071 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-4d87a62071`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-4d87a62071

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2020-05-18 03:38:29 UTC
FEDORA-EPEL-2020-c3fca161ee has been pushed to the Fedora EPEL 8 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-c3fca161ee

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-05-18 03:39:19 UTC
FEDORA-EPEL-2020-ff11142989 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2020-ff11142989

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2020-05-26 03:12:34 UTC
FEDORA-2020-aeb3b29305 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2020-05-26 03:17:59 UTC
FEDORA-2020-c807d02b1f has been pushed to the Fedora 30 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2020-05-26 03:20:24 UTC
FEDORA-2020-4d87a62071 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 15 Fedora Update System 2020-06-02 00:37:27 UTC
FEDORA-EPEL-2020-c3fca161ee has been pushed to the Fedora EPEL 8 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 16 Fedora Update System 2020-06-02 02:57:28 UTC
FEDORA-EPEL-2020-ff11142989 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.