52 lines
948 B
Puppet
52 lines
948 B
Puppet
|
|
# Set SELinux boolean value
|
|
#
|
|
# === Parameters
|
|
#
|
|
# $name:
|
|
# SELinux key to set
|
|
# $value:
|
|
# Value for given key (on or off)
|
|
#
|
|
# === Sample usage
|
|
#
|
|
# selinux::boolean { "use_nfs_home_dirs":
|
|
# value => "on",
|
|
# }
|
|
#
|
|
define selinux::boolean($value) {
|
|
|
|
selboolean { $name:
|
|
value => $value,
|
|
persistent => true,
|
|
}
|
|
|
|
}
|
|
|
|
|
|
# Configure SELinux port authorizations
|
|
#
|
|
# === Parameters
|
|
#
|
|
# $name:
|
|
# Port range to configure
|
|
# $type:
|
|
# SELinux type for port range
|
|
# $proto:
|
|
# Protocol for port (tcp or udp)
|
|
#
|
|
# === Sample usage
|
|
#
|
|
# selinux::manage_port { "18140-18143":
|
|
# type => "http_port_t",
|
|
# proto => "tcp",
|
|
# }
|
|
#
|
|
define selinux::manage_port($type, $proto) {
|
|
|
|
exec { "semanage port -a -t ${type} -p ${proto} ${name}":
|
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
|
unless => "semanage port -ln | egrep '^${type}[ ]*${proto}' | egrep ' ${name}(,.*)?\$'",
|
|
}
|
|
|
|
}
|