Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging: add replace filter for static value replacement #4029

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

kujenga
Copy link
Contributor

@kujenga kujenga commented Feb 18, 2021

This filter is intended to be useful in scenarios where you may want to
redact a value with a static string, giving you information that the
field did previously exist and was present, but not revealing the value
itself in the logs.

This was inspired by work on adding more complete support for removing
sensitive values from logs [1]. An example use case would be the
Authorization header in request log output, for which the value should
usually not be logged, but it may be quite useful for debugging to
confirm that the header was present in the request.

This PR was split out from #4028

[1] #3958

This filter is intended to be useful in scenarios where you may want to
redact a value with a static string, giving you information that the
field did previously exist and was present, but not revealing the value
itself in the logs.

This was inspired by work on adding more complete support for removing
sensitive values from logs [1]. An example use case would be the
Authorization header in request log output, for which the value should
usually not be logged, but it may be quite useful for debugging to
confirm that the header was present in the request.

[1] caddyserver#3958
@francislavoie francislavoie added the under review 🧐 Review is pending before merging label Feb 18, 2021
@francislavoie francislavoie added this to the 2.x milestone Feb 18, 2021
@kujenga
Copy link
Contributor Author

kujenga commented Mar 12, 2021

@francislavoie @mholt let me know if there are any thoughts on this PR I can address, I had originally paired it with #4028

Copy link
Member

@francislavoie francislavoie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this! Definitely a valid usecase, thanks for the explanation.

@francislavoie francislavoie modified the milestones: 2.x, v2.4.0 Mar 12, 2021
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks again very much!

@mholt mholt merged commit f137b82 into caddyserver:master Mar 12, 2021
kujenga added a commit to kujenga/caddy-website that referenced this pull request Mar 19, 2021
This commit corresponds with the functionality added in this PR:
caddyserver/caddy#4029
mholt pushed a commit to caddyserver/website that referenced this pull request Apr 8, 2021
* caddyfile/directives/log: add docs for new replace directive

This commit corresponds with the functionality added in this PR:
caddyserver/caddy#4029

* caddyfile: add documentation for new global log option

This corresponds with the changes in this PR:
caddyserver/caddy#4028
@mholt mholt removed the under review 🧐 Review is pending before merging label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants