CertSafari
    Snowflake SnowPro Specialty: Native Apps· Lessons

    Domain 1 · Lesson 2/12

    External access in Native Apps: network rules, EAIs and secrets

    Given a scenario, design security and privilege strategies.

    9 min read
    11% of exam
    5 sources
    Published 21 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Build the network rule, external access integration and app specification chain an app needs to call an external API
    • Match the host ports in an app specification exactly to the network rule
    • Meet the security requirements for outbound traffic: HTTPS, no plain-text secrets, Snowflake-first authentication and listing disclosure
    • Design an app that waits for, detects and works around declined or partly approved external access requests

    1.From network rule to approved external access

    A Native App is closed to the internet by default. To call an outside API, it needs three objects, each one narrowing the access further. A network rule lists the hosts and ports, in egress mode. An external access integration (EAI) groups the allowed network rules. And an app specification puts those hosts in front of the consumer for approval (App specifications and feature policies). The setup script creates all three. The manifest only requests CREATE EXTERNAL ACCESS INTEGRATION, which is granted automatically under manifest_version: 2.

    The EAI then exists in the consumer account, but it does nothing yet. It stays unusable until the consumer approves the app specification for the requested host ports. Once approved, UDFs and procedures that name the EAI in EXTERNAL_ACCESS_INTEGRATIONS can reach only the hosts in its network rules. An EAI accepts only egress rules.

    Setup script: the app specification that asks the consumer to approve a hostsql
    ALTER APPLICATION SET SPECIFICATION eai_app_spec
      TYPE = EXTERNAL_ACCESS
      LABEL = 'Connection to an external API'
      DESCRIPTION = 'Access an API that exists outside Snowflake'
      HOST_PORTS = ('example.com')
    Host entries in an EAI app specification
    FieldWhat it lists
    HOST_PORTSHost ports defined in the network rule that the app requires
    PRIVATE_HOST_PORTSPrivate host ports that allow private connectivity to resources outside Snowflake

    The safe habit is to write every host the same way in both places, with or without a port, and never mix the two. One app specification covers all the EAIs the app creates. A provider can split external access across several specifications, so that the consumer approves each integration separately.

    Checkpoint 1 of 4· Fill the gap

    This setup-script statement asks the consumer to approve the app's calls to the public API at example.com. Which entry completes it?

    ALTER APPLICATION SET SPECIFICATION eai_app_spec
      TYPE = EXTERNAL_ACCESS
      LABEL = 'Connection to an external API'
      DESCRIPTION = 'Access an API that exists outside Snowflake'
       ?  = ('example.com')

    Checkpoint 2 of 4· Check yourself

    An app uses manifest_version: 2 and requests CREATE EXTERNAL ACCESS INTEGRATION. Its setup script creates the network rule, the EAI and the app specification without errors. The consumer has not reviewed anything yet. What happens when a UDF that names the EAI tries to call the external host?

    Sources12

    2.Security requirements for outbound traffic and credentials

    Snowflake's security requirements set rules for an app's traffic in both directions. Outbound traffic to the internet should use HTTPS with a valid TLS certificate. Inbound connections to the app, including web interfaces and APIs, must first authenticate through a Snowflake-provided method. Any app-specific login comes after that, and the app should expose no public endpoint that skips Snowflake authentication.

    Credentials for an external API never go in plain text. Apps must not store or require plain-text customer secrets, so an API key or OAuth token belongs in a Snowflake secret object. An EAI decides which secrets handler code may use through ALLOWED_AUTHENTICATION_SECRETS. With the older reference-based design, the app requests a SECRET reference with READ and an EXTERNAL ACCESS INTEGRATION reference with USAGE, and the consumer creates both objects. For new apps, Snowflake recommends automated granting of privileges with app specifications instead.

    The network rule is only part of the protection. Snowflake enforces network rules at the IP level and does not inspect the app's traffic, so a host that serves several services is a weak target. The listing must also disclose the external surface: every internet endpoint and URL the app connects to, and every external function it contains. All the code that makes those calls must ship inside the application package. Snowflake-provided libraries are the only exception.

    Checkpoint 3 of 4· Check yourself

    A provider's app calls a third-party scoring API that needs an API key. Of these four designs, which one meets Snowflake's security requirements for Native Apps?

    Sources324

    3.Designing for approval, partial approval and refusal

    The consumer approves or declines each app specification separately, after the app is installed. Automated granting lets the app create the EAI, but approval of the specification is still up to the consumer. The app therefore has to work in three states: not yet approved, approved, and declined. A fourth state is easy to miss. An app might ask for several network ports and get only one, so the code that calls each host needs its own error handling, plus a clear message that tells the consumer which feature depends on which approval.

    Polling for approval is unnecessary. The provider can register a callback procedure that runs whenever the consumer approves or declines a specification, and the procedure receives the specification's name and status. That procedure is where to hold off API calls until approval arrives and to set up whatever the approved feature needs.

    Manifest: registering a callback for specification approvals and declinesyaml
    lifecycle_callbacks:
      specification_action: callbacks.on_spec_update

    An app with a Streamlit frontend can ask for approval at the moment it is needed. The Python Permission SDK's request_application_specification_review() opens a dialog where the consumer can approve, decline or take no action. get_application_specifications() lists the current specifications so the UI can show which features are switched off. When a provider changes a specification's definition, for example by adding a host, its sequence number goes up, and the consumer can see that there is a changed request to review.

    Checkpoint 4 of 4· Fill the gap

    Instead of polling, the provider wants Snowflake to run callbacks.on_spec_update every time the consumer approves or declines an app specification. Which manifest key completes the registration?

    lifecycle_callbacks:
       ? : callbacks.on_spec_update

    Sources5

    Practise it for real

    Give an app approval-gated access to one external host

    1. 1.Set manifest_version: 2 and add CREATE EXTERNAL ACCESS INTEGRATION under privileges, with a description that explains why the app needs it.

      Why: Under manifest version 2, this privilege is granted automatically at install so the setup script can create the EAI.

      You should see: The app holds the privilege after installation without the consumer granting it by hand.

    2. 2.In the setup script, run CREATE OR REPLACE NETWORK RULE setup.my_network_rule TYPE = HOST_PORT VALUE_LIST = ( 'example.com' ) MODE = EGRESS;

      Why: The network rule sets the only destinations the app is allowed to reach.

      You should see: An egress rule naming example.com.

    3. 3.Create the EAI with CREATE OR REPLACE EXTERNAL ACCESS INTEGRATION my_app_prefix_eai_rule ALLOWED_NETWORK_RULES = (setup.my_network_rule) ENABLED = TRUE;

      Why: UDFs and procedures name the EAI, never the network rule directly.

      You should see: An EAI in the consumer account that stays unusable until approval.

    4. 4.Add ALTER APPLICATION SET SPECIFICATION eai_app_spec TYPE = EXTERNAL_ACCESS with HOST_PORTS = ('example.com'), written exactly as in the network rule.

      Why: The specification is what the consumer reviews, and any difference in host or port causes egress to fail.

      You should see: The consumer sees eai_app_spec waiting for approval.

    5. 5.Install the app, call a UDF that uses the EAI, then approve the specification and call it again.

      Why: This checks that external access depends on the consumer's approval.

      You should see: The call fails before approval and reaches example.com after it.

    Stuck? Get a nudge

    If the call still fails after approval, compare the HOST_PORTS entry and VALUE_LIST character by character, including the port.

    Sources

    (5)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “an app must create a network rule and an EAI, which uses network rules to restrict access to specific external network locations.”
      ↩︎ From network rule to approved external access
      “PRIVATE_HOST_PORTS: A list of private host ports that allow private connectivity to resources outside Snowflake.”
      ↩︎ From network rule to approved external access
      “A single app specification applies to all of the EAIs created by the app.”
      ↩︎ From network rule to approved external access
      “it is not usable until the consumer approves the app specifications that allow external access to the requested host ports.”
      ↩︎ Exam trap 1
      “When the port is omitted, it defaults to 443, so example.com and example.com:443 are not considered equivalent.”
      ↩︎ Prediction
      “it is not usable until the consumer approves the app specifications that allow external access to the requested host ports.”
      ↩︎ Checkpoint
    2. 2.
      “Specifies the allowed network rules. Only egress rules may be specified.”
      ↩︎ From network rule to approved external access
      “Specifies the secrets that UDF or procedure handler code can use when accessing the external network locations referenced in allowed network rules.”
      ↩︎ Security requirements for outbound traffic and credentials
      “Snowflake enforces the rules at the IP level of granularity.”
      ↩︎ Security requirements for outbound traffic and credentials
    3. 3.
      “Any communication between the app and the Internet should be over an HTTPS connection with a valid TLS certificate.”
      ↩︎ Security requirements for outbound traffic and credentials
      “Apps must not store or require any plain text customer secrets.”
      ↩︎ Security requirements for outbound traffic and credentials
      “All connections to an app, including web-based user interfaces and APIs, must first authenticate using a Snowflake-provided method of authentication.”
      ↩︎ Security requirements for outbound traffic and credentials
      “Your app must not load or execute any code from outside the application package except Snowflake-provided libraries.”
      ↩︎ Security requirements for outbound traffic and credentials
      “All Internet endpoints and URLs that the app connects to. All external functions in the app.”
      ↩︎ Exam trap 2
    4. 4.
      “For new apps, Snowflake recommends using automated granting of privileges with app specifications instead.”
      ↩︎ Security requirements for outbound traffic and credentials
    5. 5.
      “An app might request multiple network ports for an external access integration, but the consumer might allow only one.”
      ↩︎ Designing for approval, partial approval and refusal
      “always include proper error handling and provide clear feedback to consumers about which features require approved specifications to function.”
      ↩︎ Designing for approval, partial approval and refusal
      “define a callback stored procedure that runs when the consumer approves or declines an app specification.”
      ↩︎ Designing for approval, partial approval and refusal
      “Sequence numbers are automatically incremented when a provider changes the definition of the app specification.”
      ↩︎ Designing for approval, partial approval and refusal

    Ready to test yourself?

    Practise the 38 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.