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

Proposal: Fine-grained field masking #113

Open
gdavison opened this issue Dec 6, 2022 · 0 comments
Open

Proposal: Fine-grained field masking #113

gdavison opened this issue Dec 6, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@gdavison
Copy link

gdavison commented Dec 6, 2022

terraform-plugin-log version

v0.7.0

Use cases

I'm looking to mask only parts of a field, rather than the whole field, in log output. For example, when logging AWS API requests, the Authorization field looks like the folllowing:

Authorization: AWS4-HMAC-SHA256 Credential=AKIA5PX2H2S3BEXAMPLE/20221205/us-west-2/sso/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-target, Signature=17736c976abda4c0cc3e91c0dd1a8b9aa7c2f34e21fde9dd5f32c35bbaadc0de

In this example, I would like to mask the Access Key portion of Credential, except for the last four characters, as well as the Signature. Something like

Authorization: AWS4-HMAC-SHA256 Credential=****************MPLE/20221205/us-west-2/sso/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-target, Signature=*******

Proposal

I propose adding a hook either for all fields or a specific field that could parse the field content and mask as appropriate. In the example above, it would involve parsing the AWS Signature v4 header for specific values and masking those.

@gdavison gdavison added the enhancement New feature or request label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant