# Security Firewall Rule

Firewall rules allow you to permit or deny connections to or from a virtual machine (vm) based on the configuration you specify. When you create a firewall rule, you define a set of components that determine what the rule does. Components allow you to target specific traffic types, based on traffic protocols, destination ports, sources, and destinations.

{% hint style="warning" %}
Before creating a Security Firewall Rule, you must first have an Instance. If you don't have an Instance yet, you can deploy an Instance in Create VM Instance
{% endhint %}

Here are the steps to create a Security Firewall Rule:

* On your **Service Portal AI**, select the **Security** menu then click the **Create Security** button.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2F2d6O7GwoXYamdxohYHCZ%2Fimage%20(1).png?alt=media&#x26;token=dd060ffb-d659-41b2-bd43-2447c3050df0" alt=""><figcaption></figcaption></figure>

* To create a new Security Firewall Rule, complete the form as shown below.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FUHf1jhgT7LEaufxbzDlH%2Fimage.png?alt=media&#x26;token=8aaa6ddf-d5cb-42ed-9a09-d36d04a5e807" alt=""><figcaption></figcaption></figure>

* The following table describes each field in the Create Security form.

<table><thead><tr><th width="220">Column</th><th>Description</th></tr></thead><tbody><tr><td><strong>Name</strong></td><td>Name of your security.</td></tr><tr><td><strong>Description</strong></td><td>Description of the security configuration.</td></tr><tr><td><strong>Inbound Rule</strong></td><td>Define the traffic allowed to the instance on which ports and from which sources.</td></tr><tr><td><strong>Outbound Rule</strong></td><td>Define the traffic allowed to leave the instance on which ports and to which destinations.</td></tr><tr><td><strong>Applied to Instances</strong></td><td>Select the instances to which this security rule will be applied.</td></tr></tbody></table>

* After reviewing the field descriptions above, follow the steps below to create a Security Firewall Rule.
* Fill in the Create Security form by entering the name of the security configuration in the **Name** field and entering the description in the **Description** field.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FnNdjzLCyytHW3xmdzpx0%2Fimage.png?alt=media&#x26;token=dcb0168e-ada0-4d27-97de-52ad586ddb8d" alt=""><figcaption></figcaption></figure>

* In the **Inbound Rule** section, click the **New Rule** button to add a new rule, define the required rule parameters in the available fields, and click the **Delete** button if you want to remove an existing inbound rule.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FChLwALp5Gn7y4CBSTmR1%2Fimage.png?alt=media&#x26;token=136293bc-41e9-4b00-bba2-90bfdc0924f3" alt=""><figcaption></figcaption></figure>

* In the **Outbound Rule** section, click the **New Rule** button to add a new rule, define the required rule parameters in the available fields, and click the **Delete** button if you want to remove an existing outbound rule.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FKpBlJ3cpiFi6I51Xg8EF%2Fimage.png?alt=media&#x26;token=c337689a-5038-4897-bbe4-126fca0ffd08" alt=""><figcaption></figcaption></figure>

* Select the instance in the **Applied to Instances** field where the security configuration will be applied.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FM3php9pSnSF4ihyBZ8tz%2Fimage.png?alt=media&#x26;token=bb48bb46-d81d-4afd-b03b-6b13651497bb" alt=""><figcaption></figcaption></figure>

* Click the **Create** button to save the security configuration, or click the **Cancel** button if you do not want to continue the process.&#x20;

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FpyAJ1i6L8oX8ucGFD75Z%2Fimage.png?alt=media&#x26;token=07e57bab-d471-40e7-89ec-553458570f5c" alt=""><figcaption></figcaption></figure>

* A notification will appear displaying the message "**Security has successfully created**".

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2F5UVLu7hUGcqUD3pEXc42%2Fimage.png?alt=media&#x26;token=f8eee6c0-9328-42f1-b781-9e19b4e47a62" alt=""><figcaption></figcaption></figure>
