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

    Domain 2 · Lesson 7/21

    Restricting data exfiltration: unload destinations and result downloads

    Restrict data exfiltration.

    17 min read
    4.29% of exam
    8 sources
    Published 20 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Identify every destination an unload with COPY INTO can write to and the parameter that closes each one
    • Set the account-level parameters that close inline-URL, external-stage and internal-stage unload destinations
    • Choose between PREVENT_UNLOAD_TO_INLINE_URL, REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION and REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION for a given exfiltration pattern
    • State which unload parameters can be overridden per user and which are account-only
    • Restrict Snowsight result downloads with a UI_DOWNLOAD data movement rule and name the retrieval paths that rule does not cover

    Key concept

    Unload destination control — An unload with COPY INTO can write to an inline cloud URL, a named external stage, or an internal stage. Each account-level exfiltration parameter closes one of those destinations, so a lockdown is only complete when every destination is either closed or tied to an approved bucket.

    1.Where COPY INTO can write

    Data exfiltration in Snowflake usually means one statement: COPY INTO <location>. It takes a table or any SELECT, including joins across many tables, and writes the result as files. Because the source can be an arbitrary query, any data a role can read, it can also unload.

    The statement can write to three kinds of target:

    • an internal stage: a named internal stage, a table stage (@%table) or the user stage (@~), from which files are pulled down with the GET command
    • a named external stage that points at Amazon S3, Google Cloud Storage or Microsoft Azure
    • an external location typed straight into the statement as a URL such as 's3://bucket/path', with credentials or a STORAGE_INTEGRATION alongside it

    The third target is the most dangerous one. Anyone who holds keys for a bucket can name it inline with CREDENTIALS = (AWS_KEY_ID = ... AWS_SECRET_KEY = ...) and the data leaves the account. Credentials are only needed for private storage. They are not required for public buckets or containers, so an inline URL can send data to a world-readable bucket with no keys at all.

    No single setting closes all three targets. The sections that follow go through them one at a time: inline URLs, external stages, then internal stages. A real lockdown usually combines several of these settings.

    Account-level parameters are what restrict these destinations, and an account administrator sets them with ALTER ACCOUNT SET. PREVENT_UNLOAD_TO_INLINE_URL closes URLs typed into the statement. PREVENT_UNLOAD_TO_INTERNAL_STAGES closes every internal stage. REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION and REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION push external stages onto a storage integration, whose STORAGE_ALLOWED_LOCATIONS list then pins them to approved buckets.

    The value set on the account is the default for everyone. The two PREVENT_ parameters can be overridden for a single user; the two REQUIRE_ parameters cannot.

    Checkpoint 1 of 10· Check yourself

    A role can read a sensitive table but has no cloud keys and no storage integration. Can a user with that role still send the table's data to a world-readable S3 bucket with an unload statement?

    Sources123

    2.Blocking ad hoc unloads to inline URLs

    PREVENT_UNLOAD_TO_INLINE_URL blocks ad hoc unloads, meaning COPY INTO <location> statements that put the cloud storage URL and access settings directly in the statement. With the parameter set to TRUE, every unload has to name a stage: a named internal stage, a named external stage, a table stage or the user stage. Developers who used to type COPY INTO 's3://partner-bucket/out/' ... CREDENTIALS=(...) get an error. Unloads through approved named external stages keep working.

    The control is narrow on purpose. It does not look at how a named stage authenticates. A stage that was created with embedded keys still passes, because the parameter only checks whether the URL appears in the statement. The parameter also never touches stage creation. Developers who can still run CREATE STAGE can wrap the partner bucket in a new stage and unload through that. Closing that path takes the storage-integration requirements in the next section.

    Checkpoint 2 of 10· Check yourself

    With PREVENT_UNLOAD_TO_INLINE_URL = TRUE set on the account, which of these unload statements is rejected?

    Checkpoint 3 of 10· Exam question

    Developers in a Snowflake account on AWS can run COPY INTO 's3://partner-bucket/out/' FROM sales CREDENTIALS=(AWS_KEY_ID='...' AWS_SECRET_KEY='...') and send data to any bucket they hold keys for. The security engineer wants to block this pattern account-wide while still allowing unloads through approved named external stages. Which action achieves this?

    Sources4

    3.Requiring storage integrations: creation versus operation

    A storage integration stores a Snowflake-generated cloud IAM identity, plus an optional list of allowed or blocked locations. That makes it the way to tie stages to approved buckets (see storage integrations and allowed storage locations). Two account parameters make integrations mandatory, and they act at different moments.

    REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATION acts when a stage is created. With it set to TRUE, a CREATE STAGE for an external stage on private cloud storage must reference a storage integration as its credentials. A Terraform module that still writes CREDENTIALS=(AWS_KEY_ID=... AWS_SECRET_KEY=...) into new stages fails. Internal stages are not affected, because they have no cloud credentials. This parameter is not retroactive: stages that already exist with embedded keys keep working.

    REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION acts at run time, on both loading and unloading. With it set to TRUE, any load or unload against private cloud storage must go through a named external stage that references a storage integration. If the named stage references explicit credentials instead, the statement fails with a user error. This is the setting that breaks the nightly COPY INTO @legacy_ext_stage until the stage is rebuilt on an integration. It applies to loads as well, so ingestion pipelines that use legacy stages will break at the same moment.

    The stages at risk are the external stages whose definitions carry explicit cloud credentials instead of a STORAGE_INTEGRATION. Every COPY that reads from them or writes to them will fail once the parameter is TRUE, whether it unloads or loads. Inventory those stages and move each one onto an integration before you flip the switch.

    Checkpoint 4 of 10· Check yourself

    To limit the risk of breaking pipelines, an administrator plans to try REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION = TRUE on a single ETL service user before rolling it out. What will they find?

    Checkpoint 5 of 10· Exam question

    A platform team uses Terraform to create external stages. Auditors found several stages defined with CREDENTIALS=(AWS_KEY_ID=... AWS_SECRET_KEY=...) that point at buckets outside the company. The team wants Snowflake to reject any new external stage that does not name a storage integration, without affecting internal stages. What should the ACCOUNTADMIN configure?

    Checkpoint 6 of 10· Exam question

    Enforcement on stage creation is now active, but a nightly task still unloads with COPY INTO @legacy_ext_stage, a stage created years ago with embedded CREDENTIALS. Security wants those unloads to fail until the stage is moved onto a storage integration. Which setting provides this?

    Sources45

    4.Closing internal stages as a staging point

    Internal stages look harmless because the files stay in Snowflake. They are still a two-step exit, though: unload to a stage, then run GET to copy the files to a laptop. PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE blocks unloads to every internal stage type, including user stages, table stages and named internal stages.

    With the parameter left at FALSE, each stage type has its own default restriction:

    • a user can only unload to their own user stage
    • unloading to a table stage requires the active role to have OWNERSHIP on the table
    • unloading to a named internal stage requires the active role to have WRITE on the stage

    Those defaults still let every user unload to @~. That is why the parameter is the relevant control when the aim is to stop staging files for GET, rather than to tune grants on individual stages.

    Checkpoint 7 of 10· Match them up

    PREVENT_UNLOAD_TO_INTERNAL_STAGES is left at FALSE. Match each unload target with the default restriction that still applies to it.

    Tap a term, then the definition that fits it.

    Sources4

    5.Account defaults and per-user overrides

    The four unload parameters do not all live at the same level. The two PREVENT_ parameters are set on the account and can then be overridden for one user with ALTER USER. That makes an exception for one service user possible without opening the rest of the account. The two REQUIRE_ parameters can only be set on the account, because they constrain stages, which are shared objects, rather than the person running the statement.

    Unload-restriction parameters: what each closes and where it can be set
    ParameterWhat TRUE closesSettable at
    PREVENT_UNLOAD_TO_INLINE_URLCOPY INTO a cloud URL written in the statementAccount » User
    PREVENT_UNLOAD_TO_INTERNAL_STAGESCOPY INTO user, table and named internal stagesAccount » User
    REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_CREATIONCREATE STAGE for private external storage without a storage integrationAccount only
    REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATIONLoads and unloads through external stages that use explicit credentialsAccount only

    ACCOUNTADMIN sets the account-level values with ALTER ACCOUNT SET. The value set there becomes the default for every user. An override for one user goes through ALTER USER's object parameters, and that list contains only the two PREVENT_ parameters:

    The unload parameters that ALTER USER accepts as object parameterssql
    PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE | FALSE

    Checkpoint 8 of 10· Fill the gap

    Per-user exceptions to the unload restrictions go through ALTER USER's object parameters. Which parameter completes this list of the unload parameters that ALTER USER accepts?

    PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE  ?  = TRUE | FALSE

    Sources46

    6.Restricting query result downloads in Snowsight

    The unload parameters do nothing about the Download button on a results grid. Downloads in Snowsight are governed by data movement policies. A policy groups rules, and each rule has a movement TYPE and a MAX_ROWS expression. MAX_ROWS returns NULL for no limit, 0 to block, or a positive number as a row cap. The type for the button is UI_DOWNLOAD. It covers the Download button on the results pane for SQL and Python files in workspaces, result downloads from notebook cells in workspaces, and the results download in Query History.

    A UI_DOWNLOAD rule behaves differently from the other movement types in three ways. First, it is evaluated after the query has finished, not before, so the query itself runs and only the button is affected. Second, when the rule's threshold is met, the download button is disabled rather than the statement being rejected. Third, a UI_DOWNLOAD rule can only appear in a policy's ENFORCE_RULES, never in ALERT_RULES, so you cannot run it in alert-only mode first.

    The account sets the default and roles get the exceptions. Run ALTER ACCOUNT SET DATA MOVEMENT POLICY to attach a baseline policy that applies wherever no tag-based policy resolves. Only one account-level policy can be active at a time. Policies attached to tags take precedence over the account baseline for the columns they cover (see object tagging and classification). Per-role exceptions sit inside the rule itself, because MAX_ROWS can read the session through SYS_CONTEXT. The example below uses the external-stage type. Changing TYPE to 'UI_DOWNLOAD' gives the same pattern for downloads: one role unrestricted, every other role returns 0.

    A data movement rule that leaves one role unlimited and blocks all other rolessql
    CREATE OR REPLACE DATA MOVEMENT RULE hr_pii_copy_guard
      TYPE = 'COPY_INTO_EXTERNAL_STAGE'
      MAX_ROWS AS () RETURNS INTEGER
      -> (
        CASE
          WHEN SYS_CONTEXT('SNOWFLAKE$SESSION', 'ROLE') = 'COMP_TEAM_ROLE' THEN NULL
          ELSE 0
        END
      );

    Checkpoint 9 of 10· Check yourself

    Your account has a baseline data movement policy, attached with ALTER ACCOUNT SET DATA MOVEMENT POLICY. Its UI_DOWNLOAD rule returns 0, so nobody can download query results in Snowsight. The compliance team's COMP_TEAM_ROLE now needs unrestricted downloads, and every other role must stay blocked. What is the right way to grant that exception?

    Sources78

    7.Retrieval paths that bypass the download button

    Disabling a button does not stop anyone from fetching data in other ways. UI_DOWNLOAD does not cover every download surface. Downloads in Streamlit apps, notebooks in the Visual Studio Code extension, the Export as HTML option in workspaces, and CoWork are all outside it. The larger gap is clients that never open Snowsight at all.

    Data movement policies classify each statement under one primary movement type and need a separate rule for each. Results fetched by a driver or connector, SnowSQL, the Snowflake CLI, the SQL API or a stored procedure count as PROGRAMMATIC_FETCH. A stored procedure stays under that type even when it is called from a Snowsight session. A COPY to a stage followed by GET is a third route, governed by the COPY_INTO_* types and the unload parameters above.

    Ways a user can get query results out, and what restricts each one
    Retrieval pathRestricted by
    Download button in workspace results, notebook cells or Query HistoryUI_DOWNLOAD rule (button disabled)
    Driver, connector, SnowSQL, Snowflake CLI, SQL API, stored procedurePROGRAMMATIC_FETCH rule
    COPY INTO an external stage or inline URLCOPY_INTO_EXTERNAL_STAGE rule, PREVENT_UNLOAD_TO_INLINE_URL, REQUIRE_STORAGE_INTEGRATION_FOR_STAGE_OPERATION
    COPY INTO an internal stage, then GETCOPY_INTO_INTERNAL_STAGE rule, PREVENT_UNLOAD_TO_INTERNAL_STAGES

    Checkpoint 10 of 10· Check yourself

    An analyst whose role is covered by a policy with a UI_DOWNLOAD rule returning 0 opens SnowSQL on their laptop. They run SELECT * against the tagged PII table. The policy has no other rules, and no unload parameters are set. What happens?

    Sources7

    Sources

    (8)

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

    1. 1.
      “The files can then be downloaded from the stage/location using the GET command.”
      ↩︎ Where COPY INTO can write
      “Required only for unloading into an external private cloud storage location; not required for public buckets/containers”
      ↩︎ Where COPY INTO can write
      “Snowflake provides a set of parameters to further restrict data unloading operations”
      ↩︎ Where COPY INTO can write
      “Named external stage that references an external location (Amazon S3, Google Cloud Storage, or Microsoft Azure).”
      ↩︎ Key concept
    2. 2.
      “SELECT queries in COPY statements support the full syntax and semantics of Snowflake SQL queries, including JOIN clauses”
      ↩︎ Where COPY INTO can write
    3. 3.
      “ALTER ACCOUNT SET { [ accountProperties ] | [ accountParams ] | [ objectParams ] | [ sessionParams ] }”
      ↩︎ Where COPY INTO can write
    4. 4.
      “COPY INTO <location> statements that specify the cloud storage URL and access settings directly in the statement”
      ↩︎ Blocking ad hoc unloads to inline URLs
      “A named external stage must store the cloud storage URL and access settings in its definition.”
      ↩︎ Blocking ad hoc unloads to inline URLs
      “require a storage integration object as cloud credentials when creating a named external stage (using CREATE STAGE)”
      ↩︎ Requiring storage integrations: creation versus operation
      “specifying a named external stage that references explicit cloud provider credentials, such as secret keys or access tokens, produces a user error.”
      ↩︎ Requiring storage integrations: creation versus operation
      “Unloading data from Snowflake tables to any internal stage, including user stages, table stages, or named internal stages is prevented.”
      ↩︎ Closing internal stages as a staging point
      “The current user can only unload data to their own user stage.”
      ↩︎ Closing internal stages as a staging point
      “User — Can be set for Account » User”
      ↩︎ Account defaults and per-user overrides
      “Account — Can be set only for Account”
      ↩︎ Account defaults and per-user overrides
      “A named external stage must store the cloud storage URL and access settings in its definition.”
      ↩︎ Exam trap 1
      “specifying a named external stage that references explicit cloud provider credentials, such as secret keys or access tokens, produces a user error.”
      ↩︎ Exam trap 2
      “Account — Can be set only for Account”
      ↩︎ Exam trap 3
      “TRUE: COPY INTO <location> statements must reference either a named internal (Snowflake) or external stage or an internal user or table stage.”
      ↩︎ Checkpoint
      “You can only set account parameters at the account level”
      ↩︎ Checkpoint
      “Users can only unload data to named internal stages when their active role has the WRITE privilege on the stage.”
      ↩︎ Checkpoint
    5. 6.
      “PREVENT_UNLOAD_TO_INLINE_URL = TRUE | FALSE PREVENT_UNLOAD_TO_INTERNAL_STAGES = TRUE | FALSE”
      ↩︎ Account defaults and per-user overrides
    6. 7.
      “Button disabled: When a UI_DOWNLOAD enforce rule threshold is met, downloads are disallowed by disabling the download button in the Snowsight UI.”
      ↩︎ Restricting query result downloads in Snowsight
      “In contrast, UI_DOWNLOAD rules are processed independently after the query finishes.”
      ↩︎ Restricting query result downloads in Snowsight
      “Only one account-level policy can be active at a time.”
      ↩︎ Restricting query result downloads in Snowsight
      “This movement type does not apply to all download buttons.”
      ↩︎ Retrieval paths that bypass the download button
      “programmatic data access from a driver or connector, SnowSQL, Snowflake CLI, SQL API, or a stored procedure”
      ↩︎ Retrieval paths that bypass the download button
      “statements executing inside a stored procedure classify as PROGRAMMATIC_FETCH rather than SNOWSIGHT_UI, even when the calling session originates from Snowsight.”
      ↩︎ Retrieval paths that bypass the download button
      “The MAX_ROWS body can call SYS_CONTEXT to read session and movement context”
      ↩︎ Checkpoint
      “A data movement rule controls one movement type, such as COPY_INTO_EXTERNAL_STAGE.”
      ↩︎ Checkpoint
    7. 8.
      “A UI_DOWNLOAD rule can only be used in ENFORCE_RULES, not in ALERT_RULES.”
      ↩︎ Restricting query result downloads in Snowsight
      “A UI_DOWNLOAD rule can only be used in ENFORCE_RULES, not in ALERT_RULES.”
      ↩︎ Exam trap 4

    Ready to test yourself?

    Practise the 15 questions on this subdomain.

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