Question

Best practice to cloud firewall outbound traffic rules

Posted November 10, 2018 1.8k views
Arch LinuxDigitalOcean 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
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.
Submit an Answer