Bug 1574735

Summary: SELinux is preventing cgconfigparser from using the 'dac_override' capabilities.
Product: [Fedora] Fedora Reporter: Davide Repetto <red>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: dwalsh, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:cccdaf0607d53c4e5c7434d3adeb300e813c0359f5005adc19e48da4c3081a05;
Fixed In Version: selinux-policy-3.14.1-29.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-26 20:45:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Davide Repetto 2018-05-03 22:09:00 UTC
Description of problem:
I have this in /etc/cgconfig.con and I havve enabled cgconfig.service.

After updating to F28 it stopped working, I suppose, because of problems with selinux.

Strangely though, parsing the file manually works as expected (cgconfigparser -l /etc/cgconfig.conf) and creates the cgroup.


==========================================================
mag 04 00:01:39 dave.idp.it python3[4662]: SELinux is preventing cgconfigparser from using the dac_override capability.
                                           
                                           *****  Plugin dac_override (91.4 confidence) suggests   **********************
                                           
                                           If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
                                           Then turn on full auditing to get path information about the offending file and generate the error again.
                                           Do
                                           
                                           Turn on full auditing
                                           # auditctl -w /etc/shadow -p w
                                           Try to recreate AVC. Then execute
                                           # ausearch -m avc -ts recent
                                           If you see PATH record check ownership/permissions on file, and fix it,
                                           otherwise report as a bugzilla.
                                           
                                           *****  Plugin catchall (9.59 confidence) suggests   **************************
                                           
                                           If you believe that cgconfigparser should have the dac_override capability by default.
                                           Then you should report this as a bug.
                                           You can generate a local policy module to allow this access.
                                           Do
                                           allow this access for now by executing:
                                           # ausearch -c 'cgconfigparser' --raw | audit2allow -M my-cgconfigparser
                                           # semodule -X 300 -i my-cgconfigparser.pp
                                           
mag 04 00:01:39 dave.idp.it setroubleshoot[4662]: SELinux is preventing cgconfigparser from using the dac_override capability. For complete SELinux messages run: sealert -l eb3017f0-c77d-4a5e-b644-b9c562488bc2
mag 04 00:01:39 dave.idp.it python3[4662]: SELinux is preventing cgconfigparser from using the dac_override capability.
                                           
                                           *****  Plugin dac_override (91.4 confidence) suggests   **********************
                                           
                                           If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
                                           Then turn on full auditing to get path information about the offending file and generate the error again.
                                           Do
                                           
                                           Turn on full auditing
                                           # auditctl -w /etc/shadow -p w
                                           Try to recreate AVC. Then execute
                                           # ausearch -m avc -ts recent
                                           If you see PATH record check ownership/permissions on file, and fix it,
                                           otherwise report as a bugzilla.
                                           
                                           *****  Plugin catchall (9.59 confidence) suggests   **************************
                                           
                                           If you believe that cgconfigparser should have the dac_override capability by default.
                                           Then you should report this as a bug.
                                           You can generate a local policy module to allow this access.
                                           Do
                                           allow this access for now by executing:
                                           # ausearch -c 'cgconfigparser' --raw | audit2allow -M my-cgconfigparser
                                           # semodule -X 300 -i my-cgconfigparser.pp
                                           
SELinux is preventing cgconfigparser from using the 'dac_override' capabilities.

*****  Plugin dac_override (91.4 confidence) suggests   **********************

If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system
Then attivare l'auditing completo per ottenere le informazioni del percorso del file incriminato e generare nuovamente l'errore.
Do

Attivare il controllo completo auditing
# auditctl -w /etc/shadow -p w
Provare a ricreare AVC. Eseguire quindi
# ausearch -m avc -ts recent
Qualora si noti il record PATH, controllare la proprietà/i permessi sul file e correggerli,
altrimenti registrare un bugzilla.

*****  Plugin catchall (9.59 confidence) suggests   **************************

If you believe that cgconfigparser should have the dac_override capability by default.
Then si dovrebbe riportare il problema come bug.
E' possibile generare un modulo di politica locale per consentire questo accesso.
Do
allow this access for now by executing:
# ausearch -c 'cgconfigparser' --raw | audit2allow -M my-cgconfigparser
# semodule -X 300 -i my-cgconfigparser.pp

Additional Information:
Source Context                system_u:system_r:cgconfig_t:s0
Target Context                system_u:system_r:cgconfig_t:s0
Target Objects                Unknown [ capability ]
Source                        cgconfigparser
Source Path                   cgconfigparser
Port                          <Sconosciuto>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.14.1-24.fc28.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.16.5-300.fc28.x86_64 #1 SMP Fri
                              Apr 27 17:38:36 UTC 2018 x86_64 x86_64
Alert Count                   2
First Seen                    2018-05-04 00:01:35 CEST
Last Seen                     2018-05-04 00:01:35 CEST
Local ID                      eb3017f0-c77d-4a5e-b644-b9c562488bc2

Raw Audit Messages
type=AVC msg=audit(1525384895.623:142): avc:  denied  { dac_override } for  pid=4659 comm="cgconfigparser" capability=1  scontext=system_u:system_r:cgconfig_t:s0 tcontext=system_u:system_r:cgconfig_t:s0 tclass=capability permissive=0


Hash: cgconfigparser,cgconfig_t,cgconfig_t,capability,dac_override

Version-Release number of selected component:
selinux-policy-3.14.1-24.fc28.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.5
hashmarkername: setroubleshoot
kernel:         4.16.5-300.fc28.x86_64
type:           libreport

Comment 1 Fedora Update System 2018-05-24 14:37:52 UTC
selinux-policy-3.14.1-29.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-a74875b364

Comment 2 Fedora Update System 2018-05-25 18:43:40 UTC
selinux-policy-3.14.1-29.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-a74875b364

Comment 3 Fedora Update System 2018-05-26 20:45:27 UTC
selinux-policy-3.14.1-29.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.