Firewall quickstart
Create a firewall, add a rule that denies requests to one path, bind the firewall to a workload, and confirm the path answers 403.
This guide instructs you through denying your first request with a firewall.
- Create a firewall for the application you already serve.
- Add a rule that denies every request to one path.
- Bind the firewall to the workload that serves your application.
- Send a request to that path and read the
403it returns.
Four objects turn a request into a decision, and each one links to the next:
- The firewall holds the rules. It is active from the moment you create it.
- The rule on that firewall pairs a criterion with a behavior. The criterion selects requests, and the behavior decides what happens to them. In this guide, the criterion selects every path that starts with
/deny-test, and the behavior denies the request. - The deployment of the workload that serves your application names that firewall, beside the application.
- The request to the workload’s domain meets the rule, and a denied request never reaches your application.
A firewall inspects nothing on its own. Until a workload’s deployment names it, no request reaches its rules.
Web Application Firewall (WAF), Network Shield, and Bot Manager are Products enabled on a firewall. This guide needs none of them, because Deny is built into every firewall. Each Product’s quickstart starts from a firewall bound to a workload, which is what this guide leaves you with.
Prerequisites
Console
- An Azion account. To create one, refer to Create an account.
- A workload that serves an application on its workload domain. For more information, refer to Workloads.
- Access to Azion Console. To sign in, refer to Access Azion Console.
Create the firewall
A new firewall holds no rules, and it starts active. The Deny rule this guide adds needs no Product turned on, so the default settings stay.
Console
To create the firewall in Azion Console:
Access Azion Console > Secure > Firewalls.
Select Firewall. The Create Firewall page opens.
In the General section, enter a Name. For example: storefront-firewall.
A Deny rule needs no switch in Modules. In Status, Active stays turned on.
Azion Console shows the message “Your Firewall has been created” and opens the firewall. Its tabs are Main Settings, Functions Instances, and Rules Engine. Functions Instances appears only while Functions is turned on.
Add a rule that denies one path
A Rules Engine for Firewall rule pairs criteria with behaviors. The rule in this stage carries one criterion, a request URI that starts with /deny-test, and one behavior, Deny. Deny refuses the request with 403 Forbidden, and it needs no Product turned on.
The criterion matches every path that begins with /deny-test, so /deny-test/page matches too. For more information, refer to Deny (403 Forbidden).
Console
To add the rule in Azion Console:
Access Azion Console > Secure > Firewalls, and select the firewall you created.
Select Rule. The Create Rule drawer opens.
In the General section, enter a Name. For example: Deny the test path.
In the Criteria section, the first criterion opens on Request Uri and starts with. Enter /deny-test as its argument.
In the Behaviors section, select Deny (403 Forbidden).
Azion Console shows the message “Rule successfully created”. The rule appears in the Rules Engine list with the status Active.
Bind the firewall to your workload
A firewall has no domain of its own. The workload carries the domain. Its deployment holds exactly three settings: the application, the firewall, and the custom page. Name the application the workload serves today, and its custom page if it uses one, beside your firewall. Until the deployment names your firewall, the Deny rule matches no request.
Console
To bind the firewall in Azion Console:
Access Azion Console > Workloads.
Select the workload that serves your application. Its edit form opens.
In the Firewall field of Deployment Settings, select the firewall you created. Application and Custom Page keep what the workload serves today.
The deployment of the workload names your firewall, beside its application and its custom page.
Confirm that the path answers 403
The check is the same whichever interface built the firewall. Your workload answers on its workload domain, of the form <id>.map.azionedge.net, written in this stage as <your-workload-domain>.
A workload newly bound to a firewall can take several minutes to enforce its first rule, and no duration is guaranteed. While the binding spreads, answers to the same request alternate between the earlier response and the new one. Until then, the path still reaches your application. Send the request again until it answers 403. For more information, refer to Propagation.
Send a request to the denied path:
The firewall refuses it with 403:
The response also carries a long content-security-policy header, omitted from this excerpt. The body is Azion’s default error page, headed Forbidden, and it lists your IP address and the request ID. No header names the firewall or the rule that refused the request.
Requests to every other path do not match the rule, and your application answers them as before. Your firewall denies every request whose path starts with /deny-test.