|
| 1 | +# filebeat::module::sophos |
| 2 | +# |
| 3 | +# @summary |
| 4 | +# This class manages the Filebeat Sophos module. |
| 5 | +# |
| 6 | +# @example |
| 7 | +# class { 'filebeat::module::sophos': |
| 8 | +# xg_enabled => true, |
| 9 | +# xg_input => 'udp', |
| 10 | +# xg_syslog_host => '0.0.0.0', |
| 11 | +# xg_syslog_port => 514, |
| 12 | +# xg_host_name => 'sophos-xg', |
| 13 | +# } |
| 14 | +# |
| 15 | +# @param xg_enabled |
| 16 | +# Whether to enable the Sophos XG module. |
| 17 | +# @param xg_paths |
| 18 | +# An array of paths to the Sophos XG logs. |
| 19 | +# @param xg_input |
| 20 | +# The input type for the Sophos XG module. tcp or udp for syslog input, file for log files. |
| 21 | +# @param xg_syslog_host |
| 22 | +# Interface to listen to for syslog input. |
| 23 | +# @param xg_syslog_port |
| 24 | +# Port to listen on for syslog input. |
| 25 | +# @param xg_host_name |
| 26 | +# Host name / Observer name, since SophosXG does not provide this in the syslog file. |
| 27 | +# @param utm_enabled |
| 28 | +# Whether to enable the Sophos UTM module. |
| 29 | +# @param utm_paths |
| 30 | +# An array of paths to the Sophos UTM logs. |
| 31 | +# @param utm_input |
| 32 | +# The input type for the Sophos UTM module. tcp or udp for syslog input, file for log files. |
| 33 | +# @param utm_syslog_host |
| 34 | +# Interface to listen to for syslog input. |
| 35 | +# @param utm_syslog_port |
| 36 | +# Port to listen on for syslog input. |
| 37 | +# @param utm_tz_offset |
| 38 | +# Timezone offset. If the logs are in a different timezone than the Filebeat host, set this to the timezone offset. |
| 39 | +# @param utm_rsa_fields |
| 40 | +# Flag to control whether non-ECS fields are added to the event. |
| 41 | +# @param utm_keep_raw_fields |
| 42 | +# Flag to control the addition of the raw parser fields to the event. |
| 43 | +# |
| 44 | +class filebeat::module::sophos ( |
| 45 | + Boolean $xg_enabled = false, |
| 46 | + Optional[Array[Stdlib::Absolutepath]] $xg_paths = undef, |
| 47 | + Optional[Enum['udp', 'tcp','file']] $xg_input = undef, |
| 48 | + Optional[Stdlib::Host] $xg_syslog_host = undef, |
| 49 | + Optional[Stdlib::Port] $xg_syslog_port = undef, |
| 50 | + Optional[Stdlib::Host] $xg_host_name = undef, |
| 51 | + Boolean $utm_enabled = false, |
| 52 | + Optional[Array[Stdlib::Absolutepath]] $utm_paths = undef, |
| 53 | + Optional[Enum['udp', 'tcp','file']] $utm_input = undef, |
| 54 | + Optional[Stdlib::Host] $utm_syslog_host = undef, |
| 55 | + Optional[Stdlib::Port] $utm_syslog_port = undef, |
| 56 | + Optional[Pattern[/^[-+]\d{2}:\d{2}$/]] $utm_tz_offset = undef, |
| 57 | + Optional[Boolean] $utm_rsa_fields = undef, |
| 58 | + Optional[Boolean] $utm_keep_raw_fields = undef, |
| 59 | +) { |
| 60 | + filebeat::module { 'sophos': |
| 61 | + config => { |
| 62 | + 'xg' => delete_undef_values( |
| 63 | + { |
| 64 | + 'enabled' => $xg_enabled, |
| 65 | + 'var.input' => $xg_input, |
| 66 | + 'var.paths' => $xg_paths, |
| 67 | + 'var.syslog_host' => $xg_syslog_host, |
| 68 | + 'var.syslog_port' => $xg_syslog_port, |
| 69 | + 'var.host_name' => $xg_host_name, |
| 70 | + } |
| 71 | + ), |
| 72 | + 'utm' => delete_undef_values( |
| 73 | + { |
| 74 | + 'enabled' => $utm_enabled, |
| 75 | + 'var.input' => $utm_input, |
| 76 | + 'var.paths' => $utm_paths, |
| 77 | + 'var.syslog_host' => $utm_syslog_host, |
| 78 | + 'var.syslog_port' => $utm_syslog_port, |
| 79 | + 'var.tz_offset' => $utm_tz_offset, |
| 80 | + 'var.rsa_fields' => $utm_rsa_fields, |
| 81 | + 'var.keep_raw_fields' => $utm_keep_raw_fields, |
| 82 | + } |
| 83 | + ), |
| 84 | + }, |
| 85 | + } |
| 86 | +} |
0 commit comments