> ## Documentation Index
> Fetch the complete documentation index at: https://help.elationhealth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Network Policies

<Warning>
  There is no UI interface to create a network policy for USERADMIN roles on a reader account. You must create, view, remove network polices via a worksheet.

  Please check out the official snowflake documentation for more information [https://docs.snowflake.com/en/sql-reference/sql/create-network-policy](https://docs.snowflake.com/en/sql-reference/sql/create-network-policy)
</Warning>

You can follow the syntax guide located in the official[ Snowflake documentation](https://docs.snowflake.com/en/sql-reference/sql/create-network-policy)

<CodeGroup>
  ```sql sql theme={null}
  CREATE [ OR REPLACE ] NETWORK POLICY <name>
     [ ALLOWED_NETWORK_RULE_LIST = ( '<network_rule>' [ , '<network_rule>' , ... ] ) ]
     [ BLOCKED_NETWORK_RULE_LIST = ( '<network_rule>' [ , '<network_rule>' , ... ] ) ]
     [ ALLOWED_IP_LIST = ( [ '<ip_address>' ] [ , '<ip_address>' , ... ] ) ]
     [ BLOCKED_IP_LIST = ( [ '<ip_address>' ] [ , '<ip_address>' , ... ] ) ]
     [ COMMENT = '<string_literal>' ]
  ```
</CodeGroup>

## Creating a Network Policy

**Step 1:** Create a new worksheet and lets view what existing Network Policies we have

<CodeGroup>
  ```sql sql theme={null}
  SHOW NETWORK POLICIES;
  ```
</CodeGroup>

<Frame caption="In this example there are no Network Policies created">
  <img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-show-network-policies-results.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=d5e2a4d4cadd652a8a8888514626e07e" width="2246" height="430" data-path="images/reference/snowflake-show-network-policies-results.png" />
</Frame>

<Info />

**Step 2:** Lets start by creating a Network Policy with an `ALLOWED_IP_LIST`

```
CREATE NETWORK POLICY mypolicy2 ALLOWED_IP_LIST=('999.999.99.000','111.222.1.000');
```

**Step 3:** Now lets view your newly created Network Policy

Run the below command to view your Network Policies and which IP addresses are currently assigned

<CodeGroup>
  ```sql sql theme={null}
  DESC NETWORK POLICY <your_policy_name>;
  ```
</CodeGroup>

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-describe-network-policy-results.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=b68d474ad7bfd17a84f4ef640fb91d45" alt="" width="2252" height="178" data-path="images/reference/snowflake-describe-network-policy-results.png" />

<CodeGroup>
  ```sql sql theme={null}
  ALTER NETWORK POLICY MYPOLICY2 SET BLOCKED_IP_LIST=('22.222.11.111');
  ```
</CodeGroup>

Lets run DESC on the Network Policy name to verify our changes

<CodeGroup>
  ```sql sql theme={null}
  DESC NETWORK POLICY <your_policy_name>;
  ```
</CodeGroup>

## **Activating Your Network Policy**

Once your Network Policy is created reach out to [Elation Support Portal](/articles/support-portal-introduction) to setup additional permissions to allow you to activate your Network Policy

When Elation Health has completed the steps required to activate your Network Policy run the below command to activate your Network Policy

```
call database.schema_name.setNetworkPolicy('MYPOLICYNAMEEXAMPLE');
```

**Verifying your Network Policy is active**

To view your newly created Network Policy run the below command

<CodeGroup>
  ```sql snowflake theme={null}
  SHOW PARAMETERS LIKE 'network_policy' IN ACCOUNT;
  ```
</CodeGroup>

<Frame caption="You can verify the Network Policy is active by a populated field in columns value and level">
  <img src="https://mintcdn.com/elationhealth/aqLVKRo1Jpffmnwl/images/reference/snowflake-account-network-policy-parameter.png?fit=max&auto=format&n=aqLVKRo1Jpffmnwl&q=85&s=362190ac9a36732f750368a2d7622484" width="2244" height="194" data-path="images/reference/snowflake-account-network-policy-parameter.png" />
</Frame>

Or reach out to [Elation Support Portal](/articles/support-portal-introduction) for a representative to verify your Network Policy has been activated.

## **Switching between active Network Policies**

You can only have one active network policy at a time

<CodeGroup>
  ```sql sql theme={null}
  ALTER NETWORK POLICY MYPOLICY2 SET BLOCKED_IP_LIST=('22.222.11.111');
  ```
</CodeGroup>

Lets run DESC on the Network Policy name to verify our changes

<CodeGroup>
  ```sql sql theme={null}
  DESC NETWORK POLICY <your_policy_name>;
  ```
</CodeGroup>

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-describe-network-policy-updated-results.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=9aebbd576d3b36e94386a0d872f7b080" alt="" width="2252" height="254" data-path="images/reference/snowflake-describe-network-policy-updated-results.png" />

## **Updating an Existing Network Policy**

If you need to add additional IP addresses, remove IP addresses, or add in a new parameter you can use the ALTER statement.

For example: Lets use the ALTER statement to add a list of blocked IP addresses to our newly created Network Policy

<CodeGroup>
  ```sql sql theme={null}
  ALTER NETWORK POLICY MYPOLICY2 SET BLOCKED_IP_LIST=('22.222.11.111');
  ```
</CodeGroup>

Lets run DESC on the Network Policy name to verify our changes

<CodeGroup>
  ```sql sql theme={null}
  DESC NETWORK POLICY <your_policy_name>;
  ```
</CodeGroup>

<img src="https://mintcdn.com/elationhealth/c_0GuvXN24rkf1qg/images/reference/snowflake-describe-network-policy-updated-results.png?fit=max&auto=format&n=c_0GuvXN24rkf1qg&q=85&s=9aebbd576d3b36e94386a0d872f7b080" alt="" width="2252" height="254" data-path="images/reference/snowflake-describe-network-policy-updated-results.png" />

## **Removing a Network Policy**

Run the below command to remove a Network Policy

<CodeGroup>
  ```sql sql theme={null}
  DROP NETWORK POLICY IF EXISTS mypolicy2;
  ```
</CodeGroup>

You can then run the bellow command to verify if it has been removed

```
SHOW NETWORK POLICIES;
```
