Я сталкиваюсь с проблемой каждый раз, когда пытаюсь запустить службу puppetmasterd, для чего получаю следующее сообщение об ошибке:
root@service1 ~ # -> /etc/init.d/puppetmaster start
Starting puppetmaster: Could not prepare for execution: Got 1 failure(s) while initializing: change from absent to directory failed: Could not set 'directory on ensure: Permission denied - /etc/puppet/ssl
[FAILED]
По-видимому, в этом сценарии была известная проблема, описанная в этом отчет об ошибке, однако в отчете об ошибке говорится, что проблема была решена в selinux-policy-3.9.16-29.fc15
, но последняя исходная версия CentOS по умолчанию 3.7.19-155.el6_3.4
. Итак, я пытаюсь найти лучшее решение.
Я могу либо создать локальную политику безопасности, чтобы предоставить puppetmasterd необходимый доступ, либо продолжить исследование и установить новую версию selinux-policy за пределами восходящего канала по умолчанию. У кого-нибудь есть рекомендации? Пожалуйста, не рекомендуйте отключать SELinux ...
----- Обновить -----
Вот файл puppet.conf:
[main]
# The Puppet log directory.
# The default value is '$vardir/log'.
logdir = /var/log/puppet
# Where Puppet PID files are kept.
# The default value is '$vardir/run'.
rundir = /var/run/puppet
# Where SSL certificates are kept.
# The default value is '$confdir/ssl'.
ssldir = $vardir/ssl
[master]
certname=puppetmaster.ownij.lan
dns_alt_names=puppetmaster.ownij.lan
[agent]
# The file in which puppetd stores a list of the classes
# associated with the retrieved configuratiion. Can be loaded in
# the separate ``puppet`` executable using the ``--loadclasses``
# option.
# The default value is '$confdir/classes.txt'.
classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
server=puppetmaster.ownij.lan
И вот отказы по журналу аудита:
type=AVC msg=audit(1349751364.985:666): avc: denied { search } for pid=15093 comm="puppetmasterd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:puppetmaster_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1349751364.985:666): arch=c000003e syscall=4 success=no exit=-13 a0=1391420 a1=7fffef09ed10 a2=7fffef09ed10 a3=120c500 items=0 ppid=15092 pid=15093 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=13 comm="puppetmasterd" exe="/usr/bin/ruby" subj=unconfined_u:system_r:puppetmaster_t:s0 key=(null)
type=AVC msg=audit(1349751365.302:667): avc: denied { search } for pid=15093 comm="puppetmasterd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:puppetmaster_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1349751365.302:667): arch=c000003e syscall=4 success=no exit=-13 a0=1d18530 a1=7fffef0d04d0 a2=7fffef0d04d0 a3=8 items=0 ppid=15092 pid=15093 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=13 comm="puppetmasterd" exe="/usr/bin/ruby" subj=unconfined_u:system_r:puppetmaster_t:s0 key=(null)
type=AVC msg=audit(1349751365.465:668): avc: denied { search } for pid=15093 comm="puppetmasterd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:puppetmaster_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1349751365.465:668): arch=c000003e syscall=4 success=no exit=-13 a0=1af3930 a1=7fffef0c5c70 a2=7fffef0c5c70 a3=8 items=0 ppid=15092 pid=15093 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=13 comm="puppetmasterd" exe="/usr/bin/ruby" subj=unconfined_u:system_r:puppetmaster_t:s0 key=(null)
type=AVC msg=audit(1349751365.467:669): avc: denied { search } for pid=15093 comm="puppetmasterd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:puppetmaster_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
type=SYSCALL msg=audit(1349751365.467:669): arch=c000003e syscall=4 success=no exit=-13 a0=1b17aa0 a1=7fffef0c5c70 a2=7fffef0c5c70 a3=8 items=0 ppid=15092 pid=15093 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=13 comm="puppetmasterd" exe="/usr/bin/ruby" subj=unconfined_u:system_r:puppetmaster_t:s0 key=(null)
type=AVC msg=audit(1349751366.401:670): avc: denied { write } for pid=15093 comm="puppetmasterd" name="puppet" dev=dm-0 ino=132035 scontext=unconfined_u:system_r:puppetmaster_t:s0 tcontext=system_u:object_r:puppet_etc_t:s0 tclass=dir
type=SYSCALL msg=audit(1349751366.401:670): arch=c000003e syscall=83 success=no exit=-13 a0=2d7a400 a1=1f9 a2=2d7a40f a3=7fffef0a6df0 items=0 ppid=15092 pid=15093 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=13 comm="puppetmasterd" exe="/usr/bin/ruby" subj=unconfined_u:system_r:puppetmaster_t:s0 key=(null)
И журнал аудита, если я прохожу audit2allow:
root@service1 ~ # -> fgrep puppetmasterd /var/log/audit/audit.log | audit2allow -m puppetmasterd
module puppetmasterd 1.0;
require {
type home_root_t;
type puppetmaster_t;
type puppet_etc_t;
type puppet_var_run_t;
type httpd_sys_content_t;
class lnk_file { relabelfrom relabelto };
class file { relabelfrom read getattr open };
class dir { write read search getattr setattr };
}
#============= puppetmaster_t ==============
allow puppetmaster_t home_root_t:dir { search getattr };
allow puppetmaster_t httpd_sys_content_t:dir read;
allow puppetmaster_t httpd_sys_content_t:file { read getattr open };
#!!!! The source type 'puppetmaster_t' can write to a 'dir' of the following types:
# puppet_log_t, puppet_var_lib_t, puppet_var_run_t, puppetmaster_tmp_t
allow puppetmaster_t puppet_etc_t:dir { write setattr };
allow puppetmaster_t puppet_etc_t:lnk_file { relabelfrom relabelto };
allow puppetmaster_t puppet_var_run_t:file relabelfrom;
Вы используете местоположение по умолчанию для $ssldir
- Какой ваш puppet.conf
выглядит как?
В развертывании Puppet по умолчанию на производных RHEL есть puppet.conf
примерно так:
[main]
ssldir = /var/lib/puppet/ssl
Если вы вернете это на место, у политики SELinux не должно быть проблем с расположением вашего каталога SSL.