This commit is contained in:
Your Name 2024-09-09 22:54:52 -06:00
parent 627739714e
commit ebf63ebf57

View File

@ -40,6 +40,7 @@ BOT_ACCOUNT="blockbot@detroitriotcity.com"
CRAWLER_TMP='/tmp/crawlers.txt' CRAWLER_TMP='/tmp/crawlers.txt'
DATE="$(date +%Y:%H: -d "1 hour ago")" DATE="$(date +%Y:%H: -d "1 hour ago")"
#DATE="$(date +%Y:%H:)"; #DATE="$(date +%Y:%H:)";
RULE_SET='/opt/firewall/nft.rules'
COUNTRY=( COUNTRY=(
https://www.ipdeny.com/ipblocks/data/countries/il.zone https://www.ipdeny.com/ipblocks/data/countries/il.zone
https://www.ipdeny.com/ipblocks/data/countries/cn.zone https://www.ipdeny.com/ipblocks/data/countries/cn.zone
@ -279,7 +280,16 @@ trust() {
start() { start() {
$NFT flush ruleset $NFT flush ruleset
$NFT -f /usr/share/nftables/ipv4-filter.nft
if [ -f "$RULE_SET" ]; then
echo
echo "Importing Existing Rule Set"
$NFT -f $RULE_SET
else
echo
echo "No existing Rules saved"
$NFT -f /usr/share/nftables/ipv4-filter.nft
fi
if [[ $HOSTNAME == *"nas"* ]]; then if [[ $HOSTNAME == *"nas"* ]]; then
attacker-protection attacker-protection
@ -291,7 +301,7 @@ start() {
cups cups
syncthingServer syncthingServer
syncthing syncthing
blockCountry #blockCountry
jellyfin jellyfin
wireguard-networking wireguard-networking
uptimeKuma uptimeKuma
@ -299,9 +309,7 @@ start() {
$NFT insert rule filter input iif docker0 $NFT_ACCEPT $NFT insert rule filter input iif docker0 $NFT_ACCEPT
basic-security basic-security
else else
{ virtualization
virtualization
}
basic-security basic-security
fi fi
@ -313,6 +321,7 @@ status() {
} }
stop() { stop() {
$NFT -s list ruleset | tee $RULE_SET
$NFT flush ruleset $NFT flush ruleset
$NFT -f /usr/share/nftables/ipv4-filter.nft $NFT -f /usr/share/nftables/ipv4-filter.nft
$NFT add rule filter input icmp type echo-request $NFT_ACCEPT $NFT add rule filter input icmp type echo-request $NFT_ACCEPT