I have created my iptables in ubuntu 12.04 and activated fail2ban. Can someone please just let me know if my iptables are secure or if I am missing anything / need to change anything. I have replaced the actual port number for ssh with [port number]
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-ssh tcp – anywhere anywhere multiport dports [port number]
ACCEPT all – anywhere anywhere
REJECT all – anywhere loopback/8 reject-with icmp-port-unreachable
ACCEPT all – anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp – anywhere anywhere tcp dpt:http
ACCEPT tcp – anywhere anywhere tcp dpt:https
ACCEPT tcp – anywhere anywhere state NEW tcp dpt:[port number]
ACCEPT icmp – anywhere anywhere icmp echo-request
LOG all – anywhere anywhere limit: avg 5/min burst 5 LOG level debug prefix "iptables denied: "
REJECT all – anywhere anywhere reject-with icmp-port-unreachable
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all – anywhere anywhere reject-with icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all – anywhere anywhere
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all – anywhere anywhere
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Looks fine to me. But I don’t know what services you’re running, so you could check what ports are open and see if you need to close/whitelist any: <br><pre>sudo netstat -plutn</pre> <br>Ports on 127.0.0.1 are fine since they can only be accessed from the droplet itself only.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.