-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x-pack/filebeat/input/cel: make redact configuration recommended (#36008
) (#36046) Ideally this would be a hard requirement, but that would be a breaking change, so just log at WARN if the configuration is missing. (cherry picked from commit ae923ba) Co-authored-by: Dan Kortschak <[email protected]>
- Loading branch information
1 parent
ae84feb
commit 0dbf0eb
Showing
5 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -631,6 +631,37 @@ Whether to use the host's local time rather that UTC for timestamping rotated lo | |
|
||
This determines whether rotated logs should be gzip compressed. | ||
|
||
[float] | ||
==== `redact` | ||
|
||
During debug level logging, the `state` object and the resulting evaluation result are included in logs. This may result in leaking of secrets. In order to prevent this, fields may be redacted or deleted from the logged `state`. The `redact` configuration allows users to configure this field redaction behaviour. For safety reasons if the `redact` configuration is missing a warning is logged. | ||
|
||
In the case of no-required redaction an empty `redact.fields` configuration should be used to silence the logged warning. | ||
|
||
["source","yaml",subs="attributes"] | ||
---- | ||
- type: cel | ||
redact: | ||
fields: ~ | ||
---- | ||
|
||
As an example, if a user-constructed Basic Authentication request is used in a CEL program the password can be redacted like so | ||
|
||
["source","yaml",subs="attributes"] | ||
---- | ||
filebeat.inputs: | ||
- type: cel | ||
resource.url: http://localhost:9200/_search | ||
state: | ||
user: [email protected] | ||
password: P@$$W0₹D | ||
redact: | ||
fields: password | ||
delete: true | ||
---- | ||
|
||
Note that fields under the `auth` configuration hierarchy are not exposed to the `state` and so do not need to be redacted. For this reason it is preferable to use these for authentication over the request construction shown above where possible. | ||
|
||
[float] | ||
==== `redact.fields` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters