Firewalls and VPN

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up firewalls and vpn rules to block outside traffic and let users in. A firewall checks network packets, while a VPN builds a private tunnel for remote teams. Most tech teams place these tools at the edge of their cloud networks. They assign broad IP ranges so engineers can do their daily work. When network rules stay too wide, one stolen laptop puts every internal server at risk. Teams must lock down ports, trim subnet routes, and check every user role. How firewalls and vpn work toge

VPN Access Control + DigitalOcean Cloud Firewalls: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up firewalls and vpn rules to block outside traffic and let users in. A firewall checks network packets, while a VPN builds a private tunnel for remote teams. Most tech teams place these tools at the edge of their cloud networks. They assign broad IP ranges so engineers can do their daily work. When network rules stay too wide, one stolen laptop puts every internal server at risk. Teams must lock down ports, trim subnet routes, and check every user role.

How firewalls and vpn work together in a network

A firewall acts as a filter between your private servers and the public internet. Admins write rules that check the source IP address, target IP address, and port number. If a packet matches an allow rule, the firewall lets it pass through. If the packet does not match, the firewall drops the traffic right away.

A virtual private network, or VPN, lets remote workers join that private network safely. The worker runs a client app that checks their user key or password. Once verified, the app wraps all network traffic in an encrypted tunnel. The office firewall sees this tunnel coming from a trusted endpoint and lets it in. Inside the network, the VPN gives the user a private IP address. The firewall then checks that internal IP against subnet rules to allow server traffic.

To keep this setup clean, admins split networks into small zones. Web servers live in one zone, while databases live in a deeper zone. Firewall rules block direct traffic from the web zone to the database zone. Engineers on the VPN only get routes to the zones their job role requires.

What network rules solve and where gaps remain

Network filters and tunnels do a great job of blocking strangers on the internet. They hide internal ports from public scanners and encrypt data moving over coffee shop Wi-Fi. For compliance audits, they prove that you lock the front door to your cloud.

Still, network tools only check who can reach a port, not what they do next. Once a VPN tunnel is open, the firewall passes TCP packets without reading the commands inside. If a developer connects to a database port, the firewall cannot tell a safe read query from a table drop.

VPN Access Control + DigitalOcean Cloud Firewalls: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static network rules also grow messy as your team hires more people. Engineers ask for temporary port openings to fix a bug, and those rules never get deleted. Shared database passwords still sit on laptops so local tools can log in over the tunnel. Also, network logs only show IP addresses, port numbers, and byte counts. They cannot tell you which user ran a specific command or whether query results returned sensitive emails, phone numbers, or card numbers. Data masking that rewrites matched fields in results simply cannot happen at the packet layer.

Steps to tighten your network rules today

Start by auditing every open port on your perimeter and internal firewalls. Delete any allow rule that points to all IP addresses unless it serves public web traffic. Group your engineers by job role and give each group a distinct IP pool on the VPN.

Next, write firewall rules that tie those specific IP pools to single server ports. Turn on multi-factor checks for every VPN login so a stolen password alone fails. Set short timeouts on VPN tunnels so idle laptops drop off the network at night. Review your firewall rule hit counts each month and remove any rule with zero hits.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Do I need both a firewall and a VPN for cloud servers?

Yes, they do different jobs for your network. The firewall blocks open ports from the public internet. Meanwhile, the VPN gives remote workers a private path through that wall.

Can a firewall read the database queries inside a VPN tunnel?

No, standard firewalls only inspect IP addresses, ports, and basic packet headers. They do not decode database protocols or log the specific queries an engineer runs.

Why do VPN setups struggle to limit user actions inside a server?

A VPN works at the network layer and grants routes to IP addresses and ports. Once your packet reaches the server port, the VPN has no control over the commands you send.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.