Credentials

Last updated

Introduction

It is a common requirement to need to include sensitive information such as API tokens and passwords in actions. As other users can see action configurations, Tines Stories provides the CREDENTIAL formula key which allows users to reference this sensitive information without exposing the value in Tines. When an action containing this CREDENTIAL formula key runs, Tines will substitute in the corresponding credential value. This means that sensitive data does not need to be stored as plaintext in Action configuration options or in a resource.

Creating a Credential

Navigate to the credentials page by selecting your team name in the menu on the upper left side and selecting "Credentials". From the credentials page, select "New". You will then be prompted to choose the credential type.

Tines Stories supports the following types of credentials:

and additionally has product-specific connect flows that will guide you through the credential creation process per product.

Security Considerations when using credentials

While this method dramatically increases the security of secret information in Tines Stories, like any piece of security, it’s not absolute. For example, suppose Tines Stories is interacting with a 3rd-party service. In that case, the service may insecurely include the credential’s value in its response, which Tines will then include in an emitted event. However, Tines Stories does build in flexible options for you to reduce visibility of sensitive data, such as customizing an action's event output to modify the event data the action would produce and remove sensitive data for example.

Credential values in action options

A credential's value is only protected while it stays in the credential. If the value itself is saved in an action's options, it's stored in plain text: anyone who can view the story can read it, and it's copied into story versions and exports.

When plaintext credential blocking is on for your tenant, Tines Stories prevents this in three ways. Self-hosted deployments don't have it yet.

Saving a credential's value into an action

Saving an action fails if the save adds the value of a credential that the action's team can access:

  • In the story builder, the field goes back to its previous value, and an error notification shows the message below.

  • Through the API, the request fails with a 422 status and the same message. See Create an action and Update an action.

This action's options contain the value of the my_token credential, which would be saved as plain text. Reference it with <<CREDENTIAL.my_token>> instead. If another action sets these options through the API, have it send \<<CREDENTIAL.my_token>> as text, or "<<CREDENTIAL.my_token>>" in a formula, so the reference isn't resolved before it's sent.

To fix it, reference the credential, for example <<CREDENTIAL.my_token>>.

An action that already holds a credential's value keeps running, and you can still edit and save it. The value stays in plain text until you replace it with a reference. Copies remain in story versions and exports, so if it's a real secret, rotate it.

Sending a credential's value to the actions API

An HTTP Request action fails before it sends its request if both of these are true:

  • The request goes to your own tenant's API to create or update an action, or to import a story.

  • Its URL, query parameters, or payload contain a credential's value.

The action emits no event, and this error appears in its logs:

Can't send a credential's value to the actions API, because the target action would store it in plain text. Send the reference instead, so the target action resolves it when it runs: \<<CREDENTIAL.my_token>> as text, or "<<CREDENTIAL.my_token>>" in a formula.

To fix it, send the reference without resolving it. See From credentials. Headers aren't checked, so a Tines API key in the Authorization header still works.

Reading a credential's value back from your tenant

When an HTTP Request action calls your own tenant, any credential value that the action used is replaced with asterisks in the response. There's no error, so the story keeps running with asterisks where the value was.

To fix it, reference the credential directly in the action that needs the value, instead of reading it back from the API. If the value is stored somewhere the API returns it, such as an action, a resource, or an event, remove it from there too.

One value is kept. When the action calls one of your tenant's webhooks with that webhook's secret, the secret stays in the polling URL that the webhook returns, so polling keeps working. This only applies when the credential holds the secret alone, not the whole webhook URL.

Values that aren't checked

Values shorter than 12 characters aren't checked. Neither are values that are only a hostname, a bare HTTP(S) origin such as https://example.com, or an email address.

If a value isn't a secret, for example an ID or a URL, store it in a resource instead of a credential, and reference it with <<RESOURCE.my_resource>>.

Was this helpful?