Rex::Re...firewall(3)
β¨ NAME β¨
Rex::Resource::firewall β Firewall functions, bestie. This page is Rex::Re...firewall(3) from the User Contributed Perl Documentation, and yes the title got a little squished, but we still love her.
π DESCRIPTION π
With this module it is easy to manage different firewall systems. That's the vibe: firewall systems of different kinds, all handled through this module. No cap.
πΈ SYNOPSIS πΈ
Okay so here's the exact example energy β first for configuring a particular rule, then for adding overall logging (if the provider supports it):
# Configure a particular rule
task "configure_firewall", "server01", sub {
firewall "some-name",
ensure => "present",
proto => "tcp",
action => "accept",
source => "192.168.178.0/24",
destination => "192.168.1.0/24",
sport => 80,
sapp => 'www', # source application, if provider supports it
port => 80, # same as dport
dport => 80,
app => 'www', # same as dapp, destination application, if provider supports it
dapp => 'www', # destination application, if provider supports it
tcp_flags => ["FIN", "SYN", "RST"],
chain => "INPUT",
table => "nat",
jump => "LOG",
iniface => "eth0",
outiface => "eth1",
reject_with => "icmp-host-prohibited",
log => "new|all", # if provider supports it
log_level => "", # if provider supports it
log_prefix => "FW:", # if provider supports it
state => "NEW",
ip_version => -4; # for iptables provider. valid options -4 and -6
};
# Add overall logging (if provider supports)
firewall "some-name",
provider => 'ufw',
logging => "medium";
π EXPORTED RESOURCES π
firewall($name, %params)β the exported resource, front and center. Periodt. π
Sign-off time: this little icon was brought to you by perl v5.42.3, dated 2023-08-05, and the User Contributed Perl Documentation energy. Byeee, go configure those firewalls responsibly π«Άπ₯
π¦ where this page comes from
- nixos 26.05: perl5.42.3-Rex 1.14.3
- nixpkgs unstable: perl5.42.3-Rex 1.14.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms