2017-07-20 14:47:24 +01:00
|
|
|
## cd_nagios::selinux::config.pp
|
|
|
|
|
# Module name: cd_nagios
|
|
|
|
|
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
2017-07-30 20:34:53 +01:00
|
|
|
# @summary Class manages all aspects of selinux for cd_nagios.
|
2017-07-20 14:47:24 +01:00
|
|
|
##############################################################################
|
|
|
|
|
class cd_nagios::selinux::config (
|
|
|
|
|
|
|
|
|
|
) inherits cd_nagios::params {
|
|
|
|
|
if $ng_use_selinux_tools == true {
|
2018-10-22 18:53:55 +02:00
|
|
|
require cd_selinux
|
|
|
|
|
|
2025-05-12 15:56:17 +02:00
|
|
|
# it appears that selinux behaves differently across different nodes,
|
|
|
|
|
# so all we can do for now is to create a list of the AVC alerts and come up
|
|
|
|
|
# with a solution on that later.
|
2017-07-20 17:12:18 +01:00
|
|
|
|
|
|
|
|
exec { 'create_avc_list':
|
2025-05-12 15:56:17 +02:00
|
|
|
command => 'sealert -a /var/log/audit/audit.log > avc_alerts',
|
|
|
|
|
cwd => $ng_user_home,
|
|
|
|
|
path => ['/usr/bin'],
|
|
|
|
|
creates => "${ng_user_home}/avc_alerts",
|
2017-07-20 17:12:18 +01:00
|
|
|
}
|
|
|
|
|
|
2017-07-20 17:21:09 +01:00
|
|
|
# sealert tac-cgi
|
2018-10-22 18:53:55 +02:00
|
|
|
# exec { 'create_policy_taccgi':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => template($ng_taccgi_erb),
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# user => $ng_user,
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# creates => "${ng_user_home}/my-taccgi.pp",
|
|
|
|
|
# notify => Exec['semodule_taccgi'],
|
2018-10-22 18:53:55 +02:00
|
|
|
# }
|
2017-07-20 14:47:24 +01:00
|
|
|
|
2018-10-22 18:53:55 +02:00
|
|
|
# exec { 'semodule_taccgi':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => "semodule -i ${ng_user_home}/my-taccgi.pp",
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# user => $ng_user,
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# require => Exec['create_policy_taccgi'],
|
|
|
|
|
# refreshonly => true,
|
2018-10-22 18:53:55 +02:00
|
|
|
# }
|
2017-07-20 16:15:51 +01:00
|
|
|
|
|
|
|
|
# sealert status.cgi
|
|
|
|
|
|
2018-04-29 13:22:56 +02:00
|
|
|
# exec { 'create_policy_statuscgi':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => template($ng_statcgi_erb),
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# creates => "${ng_user_home}/my-statuscgi.pp",
|
|
|
|
|
# notify => Exec['semodule_statuscgi'],
|
2018-04-29 13:22:56 +02:00
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# exec { 'semodule_statuscgi':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => 'semodule -i my-statuscgi.pp',
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# require => Exec['create_policy_statuscgi'],
|
|
|
|
|
# refreshonly => true,
|
|
|
|
|
# notify => Service[$ng_service],
|
2018-04-29 13:22:56 +02:00
|
|
|
# }
|
2017-07-30 15:40:07 +01:00
|
|
|
|
|
|
|
|
# sealert check_nrpe
|
|
|
|
|
|
2018-04-29 13:22:56 +02:00
|
|
|
# exec { 'create_policy_checknrpe':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => template($ng_checknrpe_erb),
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# creates => "${ng_user_home}/my-checknrpe.pp",
|
|
|
|
|
# notify => Exec['semodule_checknrpe'],
|
2018-04-29 13:22:56 +02:00
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# exec { 'semodule_checknrpe':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => 'semodule -i my-checknrpe.pp',
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# require => Exec['create_policy_checknrpe'],
|
|
|
|
|
# refreshonly => true,
|
|
|
|
|
# notify => Service[$ng_service],
|
2018-04-29 13:22:56 +02:00
|
|
|
# }
|
2017-07-30 15:40:07 +01:00
|
|
|
|
2025-05-12 15:56:17 +02:00
|
|
|
# sealert check_nagios
|
2017-07-30 16:00:13 +01:00
|
|
|
|
2018-04-29 13:22:56 +02:00
|
|
|
# exec { 'create_policy_checknagios':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => template($ng_checknagios_erb),
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# creates => "${ng_user_home}/my-checknagios.pp",
|
|
|
|
|
# notify => Exec['semodule_checknagios'],
|
2018-04-29 13:22:56 +02:00
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
# exec { 'semodule_checknagios':
|
2025-05-12 15:56:17 +02:00
|
|
|
# command => 'semodule -i my-checknagios.pp',
|
|
|
|
|
# path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
# cwd => $ng_user_home,
|
|
|
|
|
# require => Exec['create_policy_checknagios'],
|
|
|
|
|
# refreshonly => true,
|
|
|
|
|
# notify => Service[$ng_service],
|
2018-04-29 13:22:56 +02:00
|
|
|
# }
|
2017-09-27 14:30:48 +02:00
|
|
|
|
|
|
|
|
# sealert status.dat
|
|
|
|
|
|
|
|
|
|
exec { 'create_policy_statusdat':
|
2025-05-12 15:56:17 +02:00
|
|
|
command => template($ng_statdat_erb),
|
|
|
|
|
path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
user => $ng_user,
|
|
|
|
|
cwd => $ng_user_home,
|
|
|
|
|
creates => "${ng_user_home}/my-http.pp",
|
|
|
|
|
notify => Exec['semodule_statusdat'],
|
2017-09-27 14:30:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exec { 'semodule_statusdat':
|
2025-05-12 15:56:17 +02:00
|
|
|
command => "semodule -i ${ng_user_home}/my-httpd.pp",
|
|
|
|
|
path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
user => $ng_user,
|
|
|
|
|
cwd => $ng_user_home,
|
|
|
|
|
require => Exec['create_policy_statusdat'],
|
|
|
|
|
refreshonly => true,
|
|
|
|
|
notify => Service[$ng_service],
|
2017-09-27 14:30:48 +02:00
|
|
|
}
|
2018-04-29 13:44:55 +02:00
|
|
|
|
|
|
|
|
# sealert grep
|
|
|
|
|
|
|
|
|
|
exec { 'create_policy_grep':
|
2025-05-12 15:56:17 +02:00
|
|
|
command => template($ng_grep_erb),
|
|
|
|
|
path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
user => $ng_user,
|
|
|
|
|
cwd => $ng_user_home,
|
|
|
|
|
creates => "${ng_user_home}/my-grep.pp",
|
|
|
|
|
notify => Exec['semodule_statusdat'],
|
2018-04-29 13:44:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
exec { 'semodule_grep':
|
2025-05-12 15:56:17 +02:00
|
|
|
command => "semodule -i ${ng_user_home}/my-grep.pp",
|
|
|
|
|
path => ['/usr/bin','/usr/sbin'],
|
|
|
|
|
user => $ng_user,
|
|
|
|
|
cwd => $ng_user_home,
|
|
|
|
|
require => Exec['create_policy_grep'],
|
|
|
|
|
refreshonly => true,
|
|
|
|
|
notify => Service[$ng_service],
|
2018-04-29 13:44:55 +02:00
|
|
|
}
|
2017-07-20 14:47:24 +01:00
|
|
|
}
|
|
|
|
|
}
|