diff --git a/kitchen/Puppetfile b/kitchen/Puppetfile index b9d36bd1..3c8119c2 100644 --- a/kitchen/Puppetfile +++ b/kitchen/Puppetfile @@ -24,3 +24,6 @@ mod "wazuh/wazuh" # A module from Github pre-packaged tarball # mod 'puppetlabs-apache', '0.6.0', :github_tarball => 'puppetlabs/puppetlabs-apache' + +# A module for configure zypper repo +# mod 'puppet-zypprepo', '4.0.1' diff --git a/manifests/agent.pp b/manifests/agent.pp index 9f320888..82416015 100644 --- a/manifests/agent.pp +++ b/manifests/agent.pp @@ -318,7 +318,7 @@ 'Linux': { ## ossec.conf generation concats case $::operatingsystem { - 'RedHat', 'OracleLinux':{ + 'RedHat', 'OracleLinux', 'Suse':{ $apply_template_os = 'rhel' if ( $::operatingsystemrelease =~ /^9.*/ ){ $rhel_version = '9' @@ -342,6 +342,8 @@ $apply_template_os = 'amazon' }'CentOS','Centos','centos','AlmaLinux':{ $apply_template_os = 'centos' + }'SLES':{ + $apply_template_os = 'suse' } default: { fail('OS not supported') } } diff --git a/manifests/params_agent.pp b/manifests/params_agent.pp index 0dce64a4..4b8f7b50 100644 --- a/manifests/params_agent.pp +++ b/manifests/params_agent.pp @@ -466,6 +466,25 @@ default: { fail('This ossec module has not been tested on your distribution') } } } + 'Suse': { + $service_has_status = true + + $default_local_files = [ + { 'location' => '/var/log/audit/audit.log', 'log_format' => 'audit' }, + { 'location' => '/var/ossec/logs/active-responses.log', 'log_format' => 'syslog' }, + { 'location' => '/var/log/messages', 'log_format' => 'syslog' }, + { 'location' => '/var/log/secure', 'log_format' => 'syslog' }, + { 'location' => '/var/log/maillog', 'log_format' => 'syslog' }, + ] + case $::operatingsystem { + 'SLES': { + if ( $::operatingsystemrelease =~ /^(12|15).*/ ) { + $ossec_service_provider = 'redhat' + } + } + default: { fail('This ossec module has not been tested on your distribution') } + } + } default: { fail('This ossec module has not been tested on your distribution') } } } diff --git a/manifests/params_manager.pp b/manifests/params_manager.pp index bd7960cd..9a050a28 100644 --- a/manifests/params_manager.pp +++ b/manifests/params_manager.pp @@ -551,6 +551,31 @@ default: { fail('This ossec module has not been tested on your distribution') } } } + 'Suse': { + + $agent_service = 'wazuh-agent' + $agent_package = 'wazuh-agent' + $server_service = 'wazuh-manager' + $server_package = 'wazuh-manager' + $service_has_status = true + + $default_local_files =[ + { 'location' => '/var/log/audit/audit.log' , 'log_format' => 'audit'}, + { 'location' => '/var/ossec/logs/active-responses.log' , 'log_format' => 'syslog'}, + { 'location' => '/var/log/messages', 'log_format' => 'syslog'}, + { 'location' => '/var/log/secure' , 'log_format' => 'syslog'}, + { 'location' => '/var/log/maillog' , 'log_format' => 'syslog'}, + ] + case $::operatingsystem { + 'SLES': { + if ( $::operatingsystemrelease =~ /^(12|15).*/ ) { + $ossec_service_provider = 'redhat' + $api_service_provider = 'redhat' + } + } + default: { fail('This ossec module has not been tested on your distribution') } + } + } default: { fail('This ossec module has not been tested on your distribution') } } } diff --git a/manifests/repo.pp b/manifests/repo.pp index ded4a4b5..4b372751 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -33,9 +33,9 @@ default: { fail('This ossec module has not been tested on your distribution (or lsb package not installed)') } } } - 'Linux', 'RedHat' : { + 'Linux', 'RedHat', 'Suse' : { case $::os[name] { - /^(CentOS|RedHat|OracleLinux|Fedora|Amazon|AlmaLinux)$/: { + /^(CentOS|RedHat|OracleLinux|Fedora|Amazon|AlmaLinux|SLES)$/: { if ( $::operatingsystemrelease =~ /^5.*/ ) { $baseurl = 'https://packages.wazuh.com/4.x/yum/5/' $gpgkey = 'http://packages.wazuh.com/key/GPG-KEY-WAZUH' @@ -46,16 +46,30 @@ } default: { fail('This ossec module has not been tested on your distribution.') } } - # Set up OSSEC repo - yumrepo { 'wazuh': - descr => 'WAZUH OSSEC Repository - www.wazuh.com', - enabled => true, - gpgcheck => 1, - gpgkey => $gpgkey, - baseurl => $baseurl - } - + # Set up OSSEC repo + case $::os[name] { + /^(CentOS|RedHat|OracleLinux|Fedora|Amazon|AlmaLinux)$/: { + yumrepo { 'wazuh': + descr => 'WAZUH OSSEC Repository - www.wazuh.com', + enabled => true, + gpgcheck => 1, + gpgkey => $gpgkey, + baseurl => $baseurl + } + } + /^(SLES)$/: { + zypprepo { 'wazuh': + ensure => present, + name => 'WAZUH OSSEC Repository - www.wazuh.com', + enabled => 1, + gpgcheck => 0, + repo_gpgcheck => 0, + pkg_gpgcheck => 0, + gpgkey => $gpgkey, + baseurl => $baseurl + } + } + } } - default: { fail('This ossec module has not been tested on your distribution') } } } diff --git a/metadata.json b/metadata.json index a3247f4a..4d3771c6 100644 --- a/metadata.json +++ b/metadata.json @@ -36,6 +36,10 @@ "name": "puppetlabs/powershell", "version_requirement": ">= 2.0.0 < 5.0.0" }, + { + "name": "puppet/zypprepo", + "version_requirement": "= 4.0.1" + }, { "name": "puppet/archive", "version_requirement": ">= 0.4.8 < 7.0.0"