We installed a new CentOS server for testing and the configuration was a bit different as compared to debian. I am unsure at this moment if the port-5432 is secure for us. If not, how can I secure port-5432 running postgresql so that it's not accessible from internet. Although I remember adding a rule for port-5432, I cannot see it in Iptables.
This is not a debian system.
Iptables -S :
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
netstat -tulpn | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 2938/postgres
tcp6 0 0 ::1:5432 :::* LISTEN 2938/postgres
/etc/iptables/rules
will be on Centos/etc/sysconfig/iptables
– GAD3R Mar 20 '18 at 17:49