Note:

Adding Security to the Domain Name System Architecture using pfSense Firewall

Introduction

OraStage is a leading company in the energy sector, specializing in renewable energy solutions and innovative power technologies, the company announced a strategic decision to migrate its workloads to Oracle Cloud Infrastructure (OCI) to enhance performance, scalability, and security.

image

Taking into account the specific needs and conditions that OraStage has outlined, the company requires a hybrid Domain Name System (DNS) solution in the cloud, and by hybrid here means to use their own Berkeley Internet Name Domain version 9 (BIND9) DNS system in addition to OCI DNS service, where the final architecture they are looking to build is shown in the following image.

image

OraStage DNS requirements:

This tutorial series will guide you step by step to achieve the outlined requirements above, building the entire solution from scratch. You can easily navigate to each tutorial from the list below:

Overview

In this tutorial, we will explore how to enhance the security of our DNS architecture by leveraging pfSense, an open-source firewall and router platform.

DNS is a critical component of network infrastructure, but it is often vulnerable to attacks like DNS spoofing, cache poisoning, and Distributed Denial of Service (DDoS). By integrating pfSense with DNS security measures, you can add a robust layer of protection, ensuring your network’s DNS traffic is secure and resilient. So, it is recommended to configure your firewall in a way to filter DNS queries, block malicious domains, and strengthen overall DNS integrity.

What is the added benefit of placing a pfSense firewall in front of a DNS server?

Overall, placing a firewall in front of your DNS server enhances the server’s security, performance, and resilience by preventing unauthorized access, detecting malicious traffic, and offering robust protection against a wide range of DNS-related threats.

Objectives

Note:

Final architecture

image

Prerequisites

image

Task 1: Set up Routing and Security Network Components

Task 1.1: Create a Virtual Cloud Network (Hub-VCN)

Make sure you have the Hub-VCN (10.4.0.0/16) already created, containing Hub-Private-Subnet (10.4.0.0/24) and Hub-Public-Subnet (10.4.1.0/24).

image

Note:

Task 1.2: Configure Routing and Security for Hub-VCN

image

image

image

Task 1.3: Configure Routing and Security for LSN-VCN

Task 1.4: Configure Routing and Security for DNS-VCN

Task 1.5: Configure Routing and Security for Frontend-VCN

Task 1.6: Configure Routing and Security for Backend-VCN

Note: Do not change anything in the ingress and egress rules.

Task 1.7: Configure Spoke VCNs Routing on DRG

The purpose for this task is to make sure all traffic sent out of any of the networks (DNS/LSN/Frontend/Backend) and received on the DRG, to be routed towards the hub, where it will be inspected by the firewall.

Task 2: Provision a Windows Jump Server

Task 3: Install and Configure pfSense Firewall

Note: If you already have another type of firewall solution in place, you can skip Task 3.1 to 3.7, and proceed from 3.8.

Task 3.1: Download the pfSense Image

Task 3.2: Create an OCI Object Storage Bucket

In this task, we will create an OCI Object Storage bucket that will be used to upload the pfSense image and use this object image to create a custom image in OCI.

Task 3.3: Upload the pfSense Image to the Storage Bucket

Task 3.4: Create a Custom Image

We have uploaded the pfSense image. Now, we need to create an OCI custom image from it. This custom image will be used to create the pfSense firewall instance.

image

Task 3.5: Create an Instance with the Custom pfSense Image

Task 3.6: Install pfSense on the Instance

We need to do the initial installation and set up of the pfSense firewall. We already have the running instance.

Task 3.7: Connect to the pfSense Web Graphic User Interface (GUI) and Complete the Initial Set up

The installation is finished, now we need to connect to the web GUI of the pfSense firewall. But before this, make sure to allow HTTP/HTTPS traffic coming from Hub-Public-Subnet, as we will connect to the firewall GUI from the Jump-Server placed there. We already allowed all traffic from all of the VCNs (10.0.0.0/8) to go through the firewall in Task 1.2.

Task 3.8: Route Traffic into the pfSense Firewall

In Task 1, we configured routing on our VCNs and DRG, in a way to force all traffic sent out of the spokes, to enter the hub network (green arrow). This task, answers how to route all of this traffic into the pfSense firewall (red arrow).

image

We will do this by creating an Ingress route table (Transit route table). This is basically a route table you create at the VCN level, but you assign it in the DRG, so that traffic entering the hub will be routed into a specific destination of your choice (pfSense firewall in our scenario).

Task 3.9: Allow Traffic to pass through pfSense

In this tutorial, we are going to leverage two features of the pfSense.

Keep in mind that you can do a lot more with pfSense, but our focus here is more on installing pfSense in OCI and integrating it into our existing network architecture with implementing the proper routing and security in OCI.

First Rule (Optional):

image

Second Rule:

image

Third Rule:

image

Fourth Rule:

image

Fifth Rule:

image

Sixth Rule:

image

Task 4: Test and Validate

Test Scenario 1

Test Scenario 2

Conclusion

Congratulations! We have finally reached to the end of our DNS journey.

In this tutorial, we focused on enhancing OraStage’s DNS architecture with pfSense, which provides a crucial layer of defense against a variety of DNS-based attacks and vulnerabilities. By filtering traffic, enforcing secure DNS protocols, and blocking malicious domains, OraStage can ensure that their DNS servers operate securely and efficiently.

Throughout the series, you have picked up some important skills in OCI. Each tutorial has built on the last, giving you a solid foundation in OCI while relying on a progressive learning approach. These skills will help you manage and optimize your cloud infrastructure effectively:

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.