-
Notifications
You must be signed in to change notification settings - Fork 244
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
Sanitize Telemetry data #4758
Sanitize Telemetry data #4758
Conversation
e85f5e8
to
4a4963c
Compare
pkg/segment/segment.go
Outdated
|
||
// sanitizeURL sanitizes URLs from the error string | ||
func sanitizeURL(errString string) string { | ||
urlPattern, _ := regexp.Compile(`(http)\S*`) |
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.
Should we consider a regex that matches a URL that might not have prefix "http" as well?
https://stackoverflow.com/questions/42618872/regex-for-website-or-url-validation/42619368
test /psi-unit-test-windows
|
/test psi-kubernetes-integration-e2e
|
/test psi-kubernetes-integration-e2e |
/test psi-unit-test-windows |
/retest psi-kubernetes-integration-e2e - the make job apparently causing the below error has been disabled. Retesting should make the failure go away.
psi-unit-test-windows
|
pkg/segment/segment.go
Outdated
func sanitizeUserInfo(errString string) string { | ||
user1, err1 := user.Current() | ||
if err1 != nil { | ||
return errors.Wrapf(err1, err1.Error()).Error() |
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.
I would suggest if we cannot get the user, we just return the error as is?
this function is about santising the userInfo and if we cannot get the user in my opinion we shouldn't add that to the error because lets say there is an error getting the current user you would send an error like "X component not found: cannot resolve user".
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.
Right of course. It doesn't really make sense to wrap the error like that either, it isn't really doing anything!
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.
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.
Awesome
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: girishramnani The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/override psi-kubernetes-integration-e2e |
@valaparthvi: /override requires a failed status context to operate on.
Only the following contexts were expected:
In 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/test-infra repository. |
/override ci/prow/psi-kubernetes-integration-e2e |
@valaparthvi: Overrode contexts on behalf of valaparthvi: ci/prow/psi-kubernetes-integration-e2e In 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/test-infra repository. |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
What type of PR is this?
/kind bug
What does this PR do / why we need it:
This PR sanitizes some more data that might have some potential PII data.
Which issue(s) this PR fixes:
Fixes part of #4462
PR acceptance criteria:
Unit test
Integration test
Documentation
Update changelog
I have read the test guidelines
How to test changes / Special notes to the reviewer:
Running unit tests should be fine or perhaps test with data that potentially contains personal data.