Questo contenuto non è disponibile nella lingua selezionata.
Chapter 2. Masking sensitive data in workflow logs
serverless logic includes a built-in log filter that masks sensitive data in workflow runtime logs. When request and response logging is enabled, HTTP headers such as Authorization: Bearer <token> can appear in plain text. You can enable and configure the sensitive data filter to prevent credentials and tokens from being written to log output.
2.1. Configuring sensitive data masking in workflow logs Copia collegamentoCollegamento copiato negli appunti!
You can configure serverless logic to automatically mask sensitive data in workflow runtime logs. The built-in sensitive data filter uses regular expressions to replace matching strings with a configurable mask before they appear in log output.
Prerequisites
- You have a workflow application project.
-
You have access to the
application.propertiesfile for your workflow.
Procedure
Enable the sensitive data filter for each log handler in
application.properties:quarkus.log.console.filter=sensitive-data-filterTo apply the filter to a file log handler, set
quarkus.log.file.filter=sensitive-data-filterinstead, or set it in addition to the existing handler filter.NoteWhen enabled without custom patterns, the filter masks the following data by default:
-
AuthorizationandX-Authorizationheader values, including Bearer tokens -
JSON Web Tokens (JWTs) in the format
eyJ… -
GitHub tokens with
gho_orghs_prefixes
-
Optional: To mask additional data patterns, specify one or more regular expressions in
application.properties:org.sonataflow.logger.sensitive-data-filter.patterns=<pattern>where:
<pattern>Specifies a comma-separated list of regular expressions. Alternatively, use Quarkus indexed property syntax to define patterns individually:
org.sonataflow.logger.sensitive-data-filter.patterns[0]=<pattern_1> org.sonataflow.logger.sensitive-data-filter.patterns[1]=<pattern_2>ImportantWhen you set custom patterns, the filter no longer applies the default token-masking patterns. If you still need to mask authorization headers and JWTs, include those patterns explicitly alongside your custom ones.
Optional: To customize the mask string, set the following property:
org.sonataflow.logger.sensitive-data-filter.mask=<mask>where:
<mask>-
Specifies the replacement string written to the log in place of any matched value. If not set, the filter uses
MASKEDas the default mask.
Verification
Run oc logs <workflow_pod_name> and inspect the output after a workflow execution. Strings matching the active patterns appear as the configured mask string instead of the original value.