Puppet Class: profile::fastnetmon

Defined in:
modules/profile/manifests/fastnetmon.pp

Overview

SPDX-License-Identifier: Apache-2.0

Class profile::fastnetmon

Sets up Fastnetmon: netflow collector and DDoS detection

Parameters:

  • thresholds_overrides (Hash[String, Hash[String, Any]]) (defaults to: lookup('profile::fastnetmon::thresholds_overrides'))


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'modules/profile/manifests/fastnetmon.pp', line 4

class profile::fastnetmon (
  Hash[String, Hash[String, Any]] $thresholds_overrides = lookup('profile::fastnetmon::thresholds_overrides'),
  ) {

    include network::constants

    ensure_resource('class', 'geoip')

    $icinga_dir = '/run/fastnetmon-actions'

    class { '::fastnetmon':
        networks             => $::network::constants::external_networks,
        thresholds_overrides => $thresholds_overrides,
        icinga_dir           => $icinga_dir,
    }

    # Export notifications count as a metric for alerting purposes.
    prometheus::node_file_count { 'fastnetmon notifications':
        paths   => [ $icinga_dir ],
        outfile => '/var/lib/prometheus/node.d/fastnetmon.prom'
    }

    ferm::service { 'FNM-netflow':
        proto  => 'udp',
        port   => '2055',
        desc   => 'FNM-netflow',
        srange => '($NETWORK_INFRA $MGMT_NETWORKS)',
    }

    logrotate::rule { 'fastnetmon':
        ensure        => present,
        file_glob     => '/var/log/fastnetmon.log',
        frequency     => 'daily',
        copy_truncate => true,
        missing_ok    => true,
        compress      => true,
        not_if_empty  => true,
        rotate        => 15,
    }
}