CREATE SECRET
command to store credentials securely. Admins can create secrets in advance, allowing other team members to reference them using secret identifiers when creating source/sink connections. This ensures that secrets remain protected throughout all phases of access.
RisingWave provides four key secret management operations:
- Creating secrets.
- Using secrets.
- Using secrets as a file.
- Dropping secrets.
PREMIUM FEATUREThis is a premium feature. For a comprehensive overview of all premium features and their usage, please see RisingWave premium features.
Create secrets
You can use the following statement to create secrets: Syntax for creating secretsCurrently only the meta backend is supported.
Use secrets
After creating secrets, you can useSECRET your_secret_name
as the option value in the WITH
clause. For example:
Use a secret in the WITH clause
Use secrets as a file
Some connectors need credentials stored as file paths (e.g.,ssl.ca.location
), where the file contains the secret. RisingWave allows you to reference a secret as a file path.
Reference a secret as a file path
Drop secrets
You can use the following statement to drop secrets: Syntax for dropping secretsExamples
Here is an example. We create a secret namedmysql_pwd
, and then use it in the WITH
clause. After that, we use the SHOW CREATE SOURCE
command to view the password.
Notes for open-source deployment
To use secret management, you need to set the environment variableRW_SECRET_STORE_PRIVATE_KEY_HEX
to a hex representation of a 128-bit key (e.g. 0123456789abcdef
). This key is used to encrypt secrets in RisingWave. You MUST NOT lose this key, as it is required to decrypt secrets.
To specify the temporary secret file directory, set RW_TEMP_SECRET_FILE_DIR
. This is only used with the as file
option.
See also
- CREATE SECRET: Creating a secret.
- DROP SECRET: Dropping a secret.