# NETWORK POLICY

Config path: `/network_policy.yaml`

Example:

```yaml
test_network_policy_1:
  allowed_ip_list:
    - 0.0.0.0/0
  blocked_ip_list:
    - 1.1.1.1
    - 8.8.8.8

test_network_policy_2:
  allowed_network_rule_list:
    - my_db.my_schema.my_rule_1
    - my_db.my_schema.my_rule_2
  blocked_network_rule_list:
    - my_db.my_schema.my_rule_3
    - my_db.my_schema.my_rule_4

```

## Schema

* *{key}* (ident) - name of network policy
* *{value}* (dict)
  * **allowed\_network\_rule\_list** (list)
    * *{items}* (ident) - network rules allowing access to Snowflake account
  * **blocked\_network\_rule\_list** (list)
    * *{items}* (ident) - network rules blocking access to Snowflake account
  * **allowed\_ip\_list** (list)
    * *{items}* (str) - IPv4 addresses that are allowed access to Snowflake account
  * **blocked\_ip\_list** (list)
    * *{items}* (str) - IPv4 addresses that are denied access to Snowflake account
  * **comment** (str)&#x20;

## Usage notes

1. It is recommended to review and apply changes to `NETWORK POLICIES` manually due to high security risk.
2. Since `NETWORK POLICIES` are account-level objects and `NETWORK RULES` are schema-level objects, names of network rules should be fully qualified `<database>.<schema>.<name>`.

## Links

* [CREATE NETWORK POLICY](https://docs.snowflake.com/en/sql-reference/sql/create-network-policy.html)
* [ALTER NETWORK POLICY](https://docs.snowflake.com/en/sql-reference/sql/alter-network-policy.html)
* [DESC NETWORK POLICY](https://docs.snowflake.com/en/sql-reference/sql/desc-network-policy.html)
* [Parser & JSON Schema (GitHub)](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/parser/network_policy.py)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snowddl.com/basic/yaml-configs/network-policy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
