Categories:

Notification functions (Message Sanitization)

SANITIZE_WEBHOOK_CONTENT

Removes placeholders (for example, the SNOWFLAKE_WEBHOOK_SECRET placeholder, which specifies a secret) from the body of a notification message to be sent.

Placeholders like SNOWFLAKE_WEBHOOK_SECRET are used in notification integrations. When you create a notification integration, you can use placeholders to indicate where you want the content inserted into the request. For example, you can use the SNOWFLAKE_WEBHOOK_SECRET placeholder to insert the secret into the HTTP headers or body of the request.

The SYSTEM$SEND_SNOWFLAKE_NOTIFICATION stored procedure replaces these placeholders in the integration parameters with actual values. The stored procedure also replaces the placeholders if specified directly in the message string passed to the function. If the placeholder is for a secret, this might unintentionally make the secret available to others. For example, if this message is sent to a Slack webhook, the message containing the secret might be posted to a Slack channel.

To avoid this situation, pass the message to SANITIZE_WEBHOOK_CONTENT to remove any placeholders from the message before passing the message to SYSTEM$SEND_SNOWFLAKE_NOTIFICATION.

See also:

Sending webhook notifications

Syntax

SNOWFLAKE.NOTIFICATION.SANITIZE_WEBHOOK_CONTENT( <message> )
Copy

Arguments

message

A VARCHAR value containing the message to sanitize.

Returns

Returns a VARCHAR value with placeholders replaced with the string REDACTED.

Examples

See Sending a notification to a webhook.