# How to configure Firewall main settings

import DocButton from '~/components/webkit/DocButton.vue';
import Tag from '~/components/webkit/Tag.vue'
import Tabs from '~/components/tabs/Tabs'
import Code from '~/components/Code/Code.astro'


Once you create an firewall with Azion, you can modify a few configurations. In this guide, you'll learn to modify the domains associated with your firewall and to enable the available modules.

---

<Tabs client:visible>
    <Fragment slot="tab.console">Console</Fragment>
    <Fragment slot="tab.api">API</Fragment>

<Fragment slot="panel.console">
In this section, you'll modify the main settings of your firewalls: name, domains, and modules via [Azion Console](https://console.azion.com).

1. Access [Azion Console](/en/documentation/products/guides/how-to-access-azion-console/) > select **Firewall**.
2. From the list, select the firewall you want to edit or click **+ Firewall** to create a new one.
3. Give your firewall a unique and easy-to-remember name.

If you want to protect your domain with an firewall, check the guide below.
<DocButton href="/en/documentation/products/guides/secure/firewall-protect-your-domain/" label="go to How to protect your domain" kind="secondary" size="medium" />

### Modules

[Modules](/en/documentation/products/secure/firewall/#about-edge-firewall-modules) can unlock additional functionalities and features related to your configured firewalls. See the [Pricing page](/en/documentation/products/pricing/) for more details.

There are four available modules that can be activated with your firewall:

- <Tag severity="info">[DDoS Protection](/en/documentation/products/secure/firewall/ddos-protection/)</Tag>
Protects your content and applications against Distributed Denial of Service (DDoS) attacks. Automatically enabled in all accounts.

- <Tag severity="info">[Functions](/en/documentation/products/secure/firewall/functions/)</Tag>
Enables you to run serverless functions on Azion's edge with low latency, bringing the operational power closer to the end user.

- <Tag severity="info">[Network Shield](/en/documentation/products/secure/firewall/network-shield/)</Tag>
Allows the creation of filters by IP/CIDR, ASN addresses, or by countries (geolocation) through the configuration of Network Lists and the definition of business rules that will validate blocking or releasing Criteria.

- <Tag severity="info">[Web Application Firewall](/en/documentation/products/secure/firewall/web-application-firewall/)</Tag> Protects your applications against threats such as SQL Injections, Remote File Inclusion (RFI), Cross-Site Scripting (XSS), and many others.

You can choose between the list of modules: you can select one, a few, or even all.

### Debug rules

You'll also find a switch labeled **Debug Rules**. If you enable the switch, you'll turn on the feature that allows you to check if the rules you've created using Rules Engine for Firewall have been successfully executed in your application.

<DocButton href="/en/documentation/products/guides/debug-rules/" label="go to How to debug rules guide" kind="secondary" size="medium" />

### Status

You'll also find a switch labeled **Active**. You can enable the switch to activate your firewall, and disable the switch if you no longer want this firewall active.

Once you're done configuring your main settings, click the **Save** button.

:::tip
To configure an firewall to protect an specific domain, [go to the Protect your domain guide](/en/documentation/products/guides/secure/firewall-protect-your-domain/)
:::
</Fragment>

<Fragment slot="panel.api">
1. Run the following `GET` request in your terminal, replacing `[TOKEN VALUE]` with your [personal token](/en/documentation/products/guides/personal-tokens/) to retrieve your `<edge_firewall_id>`:

<Code lang="bash" code={`
curl --request GET \
  --url https://api.azion.com/v4/edge_firewall/firewalls \
  --header 'Accept: application/json' \
  --header 'Authorization: Token [TOKEN VALUE]'
`} />

1. You'll receive a response with all your existing firewalls. Copy the value of the `<id>` that you want to configure.
2. Run a `PATCH` request to modify the firewall as follows:

<Code lang="bash" code={`
curl --request PATCH \
  --url https://api.azion.com/v4/edge_firewall/firewalls/<edge_firewall_id> \
  --header 'Accept: application/json' \
  --header 'Authorization: Token [TOKEN VALUE]' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "My firewall",
    "modules": {
      "edge_functions": { "enabled": true },
      "network_protection": { "enabled": true },
      "waf": { "enabled": true }
    },
    "debug": true,
    "active": true
  }'
`} />


| Key | Description |
| --- | --- |
| `name` | Name of the firewall |
| `is_active` | Boolean value that enables (`true`) or disables (`false`) the firewall |
| `edge_functions_enabled` | Boolean value that enables (`true`) or disables (`false`) the [Functions](/en/documentation/products/secure/firewall/functions/) module |
| `network_protection_enabled` | Boolean value that enables (`true`) or disables (`false`) the [Network Shield](/en/documentation/products/secure/firewall/network-shield/) module |
| `waf_enabled` | Boolean value that enables (`true`) or disables (`false`) the [Web Application Firewall (WAF)](/en/documentation/products/secure/firewall/web-application-firewall/) module |
| `debug_rules` | Boolean value that enables (`true`) or disables (`false`) the [Debug Rules](/en/documentation/products/guides/debug-rules/) feature |

Wait a few minutes for the changes to propagate and your firewall will be updated.

:::tip
Check the [Azion API documentation](https://api.azion.com/) to know more about what the Azion API can offer.
:::
</Fragment>

</Tabs>

---