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

Consider Support for Masking Portions of a Field Value #86

Closed
bflad opened this issue Jul 21, 2022 · 1 comment · Fixed by #87
Closed

Consider Support for Masking Portions of a Field Value #86

bflad opened this issue Jul 21, 2022 · 1 comment · Fixed by #87
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bflad
Copy link
Member

bflad commented Jul 21, 2022

terraform-plugin-log version

v0.6.0

Use cases

Version 0.6.0 introduced some excellent filtering capabilities, but here's another potential use case we have. There is currently the tflog.MaskFieldValuesWithFieldKeys() function which allows you to specify field keys which the entire value will be redacted, however there is no way to mask only a selective portion of the field value.

Downstream in terraform-plugin-sdk, we are looking at whether a new HTTP request/response logging mechanism should put the body in the message or put the body in a field. Ideally it seems, it would be best placed in a field so developers can choose to redact the whole body if they wish (either for security or to save log size), but then there's no way to mask only certain portions of the body data.

Proposal

Create new functions, maybe something like MaskFieldValueRegexes(key, ...regexp.Regexp)/MaskFieldValueStrings(key, ...string) which works like the MaskMessage* equivalents. If specifying it per-key is too much, maybe having MaskAllFieldValue* variants could solve that by doing the same thing, but looping through all field keys.

References

@bflad bflad added the enhancement New feature or request label Jul 21, 2022
@detro detro self-assigned this Jul 21, 2022
@detro detro added this to the v0.7.0 milestone Jul 22, 2022
@detro detro closed this as completed in #87 Jul 24, 2022
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants