The Simplest Way to Make Azure Functions and Fortigate Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair azure functions and fortigate to automate firewall updates from cloud events. Serverless apps react to alerts and push new block rules to the firewall. This workflow cuts down manual ticket work for security and network teams. When an alert fires, the cloud app sends a request to the appliance. The firewall updates its address groups or traffic rules right away. Teams do not need to log in by hand at night. How azure functions and fortigate share identity and data The cloud app an

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.

Teams pair azure functions and fortigate to automate firewall updates from cloud events. Serverless apps react to alerts and push new block rules to the firewall.

This workflow cuts down manual ticket work for security and network teams. When an alert fires, the cloud app sends a request to the appliance. The firewall updates its address groups or traffic rules right away. Teams do not need to log in by hand at night.

How azure functions and fortigate share identity and data

The cloud app and the network appliance sit in different trust zones. The serverless code runs on shared cloud hosts with changing outbound addresses. The firewall guards private networks and needs strict rules for management traffic.

To make them talk, you must set up both network paths and keys. First, the cloud app needs a fixed path to the firewall port. Teams route the serverless app through a virtual network with a static address. Or they join the app to a private subnet that reaches the appliance.

Second, the app must prove its identity to the firewall. Teams create an admin profile on the firewall just for this app. That profile uses a token or key to log in over HTTPS. The cloud app stores this secret in a secure cloud vault. When the function runs, it reads the key and sends the payload. The firewall checks the key and checks the source address before acting.

Common failure modes and how to scope roles

Many setups fail because teams take shortcuts with keys and roles. A common mistake is using a full system admin account for the app. If an attacker steals that token, they can wipe out all firewall rules. Instead, give the app a narrow role on the firewall. Allow it to edit only one address group or read specific system logs.

Shared service accounts also cause headaches during audits. When five different functions use the same firewall key, logs get messy. You cannot tell which cloud event changed a network rule. Give each serverless app its own firewall user and narrow role.

Azure RBAC + Cloud Functions IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another failure mode is opening the firewall port to all cloud addresses. Serverless hosts share public addresses with many other cloud customers. If you trust the whole cloud range, strangers can reach your login port. Always lock the firewall admin port to your own private subnet or address.

Unlogged calls also hurt your security posture. Standard firewall logs might show a rule change, but not the reason why. Make sure your cloud code logs the alert ID and the full request. Also watch out for sensitive data in those logs. Masking rewrites matched fields like emails or card numbers in results. This keeps private data out of your shared debug logs.

Testing and running the workflow in production

Start by testing your cloud app against a lab firewall instance. Check that the function handles slow network replies and timeouts well. Firewalls can take a few seconds to commit big rule changes. Set a sensible timeout on your cloud function so it does not hang.

Rotate the firewall keys on a set schedule. Since the cloud app reads keys from a vault, rotation is simple. Create the new key, update the vault, and remove the old key. Check your firewall logs after each rotation to confirm clean logins.

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

How do I give my serverless app a fixed IP for the firewall?

Link your function app to a virtual network in your cloud account. Then route outbound traffic through a NAT service with a static IP address. Add that single IP to the trusted host list on your firewall.

What permissions should the firewall account have?

Give the account the minimum rights needed for its single task. If the app only blocks bad hosts, let it edit only address groups. Block the account from changing system settings, admin users, or VPN rules.

How do we track which cloud event changed a firewall rule?

Pass a unique ticket or alert ID in the comment field of the rule. Log that same ID in your cloud log store when the function runs. This links the cloud trigger directly to the resulting network change.

The query runs. The emails stay hidden.