# Automate security with Azion Functions

import DocButton from '~/components/webkit/DocButton.vue';

## Functions and Firewall

Functions are functions that run on the Azion Web Platform with low latency, bringing the operational power closer to the end user.

Through Functions, you can write your own security source code in **JavaScript** and deploy it to run at the edge of the network, allowing you to:

- Boost your protection
- Have more dynamism
- Apply the logic that your business requires
- Use APIs to manipulate request and response headers
- Implement logic based on network lists

---

## Develop functions for protection

The Azion Functions for the firewall run in the request phase, and respect the following process: 

1. The rules configured on the [Firewall Rules Engine](/en/documentation/products/secure/firewall/rules-engine/) for the function to run are triggered.
2. Azion Runtime processes the function, returning an outcome.
3. Firewall Rules Engine resumes the processing, based on the outcome, from the point the behavior was triggered.

<DocButton href="/en/documentation/products/secure/firewall/functions/" label="go to Functions for Firewall reference" kind="secondary" target="_blank" size="medium" />

---

## Secure with APIs

[Azion Runtime](/en/documentation/runtime/overview/) supports a list of APIs that allow manipulation of [metadata](/en/documentation/products/secure/automate/functions/#metadata) and the use of [network lists](/en/documentation/products/secure/automate/functions/##network-list) to help the logic implementation.

<DocButton href="/en/documentation/runtime-apis/javascript/" label="go to supported Web APIs" kind="secondary" target="_blank" size="medium" />
<DocButton href="/en/documentation/products/azion-edge-runtime/compatibility/node/" label="go to Node.js compatibility" kind="secondary" target="_blank" size="medium" />

### Metadata

The Metadata API enables access to a set of metadata that can be manipulated to:

- Filter and manage access to your application
- Apply specific logic in different scenarios based on GeoIP

<DocButton href="/en/documentation/products/applications/functions/runtime/api-reference/metadata/" label="go to Metadata API reference" kind="secondary" target="_blank" size="medium" />

### Network list

Azion Network List Interface allows matching an IP address against a specific network list. If the IP address informed is within the network list, it returns `true` and the desired implementation logic can go on based on that information.

The IPs listed inside network lists can be used to handle:

- Allowlists
- Blocklists
- Greylists

<DocButton href="/en/documentation/products/applications/functions/runtime/api-reference/metadata/" label="go to Network List API reference" kind="secondary" target="_blank" size="medium" />
<DocButton href="/en/documentation/products/secure/edge-firewall/network-layer-protection/network-lists/" label="go to Network Lists reference" kind="secondary" target="_blank" size="medium" /><br />

---