All of lore.kernel.org
 help / color / mirror / Atom feed
* Grammar in a bash script
@ 2020-08-17  5:55 Mario V Guenzi
  2020-08-17  8:56 ` Pablo Neira Ayuso
  2020-09-25 12:01 ` Mario Vittorio Guenzi
  0 siblings, 2 replies; 12+ messages in thread
From: Mario V Guenzi @ 2020-08-17  5:55 UTC (permalink / raw)
  To: Netfilter list


[-- Attachment #1.1: Type: text/plain, Size: 1734 bytes --]

Goodmorning everyone,
Does it make sense to use this kind of grammar in a bash script?

$NFT add table inet firewall
$NFT add table inet nat
$NFT add table netdev noddos

$NFT add chain inet firewall INPUT { type filter hook input priority 0 \;  }
$NFT add chain inet firewall OUTPUT { type filter hook output priority 0
\; }
$NFT add chain inet firewall FORWARD { type filter hook forward priority
0 \; }
$NFT add chain inet firewall IPS { type filter hook forward priority 10 \; }
$NFT add chain inet firewall POSTROUTING { type filter hook postrouting
priority 0 \; }
$NFT add chain inet firewall SYN-FLOOD { type filter hook input priority
0 \; }
$NFT -- add chain inet  nat PREROUTING { type nat hook prerouting
priority -100 \; }
$NFT add chain inet nat OUTPUT { type nat hook output priority 0 \; }
$NFT add chain inet nat POSTROUTING { type nat hook postrouting priority
100 \; }
$NFT -- add chain netdev noddos ingress { type filter hook ingress
device $EXTIF priority -500 \; }

my rules
my rules
my rules
.
.
.
$NFT add chain inet firewall INPUT { type filter hook input priority 0
\; policy drop \; }
$NFT add chain inet firewall OUTPUT { type filter hook output priority 0
\; policy drop \; }
$NFT add chain inet firewall FORWARD { type filter hook forward priority
0 \; policy drop \; }
$NFT -- add chain inet  nat PREROUTING { type nat hook prerouting
priority -100 \; policy drop \;  }
$NFT add chain inet nat OUTPUT { type nat hook output priority 0
\;policy drop \;  }

The reasoning that I have done and of which I ask for confirmation is,
after having given permission to what I need, I deny everything as a policy

Thanks in advance to those who want to answer me.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Grammar in a bash script
@ 2020-08-17  8:09 Mario V Guenzi
  2020-08-17  8:42 ` Reindl Harald
  0 siblings, 1 reply; 12+ messages in thread
From: Mario V Guenzi @ 2020-08-17  8:09 UTC (permalink / raw)
  To: Netfilter list; +Cc: david


[-- Attachment #1.1: Type: text/plain, Size: 371 bytes --]

Il 17/08/20 09:58, david@hajes.org ha scritto:
> Standard firewall strategy - policy DROP all and allow only what you really need.
yes, but if I put drop as default policy it doesn't even let me access
via ssh, that's why I was forced not to put policy and then drop with
the rules, and for this, once finished I wanted to further close
Sorry for my poor english


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-09-25 12:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-17  5:55 Grammar in a bash script Mario V Guenzi
2020-08-17  8:56 ` Pablo Neira Ayuso
2020-08-18  5:12   ` Mario V Guenzi
2020-08-18 10:04     ` A L
2020-08-18 10:11     ` Pablo Neira Ayuso
2020-08-18 10:28       ` Mario Vittorio Guenzi
2020-08-19  7:55         ` Pablo Neira Ayuso
2020-08-18 10:32     ` Reindl Harald
2020-08-18 10:41       ` Mario Vittorio Guenzi
2020-09-25 12:01 ` Mario Vittorio Guenzi
  -- strict thread matches above, loose matches on Subject: below --
2020-08-17  8:09 Mario V Guenzi
2020-08-17  8:42 ` Reindl Harald

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.