# ACL Aliases

ACL alias functionality allows administrators to create reusable elements which can then be used when defining a destination in multiple ACL rules.

For example, you can define aliases for commonly used ports (e.g. 22 for SSH) or for services within your infrastructure (e.g. 1.2.3.4:5432 for a particular PostgreSQL server).

{% hint style="warning" %}

#### Availability

This feature is available in all plans, with usage limits. See the [pricing page](https://defguard.net/pricing/) for details.
{% endhint %}

{% hint style="warning" %}
Access Control is available in Defguard version ≥ 1.3.0 and Gateway version ≥ 1.3.0
{% endhint %}

## Alias management

All the aliases defined in your systems are displayed in the second tab of the **Access Control List** page.

### List of aliases

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-ad5d4e58a36be3b48cf98c27fca41e6651158694%2Fimage.png?alt=media" alt=""><figcaption><p>ACL alias list</p></figcaption></figure>

Similarly to ACL rules themselves, the list is split into two sections:

* **Deployed Aliases** – aliases that are active and can be used by ACL rules.
* **Pending Changes** – aliases that have been modified and have not yet been deployed.

To deploy pending changes, use the **Deploy pending changes** button. It will deploy selected or all pending changes.

{% hint style="warning" %}
When the alias changes are deployed, firewall rules will be updated for all affected locations.
{% endhint %}

### How to add and modify aliases

To create a new rule, use the **Add new** button on the list view.

You can edit an existing rule by using the ![](https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-869d1d54e6a907373c04f564ec793bd4b70adb84%2Fimage.png?alt=media) context menu and selecting **Edit** in the list view.

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-7ce4ea96dacab82e1e1024ca54a910e46f886069%2Fimage.png?alt=media" alt=""><figcaption><p>Alias creation form</p></figcaption></figure>

In the ACL alias form, you can specify alias name and [type](https://docs.defguard.net/features/access-control-list/..#alias-types).

Below in the **Destination** section, you can enter the same resource configuration as in the [ACL rule Destination](https://docs.defguard.net/features/access-control-list/..#destination):

* IP addresses
* Ports or port ranges
* Protocols

{% hint style="info" %}
Unlike ACL rules, newly created aliases have **Applied** status, since they do not alter any traffic unless used by a rule.
{% endhint %}

### Removing aliases

To remove an alias, select the **Delete alias** option from the context menu.

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-34bd6e3825b3c1015c0f095eba7556c7b95bdf44%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Unlike with ACL rules, alias deletion is not tracked as a modification. You cannot delete an alias if it's being used by any rules and deleting unused aliases is immediate, not requiring changes to be deployed.

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-08c83c97bec6e9119f70dac422840864b12453b9%2Fimage.png?alt=media" alt=""><figcaption><p>You cannot delete aliases used by ACL rules</p></figcaption></figure>

## Using aliases in ACL rules

Aliases can be used to define an ACL rule destination by selecting them in the input within the **Destination** section:

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-8ca2d66c1e07169e359fe7c0d469437c964d59d5%2Fimage.png?alt=media" alt=""><figcaption><p>ACL rule Destination section with Aliases field</p></figcaption></figure>

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-8d70d0e6b7f417ccc18371fb664ee81a28f5a28f%2Fimage.png?alt=media" alt=""><figcaption><p>Alias select modal</p></figcaption></figure>

## Alias types

Aliases are divided into two distinct types to handle various use-cases:

* **Destination** alias – defines a complete [ACL destination](https://docs.defguard.net/features/access-control-list/..#destination); it will be translated into a separate set of firewall rules.
* **Component** alias – defines a part of [ACL destination](https://docs.defguard.net/features/access-control-list/..#destination); it will be merged with destination manually configured in a given ACL rule when generating firewall rules.

### Examples

Let's start with an ACL rule that defines a following destination:

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-c9fd008dc3e0270dad65faa2437c33135e23c6a3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

By itself, this rule allows specified users to access **all ports** and **all protocols** on the specified IP.

#### Component alias

Consider an **SSH** alias with a following definition:

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-7a016e7610f5cde889dfb9bf8b92040a9a68547a%2Fimage.png?alt=media" alt=""><figcaption><p>SSH component alias definition</p></figcaption></figure>

When used in the previously created ACL rule, port 22 will be added to manual inputs defined in the rule itself.

In effect the rule will now grant access **only** to port 22 on 10.2.0.5, just like if we entered the port number in the rule's **Manual Input** section.

#### Destination alias

Now consider the following alias:

<figure><img src="https://3466771104-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fe86iamwJVSYnIRsyVEAV%2Fuploads%2Fgit-blob-fc747afd9bf7aa891cc9fe1ac60e741c2d420def%2Fimage.png?alt=media" alt=""><figcaption><p>Postgres server destination alias</p></figcaption></figure>

When used in the previously defined ACL rule it will have the following effects:

* the rule will still grant access to **all ports** and **all protocols** on 10.2.0.5
* it will also independently grant access to port 5432 in 10.2.0.38

In effect this is like if the rule has two separate destination inputs.

Underneath this is achieved by creating a separate set of firewall rules (one ALLOW and one DENY) for each destination alias.
