Best practice to cloud firewall outbound traffic rules

November 10, 2018 989 views
Arch Linux DigitalOcean Cloud Firewalls

Hello

What is the best practices to manage the cloud firewall of my droplet . Im using cloudflare , current I restrict inbound traffic to cloudflare Ips .Is it good idea to restrict outbound traffic just only to cloudflare Ips too.

1 Answer

If you are using Cloudflare you can certainly use their product to create firewall rules which will help to secure your droplet.

However, cloudflare is operating at the DNS layer and then routing requests to your droplet which you will want to secure independently and here are some resources to help you get started:

Using Managed Firewalls
https://www.digitalocean.com/docs/networking/firewalls/how-to/configure-rules/

Manually
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04

You do not want to limit outbound traffic to just Cloudflare as that will actually break your website. Cloudflare just handles the inbound request through DNS and then routes it to your droplet, after that your droplet is communicating directly with the user that created the request. So if you limited outbound traffic to just Cloudflare it would break connectivity for your domains.

by Hazel Virdó
UFW, or Uncomplicated Firewall, is an interface to iptables that is geared towards simplifying the process of configuring a firewall. While iptables is a solid and flexible tool, it can be difficult for beginners to learn how to use it to properly configure a firewall. If you're looking to get started securing your network, and you're not sure which tool to use, UFW may be the right choice for you. This tutorial will show you how to set up a firewall with UFW on Ubuntu 16.04.
Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!