The Simplest Way to Make Fortigate and Nats Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running fortigate and nats together secures fast message traffic across network zones. The firewall filters outside packets while the message system routes app events inside. Many teams struggle when they put a strict firewall in front of messaging nodes. Packets drop when idle timers cut off long TCP links without warning. A clear setup lets both tools do their best work without breaking app traffic. You get tight border rules and fast data flow at the same time. How fortigate and nats handl

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.

Running fortigate and nats together secures fast message traffic across network zones. The firewall filters outside packets while the message system routes app events inside.

Many teams struggle when they put a strict firewall in front of messaging nodes. Packets drop when idle timers cut off long TCP links without warning. A clear setup lets both tools do their best work without breaking app traffic. You get tight border rules and fast data flow at the same time.

How fortigate and nats handle logins and data flow

First, look at how a client app talks to the message cluster. The client sends a request across the border firewall to reach a node. The firewall checks the source IP, the destination port, and the packet state. If the rule matches, the firewall passes the traffic to the message server.

Next, the message node takes over and checks the identity of the caller. It can verify a client cert, a signed token, or a basic key. Once the caller logs in, the node checks what subjects that role can read. It also checks which subjects the caller has permission to write to.

Data then flows over persistent TCP links between clients and cluster nodes. Cluster nodes also talk to each other on separate routes to share state. The firewall must allow both client ports and node ports on the right subnets. TLS keeps the payload private as it crosses each network segment.

Common failure modes and how to scope network paths

The most common failure happens when firewall timers close quiet message links. A client waiting for a message might send no data for several minutes. If the firewall drops that quiet session, the client misses new events. Set the firewall TCP session timer higher than the message ping interval.

Shared accounts create another huge risk across your network and message tiers. When ten apps use one login key, you cannot tell who sent bad data. Give each app its own account and its own scoped signing key. Limit each role to the exact subject names it needs to read or write.

End-to-End Encryption + NATS Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad network rules also weaken your setup over time. Do not open the whole cluster subnet to every internal network zone. Map out which specific app subnets need to reach the client port. Keep the cluster gossip and route ports closed to normal client machines. Log both firewall drops and message login errors in one central log store. When a payload contains sensitive fields like emails or card numbers, masking rewrites matched fields in results.

Keeping cluster changes safe during daily operations

Teams often break live traffic when they update firewall rules by hand. One wrong subnet mask can block an entire group of worker nodes. Test your network rules in a staging zone before you push them live. Pair network changes with clear checks on message queue depth and slow consumers.

Rotate your user keys on a set schedule to keep access clean. When an old app retires, remove its firewall rule and revoke its key. Small, steady cleanups stop dead rules from piling up in your system. Your team will spend less time fixing broken links and more time shipping code.

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 runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values 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

Why does the firewall drop idle message connections?

Firewalls close TCP links that show no traffic before the session timer ends. Lower the ping timer on your message server so it sends keepalive packets sooner.

Should client apps have access to cluster routing ports?

No, client apps only need network rules for the main client listening port. Keep cluster routing and leaf node ports restricted to the server nodes only.

How do we track which app sent a specific message?

Assign a unique account and signing key to every single app service. You can then check the server logs to see which account published each event.

The query runs. The emails stay hidden.