CertSafari
    Snowflake SnowPro Advanced: Security Engineer (SEA-C01)· Lessons

    Domain 5 · Lesson 21/21

    Native App permissions: application roles, app specifications and app secrets

    Manage security in Snowflake Native Apps.

    11 min read
    4% of exam
    7 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Grant a provider's application roles to account roles so each consumer team gets the right access to the app and its Streamlit UI
    • Compare automated granting of privileges (manifest_version 2) with manual grants and references
    • Explain how app specifications let consumers approve external endpoints and OAuth connections
    • Choose between a consumer-bound SECRET reference and an app-owned OAuth secret for app credentials

    1.Application roles decide who in the consumer account can use the app

    After installation, a Native App controls access with application roles: roles that exist only inside the application object (the role model is covered in Account roles, database roles, SNOWFLAKE database roles and application roles). The provider creates these roles in the setup script and grants them privileges on the app's objects. A simple app needs nothing beyond them, because the setup script creates all its objects inside the APPLICATION object and manages access through application roles.

    Setup-script grant that lets the app_public application role open the app's Streamlit UIsql
    GRANT USAGE ON STREAMLIT code_schema.hello_snowflake_streamlit TO APPLICATION ROLE app_public;

    The consumer works one layer up. Application roles are implicitly granted to the application owner WITH GRANT OPTION, so the consumer admin who owns the app passes each application role to the account roles that should use it. Take an app that exposes viewer and admin, where analysts need the dashboards and only the security team may change configuration. The admin grants viewer to the analysts' account role and admin to the security team's account role. The provider has already decided in the setup script what each role can reach, including whether it can open the Streamlit UI. The consumer's job is only to map those roles to people.

    Checkpoint 1 of 6· Check yourself

    A consumer installs a simple Native App. All of its objects live inside the APPLICATION object, and it exposes two application roles, viewer and admin. Analysts should see the dashboards, and only the security team should change the configuration. What should the consumer admin who owns the app do?

    Checkpoint 2 of 6· Exam question

    A consumer admin has installed a Native App that exposes the application roles viewer and admin. Analysts must use the app's dashboards, while only the security team may change its configuration. What should the admin do?

    Sources12

    2.Automated granting versus consumer-run grants

    Some apps need more than the application object: they create a database, or they read a table the consumer already owns. Those actions need privileges granted from the consumer account, and there are two ways to grant them.

    Automated granting is turned on by manifest_version: 2. The provider lists the required privileges in the manifest, and Snowflake grants them when the app is installed or upgraded. Snowsight shows a notification of the requested privileges during installation, and that is the consumer's moment to review them. Because upgrades don't ask again, feature policies are how a consumer limits which objects an app can create.

    Without automated granting, the consumer has to act. If the provider built a UI with the Python Permission SDK, the consumer approves requests in Snowsight and the SDK runs the GRANT statements. Otherwise, the provider must tell the consumer which SQL to run, ideally in the README shown with the listing. Access to existing consumer objects works through references. The provider names a logical reference in the manifest, and the consumer binds it to a real, fully qualified object. The provider never needs to know the object's actual database or schema name.

    Checkpoint 3 of 6· Check yourself

    A provider is building an app that must read a sales table the consumer already owns. Each consumer stores that table in a different database and schema, and the provider can't know those names in advance. How should the app get access to the table?

    Sources32

    3.App specifications: consumer approval for external connections

    An app specification is how an app asks the consumer to approve a connection that leaves Snowflake. For outbound network access (the integration itself is covered in External access integrations), the app can be granted CREATE EXTERNAL ACCESS INTEGRATION, which lets it create the integration during install or upgrade. The connection details still go to the consumer for approval. The EAI specification lists HOST_PORTS, the host ports from the network rule that the app requires, and PRIVATE_HOST_PORTS for private connectivity to resources outside Snowflake.

    The entries in the specification must match the network rule exactly. A port that is left out defaults to 443, but example.com and example.com:443 are still not treated as equal. A specification that lists one form while the network rule holds the other will cause egress to fail.

    An app specification asking the consumer to approve an OAuth security integrationsql
    ALTER APPLICATION SET SPECIFICATION oauth_spec
      TYPE = SECURITY_INTEGRATION
      LABEL = 'OAuth connection to external provider'
      DESCRIPTION = 'Connects to external provider using Authorization Code grant'
      OAUTH_TYPE = 'AUTHORIZATION_CODE'
      OAUTH_TOKEN_ENDPOINT = 'https://provider.example.com/oauth2/token'
      OAUTH_AUTHORIZATION_ENDPOINT = 'https://provider.example.com/oauth2/authorize';

    Security integrations follow the same rule. An app cannot use a security integration until the consumer has approved the matching specification. Approving one requires the MANAGE APPLICATION SPECIFICATIONS privilege on the account. Declining the specification later is also how the consumer stops the app from using that connection.

    Checkpoint 4 of 6· Fill the gap

    A provider's app needs an OAuth connection to an external service, and the consumer has to approve it before the app can use it. Which value completes the specification type in this setup-script statement?

    ALTER APPLICATION SET SPECIFICATION oauth_spec
      TYPE =  ? 
      LABEL = 'OAuth connection to external provider'
      DESCRIPTION = 'Connects to external provider using Authorization Code grant'
      OAUTH_TYPE = 'AUTHORIZATION_CODE'
      OAUTH_TOKEN_ENDPOINT = 'https://provider.example.com/oauth2/token'
      OAUTH_AUTHORIZATION_ENDPOINT = 'https://provider.example.com/oauth2/authorize';

    Sources45

    4.Keeping third-party keys and OAuth tokens out of app code

    Credentials can never be part of the package. Plain-text customer secrets are forbidden, and obfuscated code is rejected, so hiding a key with base64 encoding fails twice. Loading the key from somewhere outside the package breaks the self-containment rule. The two compliant patterns both keep the credential in a Snowflake secret (secret types are covered in Snowflake secrets (password, generic string, OAuth, cloud provider token)). They differ in who owns that secret.

    Use a consumer-bound SECRET reference when each consumer has their own API key. The manifest declares a reference with object_type: SECRET and the READ privilege. Each consumer creates a secret in their own account and binds it to the reference. The app's UDF then reads the secret and calls the API through the approved external access integration.

    Manifest reference asking the consumer to bind their own secretyaml
    references:
     ...
     - consumer_secret:
         label: "Consumer secret"
         description: "Needed to authenticate with an external endpoint"
         privileges:
           - READ
         object_type: SECRET
         register_callback: config.register_my_secret
         configuration_callback: config.get_config_for_ref

    Use an app-owned OAuth secret when the consumer should authorize the app against a third-party service without sharing credentials with the provider (OAuth integrations are covered in SAML2 SSO and OAuth security integrations). The setup script creates an API_AUTHENTICATION security integration and a secret owned by the application. It grants USAGE on the integration and MODIFY on the secret to an application role, then defines a SECRET_AUTHORIZATION configuration. A consumer with that application role approves the integration specification and completes the OAuth consent, in Snowsight, in Streamlit through request_application_configuration_value(), or in SQL with SYSTEM$START_OAUTH_FLOW and SYSTEM$FINISH_OAUTH_FLOW. The tokens land in the secret, which a UDF, procedure or container receives through its SECRETS property.

    Configuration that ties the consumer's OAuth flow to an app-owned secretsql
    ALTER APPLICATION SET CONFIGURATION DEFINITION oauth_config
      TYPE = SECRET_AUTHORIZATION
      SECRET = app_schema.oauth_secret
      LABEL = 'Authenticate with external provider'
      DESCRIPTION = 'Complete the OAuth flow to connect the app to the external provider'
      APPLICATION_ROLES = (app_user);

    Snowflake refreshes the access token with the stored refresh token. If the refresh token expires or the third party revokes it, external calls fail until the consumer authenticates again. Revocation works differently from what many expect. Running UNSET CONFIGURATION only fires the configuration callbacks and leaves the tokens in the secret. To stop the app using them, decline the security integration specification. To kill the tokens outright, use the third party's own revocation process.

    Checkpoint 5 of 6· Match them up

    A consumer finished the OAuth flow for an app-owned secret, and the tokens are now stored in that secret. Match each event or action to what it actually does to the app's access.

    Tap a term, then the definition that fits it.

    Checkpoint 6 of 6· Exam question

    A provider's Native App calls a third-party REST API that requires an API key. The provider's security reviewer rejects any design that places the key in the application package. Which design satisfies the reviewer while still working for each consumer?

    Sources675

    Sources

    (7)

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

    1. 1.
      “After installing a Snowflake Native App, consumers can grant application roles to account roles to enable access to the app.”
      ↩︎ Application roles decide who in the consumer account can use the app
      “Application roles are implicitly granted to the application owner WITH GRANT OPTION.”
      ↩︎ Application roles decide who in the consumer account can use the app
    2. 2.
      “All of the necessary privileges required are managed by the app using application roles.”
      ↩︎ Application roles decide who in the consumer account can use the app
      “The Python Permission SDK automatically runs the required GRANT statements in the consumer account.”
      ↩︎ Automated granting versus consumer-run grants
      “A reference allows a provider to create the app without having to know the specific name of the object or its parent database and schema.”
      ↩︎ Checkpoint
    3. 3.
      “When a provider configures an app to use manifest_version: 2 in the manifest file, automated granting of privileges is enabled.”
      ↩︎ Automated granting versus consumer-run grants
      “During installation, Snowsight displays a notification about the privileges requested by the app.”
      ↩︎ Automated granting versus consumer-run grants
      “Consumers can create feature policies that restrict the objects an app can create.”
      ↩︎ Exam trap 3
      “they agree that the app may be granted these privileges during upgrades without requiring additional consent.”
      ↩︎ Prediction
    4. 4.
      “When configuring the app, consumers review and approve the host ports and external services.”
      ↩︎ App specifications: consumer approval for external connections
      “A mismatch between these values causes egress to fail.”
      ↩︎ App specifications: consumer approval for external connections
      “When the port is omitted, it defaults to 443, so example.com and example.com:443 are not considered equivalent.”
      ↩︎ Exam trap 2
    5. 5.
      “Applications can not use security integration without a corresponding approved application specification.”
      ↩︎ App specifications: consumer approval for external connections
      “the secret must be owned by the application”
      ↩︎ Keeping third-party keys and OAuth tokens out of app code
      “If the refresh token itself expires or is revoked by the third-party provider, external access calls from the app fail”
      ↩︎ Keeping third-party keys and OAuth tokens out of app code
      “Unsetting the configuration does not invalidate or revoke the OAuth tokens stored in the secret.”
      ↩︎ Exam trap 1
      “Unsetting the configuration does not invalidate or revoke the OAuth tokens stored in the secret.”
      ↩︎ Checkpoint

    Ready to test yourself?

    Practise the 15 questions on this subdomain.

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