Area: Deployment Issues
Sub-Area: Network Policy & Firewall Allowlisting
Applies to: Cloud
Issue
You want to lock down the Snowflake user that DataHub uses for ingestion with a network policy, for example as part of CIS benchmark hardening. To do that, you need the IP addresses that DataHub's connections to Snowflake come from. The IPs you see in Snowflake login history only show the connections that already happened, so they are not a safe source for a complete allowlist.
You Might Be Asking
- Which IP addresses should I add to my Snowflake network policy so DataHub Cloud can connect?
- Does DataHub Cloud publish a list of egress IPs?
- Are the IPs in my Snowflake login history enough to build the allowlist?
- I run a Remote Executor. Do I still allowlist DataHub's IPs?
Solution
- Find out where your Snowflake ingestion runs.
The source IP that Snowflake sees depends on which process connects to Snowflake. See Ingestion Security Comparison for the full comparison.
- UI ingestion on DataHub Cloud's own executor: DataHub's infrastructure connects to Snowflake. Allowlist DataHub's egress IPs (step 2).
- Remote Executor: the executor runs in your infrastructure and connects to Snowflake from there. Allowlist the egress IPs of the network where the executor runs, not DataHub's IPs. See About Remote Executor.
- DataHub CLI: the CLI connects to Snowflake from the machine where you run it (laptop, CI/CD runner, Airflow worker). Allowlist that machine's egress IPs.
If you use more than one of these for Snowflake, the policy must allow every one of them.
- Get DataHub's egress IPs.
DataHub's public documentation does not list egress IPs. Contact DataHub Support. In your request, include:
- Your DataHub Cloud URL (for example
https://<your-company>.acryl.io). - That your Snowflake source runs as UI ingestion on DataHub's executor.
- A request for the egress IPs that this ingestion connects to Snowflake from.
- A question about whether these IPs can change, so you know when to update your policy.
- Create a network policy and apply it to the DataHub service user.
-- Allow only the IPs that DataHub ingestion connects from
CREATE NETWORK POLICY datahub_cloud_policy
ALLOWED_IP_LIST = (
'<egress-ip-1>',
'<egress-ip-2>',
'<egress-ip-3>'
);
-- Apply the policy to the Snowflake user that DataHub uses
ALTER USER <SERVICE_DATAHUB_USER>
SET NETWORK_POLICY = datahub_cloud_policy;
Replace the <egress-ip-N> values with the IPs from step 1 and step 2. Replace <SERVICE_DATAHUB_USER> with the Snowflake user in your DataHub Snowflake recipe.
- Check that DataHub can still connect.
In DataHub, open your Snowflake source and click Test Connection, or run the ingestion source. Then check Snowflake login history for the DataHub user to see which IPs connected and whether the logins succeeded:
SELECT
event_timestamp,
user_name,
client_ip,
reported_client_type,
is_success
FROM snowflake.account_usage.login_history
WHERE user_name = '<SERVICE_DATAHUB_USER>'
ORDER BY event_timestamp DESC
LIMIT 50;
If you see failed logins from an IP that is not in your policy, find out which of the paths in step 1 it belongs to before you add it.
Additional Notes
Don't build the allowlist only from IPs in Snowflake login or query history. That list only holds the connections that already happened, so it misses any path that has not connected yet. Get DataHub's IPs from DataHub Support, and add your own executor and CLI egress IPs yourself.
If DataHub logins that worked before start to fail, run the login history query from step 4. The client_ip of the failed logins shows which IP the policy blocked. If that IP belongs to UI ingestion on DataHub's executor, contact DataHub Support with that IP and your DataHub Cloud URL.