Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firewall setup warning #55

Closed
poperigby opened this issue Apr 6, 2020 · 12 comments
Closed

Firewall setup warning #55

poperigby opened this issue Apr 6, 2020 · 12 comments

Comments

@poperigby
Copy link

I'm getting this error message after running sudo psad --fw-analyze

[-] You may just need to add a default logging rule to the
'filter' 'INPUT' chain on haddock. For more information,
see the file "FW_HELP" in the psad sources directory or visit:

http://www.cipherdyne.org/psad/docs/fwconfig.html

I followed the link it gave me and entered these two lines,

# iptables -A INPUT -j LOG
# iptables -A FORWARD -j LOG

but I'm still getting the error.

@hellresistor
Copy link
Contributor

are you using iptables or ufw ?

@poperigby
Copy link
Author

poperigby commented Apr 10, 2020 via email

@hellresistor
Copy link
Contributor

Try This commands:

sed -i '/^COMMIT/i -A ufw-before-output -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT' /etc/ufw/before.rules
sed -i '/^COMMIT/i -A ufw-before-output -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT' /etc/ufw/before.rules
cp --preserve /etc/ufw/before.rules /etc/ufw/before.rules.$(date +"%Y%m%d%H%M%S") 
cp --preserve /etc/ufw/before6.rules /etc/ufw/before6.rules.$(date +"%Y%m%d%H%M%S")
cp --preserve /etc/ufw/after.rules /etc/ufw/after.rules.$(date +"%Y%m%d%H%M%S") 
cp --preserve /etc/ufw/after6.rules /etc/ufw/after6.rules.$(date +"%Y%m%d%H%M%S")
## add this at the end but before the COMMIT line:
# log all traffic so psad can analyze
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before.rules
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before6.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before6.rules
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after.rules
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after6.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after6.rules
ufw reload

;)

@poperigby
Copy link
Author

That worked. Thanks!

@kpua
Copy link

kpua commented Dec 15, 2021

Try This commands:

sed -i '/^COMMIT/i -A ufw-before-output -p icmp -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT' /etc/ufw/before.rules
sed -i '/^COMMIT/i -A ufw-before-output -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT' /etc/ufw/before.rules
cp --preserve /etc/ufw/before.rules /etc/ufw/before.rules.$(date +"%Y%m%d%H%M%S") 
cp --preserve /etc/ufw/before6.rules /etc/ufw/before6.rules.$(date +"%Y%m%d%H%M%S")
cp --preserve /etc/ufw/after.rules /etc/ufw/after.rules.$(date +"%Y%m%d%H%M%S") 
cp --preserve /etc/ufw/after6.rules /etc/ufw/after6.rules.$(date +"%Y%m%d%H%M%S")
## add this at the end but before the COMMIT line:
# log all traffic so psad can analyze
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before.rules
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before6.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/before6.rules
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after.rules
sed -i '/^COMMIT/i -A INPUT -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after6.rules
sed -i '/^COMMIT/i -A FORWARD -j LOG --log-tcp-options --log-prefix "[UFW "' /etc/ufw/after6.rules
ufw reload

;)

Super, Thanks

@slesru
Copy link

slesru commented Apr 8, 2024

OK, what is solution if I run jist iptables on ubuntu 23.10?
I already have
-A INPUT -j LOG
-A FORWARD -j LOG

And psad works, only annoying warning on startup.
Why?

@TechMiner-UK
Copy link

TechMiner-UK commented Apr 14, 2024

OK, what is solution if I run jist iptables on ubuntu 23.10? I already have -A INPUT -j LOG -A FORWARD -j LOG

And psad works, only annoying warning on startup. Why?

Same here, I've added those and it still errors out, the only way to not get it to error is to manually enter the following commands:
iptables -A INPUT -j LOG
iptables -A FORWARD -j LOG
ip6tables -A INPUT -j LOG
ip6tables -A FORWARD -j LOG

However then the rules don't persist after reloading UFW, I'm 95% sure it's a me issue but for the life of me I can't figure out what is wrong

@hellresistor
Copy link
Contributor

should install iptables-persistent

take a look here: https://linuxconfig.org/how-to-make-iptables-rules-persistent-after-reboot-on-linux

@Fuckingnameless
Copy link

Fuckingnameless commented Apr 18, 2024

[-] You may just need to add a default logging rule to the
'filter' 'INPUT' chain on debian. For more information,
see the file "README" in the psad sources directory or visit: http://www.cipherdyne.org/psad/docs/fwconfig.html

[-] Errors found in firewall config.

how to debug what is causing the error?

@Fuckingnameless
Copy link

i have tried everything i could find including this "fix" but still getting these errors

Danger level: [2] (out of 5)

Scanned destinations: 1

           Source: fe80:0000:0000:0000:5ec9:d3ff:febd:5dd3
              DNS: [No reverse dns info available]

      Destination: 2804:07f4:fb80:ee1a:8239:66fc:c942:39f2
              DNS: [No reverse dns info available]

Overall scan start: Thu Apr 18 00:55:32 2024
Total email alerts: 9
Syslog hostname: debian

     Global stats:
                   chain:   interface:  protocol:  packets: 
                   INPUT    enp6s0      icmp6      40       

[+] ICMP6 scan signatures:

Invalid ICMP type "137" chain=INPUT packets=3

[+] Whois Information (source IP):
Unknown AS number or IP network. Please upgrade this program.

@Fuckingnameless
Copy link

it was the stupid router pinging all-hosts-group it seems

@slesru
Copy link

slesru commented Apr 18, 2024

I think it is better to have config option to suppress this messages, I guess admin knows better what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants