Linux – FirewallD and nftables

just some notes about FirewallD and nftables firewall-cmd --zone public --add-rich-rule 'rule service name="ssh" accept limit value="1/m"' firewall-cmd --zone=trusted --add-source=-your-own-IP-here- firewall-cmd --runtime-to-permanent vi /etc/firewalld/policies/dns.xml <?xml version="1.0" encoding="utf-8"?> <policy target="CONTINUE"> <service name="dns"/> <rule> <service name="dns"/> <accept> <limit value="5000/m"/> </accept> </rule> <ingress-zone name="ANY"/> <egress-zone name="HOST"/> </policy> firewall-cmd --reload firewall-cmd --info-policy=dns dns (active) priority: -1 target: CONTINUE ingress-zones: …

Fortigate DOS Protection

It is a good idea to do basic DoS Protection, even internaly. Configuring DoS policyVerificationdiagnose ips anomaly listReleasing the blocked sendersdiagnose ips anomaly clearLinks Configuring DoS policy This will configure a basic DoS Policy for Traffic with default values and block violations for 2 Minutes. config firewall DoS-policy edit 1 set name "ALL DoS-Policy" set …

Bind9 – Caching only DNS Server with Logging

Sometimes there is the need to have an forwarding only name server. named.conf/etc/resolv.confDocker enviroments named.conf controls { net 127.0.0.1 allow { localhost; } keys { "rndc-key"; }; }; key "rndc-key" { algorithm "hmac-md5"; secret "somesecret-for-rndc"; }; options { directory "/etc/named.d"; listen-on { 127.0.0.1; }; max-cache-ttl 600; max-ncache-ttl 300; forward only; forwarders { <IP of SERVER1>; …

Bind9 – Named

This is just a collection of some information to remember about named setup. This is not comprehensiv and just suits my needs. ConfigurationBind9 - Caching NameserverBind9 - LoggingLogging ConfigurationLog analyse Configuration Bind9 - Caching Nameserver https://www.digitalocean.com/community/tutorials/how-to-configure-bind-as-a-caching-or-forwarding-dns-server-on-ubuntu-14-04 Bind9 - Logging Based on https://kb.isc.org/docs/aa-01526 print-time yes; print-category yes; print-severity yes; Logging Configuration mkdir -p /var/named/logchown named:named /var/named/log …

AWS IP Address Ranges

We had the need to find AWS IP Addresess for a certain Service and Regions, and use them to route traffic over Amazons Direct Connect.Luckily Amzon publishes the IP Ranges in Json Format. Shell CodeRoutes for ciscoShellAWS IP Ranges Syntax SyntaxsyncTokenprefixesipv6_prefixesip_prefixipv6_prefixnetwork_border_groupregionserviceFiltering the JSON fileLinuxExample 1. Get the creation dateExample 2. Get the information for a …

Fortigate Useful Commands

This is my personal catalog of typical troubleshooting commands I employ when dealing with FortiGate Firewalls. In contrast to Cisco, where 'show' is the universal command, Fortinet offers a range of options, including 'show,' 'get,' 'diagnose,' and 'execute,' for retrieving pertinent information. Important to remember It is 'get router info routing-table' to see the routing …