Credential Functions
Credential functions provide access to sensitive information, such as user names and passwords, that is secured in a credential store. Use credential functions in pipeline and stage properties to enable Transformer to access external systems without exposing the those values.
Before you use a credential function, you must configure Transformer to use one of the supported credential stores.
You can use credential functions in any property that displays a key icon next to the property name, as follows:
You cannot use credential functions in all stages. For example, StreamSets intentionally does not allow the use of credential functions in the Spark SQL
Expression processor. If credential functions were allowed in stages such as the Spark
SQL Expression processor, any user with access to the pipeline could access or print
sensitive values, compromising the security of the external system.
Important: When you use a credential function in a stage
or pipeline property, the function must be the only value defined in the property.
For example, you cannot include another function or a literal value along with the
credential function.
You can replace any argument with a literal or an expression that
evaluates to the argument. String literals must be enclosed in single or double
quotation marks.The StreamSets expression language provides the following credential functions:
- credential:get(<cstoreId>, <userGroup>, <name>)
- Returns the secret from the credential store. Uses the following
arguments:
- cstoreId - Unique ID of the credential store to use. Use the ID specified in the $TRANSFORMER_CONF/credential-stores.properties fileTransformer credential store configuration properties. For more information, see Enabling Credential Stores.
- userGroup - Group that a user must belong to in order to
access the secret. Only users that have execute permission on the pipeline and that
belong to this group can validate, preview, or run the pipeline that retrieves the
secret. If working with Control Hub, sSpecify the group using the required naming convention:
<group ID>@<organization ID>
. To grant access to all users, specify the defaultall
group when working only with Transformer. When working with Control Hub and Transformer version 3.14.0 or later, you can specify the default group usingall
orall@<organization ID>
. StreamSets recommends usingall
so that you do not need to modify credential functions when migrating pipelines from Transformer to Control Hub.Note: When working with Control Hub and a Transformer version earlier than 3.14.0, you must use the defaultall@<organization ID>
group. - name - Name of the secret to retrieve from the credential store. Use
the required format for the credential store:
- AWS Secrets Manager - Enter the name of the secret to
retrieve from Secrets Manager. Use the following format:
"<name><separator><key>"
, where:<name>
is the name of the secret in Secrets Manager to read.<separator>
is the separator defined in the $TRANSFORMER_CONF/credential-stores.properties fileTransformer credential store configuration properties.<key>
is the key for the value that you want returned.
- Azure Key Vault - Enter the name of the key or secret to retrieve from Azure Key Vault.
- Java keystore - Enter the name of the secret added to the
Java keystore file using the
jks-cs add
command.
- AWS Secrets Manager - Enter the name of the secret to
retrieve from Secrets Manager. Use the following format:
- credential:getWithOptions(<cstoreId>, <userGroup>, <name>, <storeOptions>)
- Returns the secret from the credential store using additional options to communicate with the credential store. Not applicable for the Java keystore credential store.