Secrets
Read connection credentials from 1Password, AWS, Azure, GCP, Vault and other secret managers.
Keep credentials in your secret manager. Put a secret reference in place of the value. Sling reads the secret when a run uses it. The secret value does not go to disk, to the logs, or to the Sling Platform.
This is available in v1.6.5+.
connections:
MY_PG:
type: postgres
host: db.acme.com
user: etl
password: ref+vault://secret/data/postgres#/password # HashiCorp Vault
database: analytics
MY_MD:
type: motherduck
database: my_database
motherduck_token: ref+azurekeyvault://my-vault/motherduck-token # Azure Key Vault
MY_RDS:
type: postgres
from: ref+awssecrets://prod/rds # AWS Secrets Manager: all keys from one secretReference Forms
A reference has this form:
path
The secret. Specific to the provider.
prod/postgres
params
Options. Specific to the provider, plus the common params below.
?provider=aws_eu
pointer
A JSON pointer into a JSON or YAML secret. #key is short for #/key.
#/password
Where References Work
A string value of a connection, also nested values such as API secrets:
password: ref+op://Data/pg/password
When the connection opens
from: of a connection
from: ref+awssecrets://prod/postgres
When the connection opens
env: of env.yaml
API_TOKEN: ref+op://Data/acme/token
When a connection uses it
env: of a replication or a pipeline
API_TOKEN: ref+op://Data/acme/token
When Sling loads the file
The secret() function in hooks and pipeline steps
{secret("ref+op://Data/acme/token")}
When the step runs
Load a Connection with from:
from: loads a JSON or YAML object from one secret. Its keys become the keys of the connection.
Keys that you write in the connection win over keys from the secret.
Sling changes
usernametouser, anddbnametodatabase. Thus AWS RDS secrets work as they are.
Read Values that Sling Has
The sling provider reads a field of a connection that Sling knows, or an environment variable.
Configure Providers
Most providers need no configuration. They use the default credentials of the host, such as the AWS credential chain or az login.
To set credentials, or to use two accounts of one provider, add a secret_providers: block to env.yaml:
Config values accept
${VAR}. They do not accept secret references.Each config key has an environment variable as a fallback. See each provider below.
Providers
1Password
AWS Secrets Manager
AWS SSM Parameter Store
Azure Key Vault
GCP Secret Manager
HashiCorp Vault and OpenBao
Infisical
Doppler
Bitwarden Secrets Manager
Bitwarden Password Manager
Keeper
CyberArk Conjur
Delinea Secret Server
Akeyless
SOPS
Kubernetes
Local File
Command
HTTP JSON
When Sling Reads a Secret
Sling reads a secret only when a run, a test or a query uses the connection.
sling conns listdoes not read secrets.Each run is a new process. Thus a run gets the latest version of a rotated secret.
In one run, Sling keeps a value for 5 minutes. Two fields that read keys of one secret share one fetch.
A fetch stops after 30 seconds.
Security
Sling keeps resolved values in memory only.
Log output and error messages show
***in place of each value. Sling does not hide values shorter than 4 characters.On the Sling Platform, the platform stores only the reference text. The agent reads the secret, so the value stays on the agent host.
Test the References
sling conns test resolves the references of a connection, then connects:
If a reference fails, the error names the reference and the provider. It does not show the value:
Last updated
Was this helpful?