Defined Type: diffscan::instance

Defined in:
modules/diffscan/manifests/instance.pp

Overview

SPDX-License-Identifier: Apache-2.0

Define: diffscan

This resource manages a single diffscan isntance.

Parameters

ipranges

The list of IP/masks to scan. See nmap doc for accepted formats.

emailto

Diff emails recipient.

Parameters:

  • ipranges (Array[Stdlib::IP::Address])
  • emailto (Stdlib::Email)


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
44
45
46
47
# File 'modules/diffscan/manifests/instance.pp', line 14

define diffscan::instance (
    Array[Stdlib::IP::Address] $ipranges,
    Stdlib::Email              $emailto,
) {
    include diffscan

    file { "${diffscan::base_dir}/targets-${title}.txt":
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('diffscan/targets.txt.erb'),
    }

    $working_dir = "${diffscan::base_dir}/${title}"

    file { $working_dir:
        ensure => 'directory',
        owner  => 'root',
        group  => 'root',
        mode   => '0775',
    }

    $command = "/usr/local/sbin/diffscan -p 1-65535 -E ${emailto} -W ${working_dir} ${diffscan::base_dir}/targets-${title}.txt"
    systemd::timer::job {"diffscan-${title}":
        user        => 'root',
        description => "Daily diffscan for ${title}",
        command     => $command,
        interval    => {
            'start'    => 'OnCalendar',
            'interval' => '*-*-* 00:00:00',  # Every day at 12:00
        },
    }
}