1Rex::Resource::firewallU(s3e)r Contributed Perl DocumentaRteixo:n:Resource::firewall(3)
2
3
4

NAME

6       Rex::Resource::firewall - Firewall functions
7

DESCRIPTION

9       With this module it is easy to manage different firewall systems.
10

SYNOPSIS

12        # Configure a particular rule
13        task "configure_firewall", "server01", sub {
14          firewall "some-name",
15            ensure      => "present",
16            proto       => "tcp",
17            action      => "accept",
18            source      => "192.168.178.0/24",
19            destination => "192.168.1.0/24",
20            sport       => 80,
21            sapp        => 'www',    # source application, if provider supports it
22            port        => 80,       # same as dport
23            dport       => 80,
24            app         => 'www',    # same as dapp, destination application, if provider supports it
25            dapp        => 'www',    # destination application, if provider supports it
26            tcp_flags   => ["FIN", "SYN", "RST"],
27            chain       => "INPUT",
28            table       => "nat",
29            jump        => "LOG",
30            iniface     => "eth0",
31            outiface    => "eth1",
32            reject_with => "icmp-host-prohibited",
33            log         => "new|all",  # if provider supports it
34            log_level   => "",         # if provider supports it
35            log_prefix  => "FW:",      # if provider supports it
36            state       => "NEW",
37            ip_version  => -4;         # for iptables provider. valid options -4 and -6
38        };
39
40        # Add overall logging (if provider supports)
41        firewall "some-name",
42          provider => 'ufw',
43          logging  => "medium";
44

EXPORTED RESOURCES

46       firewall($name, %params)
47
48
49
50perl v5.30.2                      2020-04-06        Rex::Resource::firewall(3)
Impressum