Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support agents on suse #689

Merged
merged 6 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions kitchen/Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 3 additions & 1 deletion manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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') }
}
Expand Down
19 changes: 19 additions & 0 deletions manifests/params_agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
}
}
Expand Down
25 changes: 25 additions & 0 deletions manifests/params_manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
}
}
Expand Down
38 changes: 26 additions & 12 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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') }
}
}
4 changes: 4 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
"name": "puppetlabs/powershell",
"version_requirement": ">= 2.0.0 < 5.0.0"
},
{
"name": "puppetlabs/zypprepo",
"version_requirement": "= 4.0.1"
},
{
"name": "puppet/archive",
"version_requirement": ">= 0.4.8 < 7.0.0"
Expand Down
Loading