Area: Ingestion
Sub-Area: Security
Applies to: OSS + Cloud
Issue
Credentials in an ingestion recipe should not sit there as plain text. You need to know which secret mechanisms DataHub supports and how a recipe refers to them.
You Might Be Asking
- How do I store ingestion credentials securely?
- Can I use environment variables in recipes?
- Can I use AWS Secrets Manager, GCP Secret Manager or HashiCorp Vault?
Cause
Recipes refer to secrets with ${NAME}. This syntax works for UI-managed runs and for executor runs. A name must start with a letter or underscore and contain only letters, digits and underscores. DataHub looks the name up in its secret backends. Syntax such as ${AWS_SM:...} or ${VAULT:...} does not exist.
A hyphen in a name is read as a default-value operator, so ${DB-PASSWORD} means variable DB with default PASSWORD. Bash-style operators such as ${VAR:-default} are supported. An unset ${NAME} with no default fails as an unbound variable.
Solution
Supported secret backends
| Backend | Where the value lives |
|---|---|
| DataHub | Secrets you create in the UI |
| File | Files in /mnt/secrets/, where the file name is the secret name |
| Environment | Environment variables |
DataHub checks all three. A DataHub secret wins over a File secret, and a File secret wins over an Environment variable.
On DataHub Cloud, the File and Environment backends only apply when you run ingestion on a Remote Executor. For ingestion that runs on the DataHub-hosted executor, use UI secrets.
1. Use UI secrets (OSS and Cloud)
- In the left nav, open Data Sources, then the Secrets tab.
- Create a secret. You need the Manage Secrets privilege. Admins have it by default.
- Reference it in the recipe as
${SECRET_NAME}.
DataHub stores UI secrets encrypted. It decrypts them server-side and sends them over TLS to the worker that runs the job. That worker is datahub-actions in self-hosted DataHub and the executor on DataHub Cloud.
Example for Snowflake. Adapt the pattern to any source.
source:
type: snowflake
config:
account_id: "xy12345.us-east-2.aws"
warehouse: "COMPUTE_WH"
username: "${SNOWFLAKE_USER}"
authentication_type: KEY_PAIR_AUTHENTICATOR
private_key: "${SNOWFLAKE_PRIVATE_KEY}"
Use account_id for the Snowflake account identifier. The older host_port key is renamed to account_id. Do not add a database key. The Snowflake connection config does not define one, and source configs reject unknown keys.
Setting private_key or private_key_path requires authentication_type: KEY_PAIR_AUTHENTICATOR. Snowflake is retiring password authentication on an account-specific date during Phase 3 of its rollout (August to October 2026), so use key-pair auth. See Migrate to key-pair auth.
2. Use environment variables or files
Reference the value as ${NAME}.
-
CLI runs: the CLI resolves
${NAME}from the process environment when it loads the recipe. -
Self-hosted UI ingestion: the datahub-actions executor resolves secrets from the environment variables of the actions container and from UI secrets. A Kubernetes Secret exposed as an environment variable on that container works. Files under
/mnt/secrets/are not read by self-hosted datahub-actions as shipped. - DataHub Cloud: environment variables and files work only on a Remote Executor, which you manage yourself.
In Kubernetes, store the values in Kubernetes Secrets, not ConfigMaps. See Secret resolution.
3. Use AWS or GCP Secret Manager (Remote Executor only)
The Remote Executor resolves ${NAME} from AWS Secrets Manager or GCP Secret Manager at run time. It looks up <prefix><NAME>. The default prefix is datahub-, so ${SNOWFLAKE_PASSWORD} reads the secret datahub-SNOWFLAKE_PASSWORD.
- To change the prefix, set
DATAHUB_EXECUTOR_AWS_SM_PREFIXorDATAHUB_EXECUTOR_GCP_SM_PREFIXon the executor. The prefix must match^[A-Za-z0-9_-]*$or the executor fails at startup. - The executor caches resolved values in memory for 6 hours by default. Change this with
DATAHUB_EXECUTOR_SECRET_CACHE_TTL. - Names with hyphens, dots or slashes, such as
${snowflake/datahub/username}or${snowflake-password}, are never extracted. The literal text is passed through. Use names likeSNOWFLAKE_USERNAME. - Do not add keys such as
aws_regionto a source config. Source configs reject unknown keys.
See Using cloud secret managers.
4. HashiCorp Vault
DataHub has no built-in Vault integration. There is no ${VAULT:...} syntax. The top-level recipe is validated against a fixed set of keys, so a vault: block fails validation as an extra input.
Deliver Vault values with your own tooling, as environment variables or files, then reference them as ${NAME}. Remember the limits above: on DataHub Cloud, environment variables and files need a Remote Executor, and self-hosted datahub-actions reads environment variables only.
Best practices
- Never commit secrets to version control.
- Use service accounts, not personal credentials.
- Give each ingestion source its own credentials with least privilege.
- Rotate secrets regularly.
Related Documentation
- Secret resolution
- UI ingestion: managing sensitive information with secrets
- Recipe overview: secrets and environment variables
- Remote Executor: cloud secret managers
- Snowflake key-pair auth
Tags: secrets, security, credentials, environment-variables, kubernetes-secrets, aws-secrets-manager