Bug 1278615 - puppetmaster does not start due to SELinux denial
puppetmaster does not start due to SELinux denial
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: puppet (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jeroen van Meeuwen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-05 20:17 EST by Tim Landscheidt
Modified: 2016-12-20 10:26 EST (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-12-20 10:26:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tim Landscheidt 2015-11-05 20:17:50 EST
Description of problem:

On a fresh install of Fedora 23 and the package "puppet-server", "systemctl start puppetmaster" fails.


Version-Release number of selected component (if applicable):

puppet-server-4.2.1-2.fc23.noarch
selinux-policy-targeted-3.13.1-152.fc23.noarch


How reproducible:

Always.


Steps to Reproduce:
1. (Uninstall puppet-server && rm -Rf /etc/puppet.)
2. "dnf install puppet-server"
3. "systemctl start puppetmaster"


Actual results:

Nov  6 00:48:41 passepartout systemd: Started Puppet master.
Nov  6 00:48:41 passepartout audit: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=puppetmaster comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Nov  6 00:48:41 passepartout systemd: Starting Puppet master...
Nov  6 00:48:43 passepartout audit: AVC avc:  denied  { write } for  pid=4301 comm="ruby-mri" name="puppet" dev="dm-1" ino=1316122 scontext=system_u:system_r:puppetmaster_t:s0 tcontext=system_u:object_r:puppet_etc_t:s0 tclass=dir permissive=0
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;31mError: Could not set 'directory' on ensure: Permission denied @ dir_s_mkdir - /etc/puppet/ssl#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;31mError: Could not set 'directory' on ensure: Permission denied @ dir_s_mkdir - /etc/puppet/ssl
Nov  6 00:48:43 passepartout start-puppet-master: Wrapped exception:
Nov  6 00:48:43 passepartout start-puppet-master: Permission denied @ dir_s_mkdir - /etc/puppet/ssl#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;31mError: /File[/etc/puppet/ssl]/ensure: change from absent to directory failed: Could not set 'directory' on ensure: Permission denied @ dir_s_mkdir - /etc/puppet/ssl#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[mNotice: /File[/etc/puppet/ssl/certs]: Dependency File[/etc/puppet/ssl] has failures: true#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;33mWarning: /File[/etc/puppet/ssl/certs]: Skipping because of failed dependencies#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[mNotice: /File[/etc/puppet/ssl/public_keys]: Dependency File[/etc/puppet/ssl] has failures: true#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;33mWarning: /File[/etc/puppet/ssl/public_keys]: Skipping because of failed dependencies#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[mNotice: /File[/etc/puppet/ssl/certificate_requests]: Dependency File[/etc/puppet/ssl] has failures: true#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;33mWarning: /File[/etc/puppet/ssl/certificate_requests]: Skipping because of failed dependencies#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[mNotice: /File[/etc/puppet/ssl/private_keys]: Dependency File[/etc/puppet/ssl] has failures: true#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;33mWarning: /File[/etc/puppet/ssl/private_keys]: Skipping because of failed dependencies#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[mNotice: /File[/etc/puppet/ssl/private]: Dependency File[/etc/puppet/ssl] has failures: true#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;33mWarning: /File[/etc/puppet/ssl/private]: Skipping because of failed dependencies#033[0m
Nov  6 00:48:43 passepartout start-puppet-master: #033[1;31mError: Could not prepare for execution: Got 1 failure(s) while initializing: File[/etc/puppet/ssl]: change from absent to directory failed: Could not set 'directory' on ensure: Permission denied @ dir_s_mkdir - /etc/puppet/ssl#033[0m
Nov  6 00:48:43 passepartout systemd: puppetmaster.service: Main process exited, code=exited, status=1/FAILURE
Nov  6 00:48:43 passepartout audit: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=puppetmaster comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Nov  6 00:48:43 passepartout systemd: puppetmaster.service: Unit entered failed state.
Nov  6 00:48:43 passepartout systemd: puppetmaster.service: Failed with result 'exit-code'.



Expected results:

puppetmaster starts.


Additional info:

I'm unsure whether the better solution would be to amend the SELinux policy to let puppetmaster create those directories or ship them (empty) as part of the package and then only allow puppetmaster to create/modify/delete files underneath them.
Comment 1 Lukas Zapletal 2015-11-09 09:38:24 EST
Hello, if you create those, will it work? Maybe we can fix this in the package by creating those missing directories.
Comment 2 Tim Landscheidt 2015-11-09 21:32:20 EST
I tried creating those directories and setting their permissions, but came to an impasse when I then tried to run "puppet agent --noop" and it failed on trying to create /etc/puppet/ssl/private_keys/$hostname.

I then tried "semanage fcontext -a -t puppet_var_lib_t /etc/puppet/ssl" to make that directory more "permissive", but (after "restorecon -Rv /etc/puppet/ssl") puppetmaster wanted to set the context first to system_u:object_r:puppet_etc_t:s0 and then to unconfined_u:object_r:puppet_var_lib_t:s0.

I then set "ssldir" to "/var/lib/puppet/ssl" in an otherwise empty /etc/puppet/puppet.conf to "reverse" the effects of https://docs.puppetlabs.com/puppet/4.2/reference/whered_it_go.html and puppetmaster started successfully and "puppet agent --noop" seems to work (didn't actually test manifests).

So I think the SELinux policy needs to be amended.  (NB: I tested the above on my live system; for better diagnosis a VM is probably more appropriate :-).)
Comment 3 Fedora End Of Life 2016-11-24 08:07:20 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 4 Fedora End Of Life 2016-12-20 10:26:16 EST
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

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