How to Configure Firewall and VPN Setup

Published
Length
3 min read

Luis Felipe Dias

All posts

A firewall and vpn setup controls which users and apps can enter a private network. You build it safe by denying all outside traffic first and checking user roles. Teams use these two tools to protect internal servers and data stores. The VPN creates an encrypted tunnel from a user device to the private network. The firewall sits at the network border and checks every packet that passes through. When you pair them, outside traffic cannot reach internal systems without a valid tunnel. How a fi

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

A firewall and vpn setup controls which users and apps can enter a private network. You build it safe by denying all outside traffic first and checking user roles.

Teams use these two tools to protect internal servers and data stores. The VPN creates an encrypted tunnel from a user device to the private network. The firewall sits at the network border and checks every packet that passes through. When you pair them, outside traffic cannot reach internal systems without a valid tunnel.

How a firewall and vpn setup works

A firewall and vpn setup links user identity with network packet rules. First, a remote engineer logs in to the VPN client on a laptop. The VPN server checks the user identity and assigns a private IP address. All traffic from that device then travels through an encrypted tunnel to the network.

Next, the firewall reads the source IP, destination IP, and port of each packet. If the rule list allows that path, the firewall lets the packet pass. If no rule matches, the firewall drops the packet right away. This flow affects human users, background scripts, and automated build jobs.

Safe defaults start with a strict deny-all rule on every firewall zone. You should only open the exact ports that an app needs to run. Group your servers into small network subnets based on their risk level. Put production databases in a separate subnet from test servers and developer tools.

Never give VPN users a rule that opens the whole internal network. Instead, assign users to role groups inside your central identity provider. Map each role group to a small pool of private IP addresses. Then write firewall rules that only allow those pools to reach specific ports.

Network segmentation and routing rules

Split routing is a key choice when you design your VPN paths. A full tunnel sends all user internet traffic through your private network border. This lets your main firewall filter web traffic, but it uses more bandwidth. A split tunnel only sends internal company traffic through the encrypted VPN path.

VPN Access Control + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

For engineering teams, split tunnels keep video calls fast while protecting internal server traffic. Still, you must lock down the route table so private subnets stay clear. Make sure local home networks do not clash with your private cloud IP ranges. Picking unique private IP blocks early prevents hard routing bugs later on.

Checking rules and closing session gaps

You must check your network rules often to keep the setup tight. Send all VPN login events and firewall packet logs to a central log store. Review these logs each week to find unused rules and remove them. When an engineer leaves a project, remove their group role right away.

Test your rules from an outside host and from inside the VPN tunnel. Check that a user in a test role cannot reach production database ports. Automated checks can alert your team when someone opens a wide subnet rule.

Still, a firewall and vpn setup only checks traffic at the network level. Once a user logs in and passes the firewall, the network trusts that tunnel. The firewall cannot see which database queries or server commands run inside the session. It also does not remove shared database passwords stored on a user laptop.

If an attacker steals a device with an active VPN, they gain network reach. Static firewall rules also struggle when developers need quick, short access to fix a bug. Teams often leave ports open too long because changing network rules takes time. You need controls at the command and query level to close these gaps.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Should the firewall sit before or after the VPN server?

Place your main perimeter firewall in front of the VPN server to block bad traffic. Then use internal firewall rules behind the VPN to restrict where authenticated users can go.

Why is a VPN alone not enough for database security?

A VPN only brings a user onto the private network and encrypts traffic in transit. It does not check which SQL queries a user runs or mask sensitive data fields.

How often should teams review firewall rules?

Teams should review firewall and VPN rules at least once every quarter. Remove any temporary rules, old IP addresses, and unused ports right away to shrink risk.

The query runs. The emails stay hidden.