doc/user/content/sql/create-network-policy.md
Available for Materialize Cloud only
CREATE NETWORK POLICY creates a network policy that restricts access to a
Materialize region using IP-based rules. Network policies are part of
Materialize's framework for access control.
{{% include-syntax file="examples/create_network_policy" example="syntax" %}}
When you enable a Materialize region, a default network policy named default
will be pre-installed. This policy has a wide open ingress rule allow 0.0.0.0/0. You can modify or drop this network policy at any time.
{{< note >}}
The default value for the network_policy session parameter is default.
Before dropping the default network policy, a superuser (i.e. Organization Admin) must run ALTER SYSTEM SET network_policy to
change the default value.
{{< /note >}}
The privileges required to execute this statement are:
{{% include-headless "/headless/sql-command-privileges/create-network-policy" %}}
CREATE NETWORK POLICY office_access_policy (
RULES (
new_york (action='allow', direction='ingress',address='1.2.3.4/28'),
minnesota (action='allow',direction='ingress',address='2.3.4.5/32')
)
);
ALTER SYSTEM SET network_policy = office_access_policy;