-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: redact all query parameters in CRI error logs #12491
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
Conversation
0fa590e to
445b33e
Compare
445b33e to
4e17f79
Compare
| log.G(ctx).WithError(err).Errorf("PullImage %q failed", r.GetImage().GetImage()) | ||
| // Sanitize error to remove sensitive information | ||
| sanitizedErr := ctrdutil.SanitizeError(err) | ||
| log.G(ctx).WithError(sanitizedErr).Errorf("PullImage %q failed", r.GetImage().GetImage()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It loos like this is fixing the logs but not the returned error.
Also needs to fix spans.
I think it should set err = ctrdutil.SanitizeError(err) instead of creating a new var.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
internal/cri/util/sanitize.go
Outdated
|
|
||
| // sensitiveParams defines query parameters that should be redacted. | ||
| var sensitiveParams = map[string]bool{ | ||
| "sig": true, // Azure SAS signature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need more things for sure.
Maybe we can just redact all query params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
cpuguy83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mikebrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
AkihiroSuda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good, but please squash the commits
Signed-off-by: Andrey Noskov <andreyn@microsoft.com>
4d4cb55 to
3e2cee2
Compare
|
/cherry-pick release/2.2 |
|
@AkihiroSuda: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@AkihiroSuda: new pull request created: #12546 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@AkihiroSuda: new pull request created: #12547 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@AkihiroSuda: #12491 failed to apply on top of branch "release/1.7": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Trying to fix #5453