View a markdown version of this page

Security considerations and limitations - Amazon Redshift

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

Security considerations and limitations

Trust model

SQL that runs in the DuckDB process uses the process's own credentials. Through them it can attach Redshift targets with any credentials the process can reach (its secrets, the default credential chain, and the profiles in the AWS config and credentials files), run statements on any attached handle, and read the logs. The extension adds no authority of its own. A handle can do only what its Redshift database user is allowed to do, and Redshift enforces access to the data. This topic doesn't cover those data permissions. For more information about IAM authentication and the permissions each target needs, see Authentication and IAM permissions.

Two limits are worth knowing. A handle can't be made read-only, so limit it through the database user's grants in Redshift rather than at the handle. The enable_external_access setting controls new access, not access that is already open. Setting it to false stops new attaches, but any handle attached before then keeps working.

If the SQL comes from other users or from untrusted input, follow these precautions.

  • Use a dedicated, least-privilege IAM identity. Give the identity it signs in with its own database user, with only the grants the workload needs. For read-only work, grant only SELECT.

  • Isolate untrusted SQL in its own process. Run it in a DuckDB process of its own, which holds or can reach only the credentials and handles that user may use.

  • Bind values, never concatenate. Pass values to redshift_query with params, and check any identifier or SQL fragment you insert against a fixed list.

TLS

Every connection uses TLS, and the extension always verifies the server certificate. No option turns this off. The extension reads trusted CA certificates from SSL_CERT_FILE or the system CA bundle. If it can't find a usable bundle, set SSL_CERT_FILE to a readable CA bundle.

Credentials

Keep credentials out of SQL statements. An access key in UNLOAD or COPY, or a password in CREATE USER ... PASSWORD, is sent to Redshift as text in the statement and can end up in logs. Use IAM_ROLE in those statements instead. On Amazon Redshift Serverless with express configuration, use IAM_ROLE 'SESSION', which uses your own IAM identity. Those credentials aren't refreshed during a session, so if a long-lived handle loses access to Amazon S3, DETACH it and ATTACH it again.

Error messages can still show the target's endpoint host, AWS Region, and account, and a syntax error can quote a key, so check an error before you share it.

Secrets can also reach disk. A temporary secret, which is the default, stays in memory, but a PERSISTENT secret is written to disk by DuckDB. Prefer temporary secrets that use the credential chain, which keeps access keys out of your SQL, and protect the directory where DuckDB stores persistent secrets.

While connected with CONNECT, every statement goes to Redshift as text, so disconnect before you type a credential.

Files on disk

At the first connection, the extension writes its driver files to its own directory. To use a different directory, set REDSHIFT_DRIVER_DIR. When it's set, the extension uses only that directory, and writes the driver files there itself. It must be an existing absolute path, with no symbolic link or .., that no other account can write, nor any directory above it. On a host with application control, an administrator can instead provide the directory read-only, already holding the .redshift-driver folder that this release writes. The extension then loads those files without writing.

Install the extension where only you or root can write. A shared or group-writable extension directory lets another user change what DuckDB loads. With a home directory on a network file system, put DuckDB's extension directory on a local disk, or install the extension owned by root and set REDSHIFT_DRIVER_DIR to a local folder.

On Linux, LD_LIBRARY_PATH must not name a directory, or one with subdirectories, that another user can write.

Environment variables

The extension refuses to connect when any of certain environment variables is set, because they could change the driver's connection or security settings. These are certain PostgreSQL, TLS, Kerberos, AWS endpoint override, and ODBC configuration variables, such as PGSSLROOTCERT, AWS_ENDPOINT_URL, and ODBCINI. LD_LIBRARY_PATH is refused only when it has an empty or relative entry. When this happens, the connection fails with an error that names the variable. Unset it and start DuckDB again.

Limitations

The extension has the following limitations:

Area Limitation

Catalog

No catalog browsing. A reference such as SELECT ... FROM handle.schema.table, and writes through the catalog, are refused. Use redshift_query.

Statements

One Redshift statement for each call, and one result set for each statement.

Handles

One call for each handle for each DuckDB statement. No read-only handles.

Transactions

No redshift_query inside an explicit DuckDB transaction.

Parameters

No NULL parameters, and no ? in the SQL text. Use $1, $2, and chr(63) for a literal question mark.

Cancellation

No cancellation from DuckDB and no statement timeout.

Stopping early

After a satisfied LIMIT or Ctrl-C, a query can take as long to end as Redshift takes to send the rest of the result. An unresponsive server is detected within about 90 seconds, or about 2 minutes on Windows.

Linux allocators

A process that replaces malloc, such as jemalloc or tcmalloc through LD_PRELOAD, fails to connect with an error that names the allocator. Start the program without it.

Authentication

IAM only. No database passwords and no database user names. IAM Identity Center (SSO) works through a secret created after aws sso login; the driver's own SSO sign-in plugins aren't supported. A credential_process profile is supported.

Endpoints

No HOST or PORT options, custom domain names, VPC endpoint DNS names, IP addresses, proxies, or tunnels. The endpoint must be reachable from the client's network. A workgroup whose traffic the network drops, such as a private one, fails only after the resume wait.

AWS Regions

The aws partition only, from a fixed list. The China, AWS GovCloud (US), isolated, and European Sovereign Cloud partitions aren't supported.

Clusters

A paused cluster is not resumed on connect.

Types

Qualified INTERVAL, GEOMETRY, GEOGRAPHY, and HLLSKETCH are refused. SUPER arrives as VARCHAR.

Platforms

Builds for linux_amd64, linux_arm64, osx_arm64, osx_amd64, and windows_amd64. No musl-based Linux, windows_amd64_mingw, windows_arm64, or DuckDB-WASM.