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
OCPBUGS-24428: Redact passwords logged in installConfigOverrides #5868
OCPBUGS-24428: Redact passwords logged in installConfigOverrides #5868
Conversation
@bfournie: This pull request references Jira Issue OCPBUGS-24428, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bfournie 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 |
/jira refresh |
@bfournie: This pull request references Jira Issue OCPBUGS-24428, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: 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 openshift-eng/jira-lifecycle-plugin repository. |
/cc @rwsu |
/uncc @lranjbar |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5868 +/- ##
==========================================
+ Coverage 68.03% 68.12% +0.09%
==========================================
Files 235 235
Lines 34574 34653 +79
==========================================
+ Hits 23523 23609 +86
+ Misses 8986 8983 -3
+ Partials 2065 2061 -4
|
14a5df4
to
e9f9e71
Compare
cmd/agentbasedinstaller/register.go
Outdated
@@ -103,6 +104,7 @@ func RegisterCluster(ctx context.Context, log *log.Logger, bmInventory *client.A | |||
|
|||
annotations := aci.GetAnnotations() | |||
if installConfigOverrides, ok := annotations[controllers.InstallConfigOverrides]; ok { | |||
var reJsonField = regexp.MustCompile(`(?i)"([^"]*(password)[^"]*)":\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.
I think the part that matches the password itself, [^\,]*
might instead need to be something like (\\{2}|\\"|[^"])*
Alternatively, it might be easier to parse the JSON and then redact the fields, then reserialise, than to use a regex.
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.
Changed regex.
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 assume you tested this, because I definitely did not 🙂
Ensure that any passwords included in installConfigOverrides are redacted in logs.
e9f9e71
to
ff0fddf
Compare
/lgtm |
/retest |
@bfournie: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
@bfournie: Jira Issue OCPBUGS-24428: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-24428 has been moved to the MODIFIED state. 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 openshift-eng/jira-lifecycle-plugin repository. |
[ART PR BUILD NOTIFIER] This PR has been included in build ose-agent-installer-api-server-container-v4.16.0-202401200231.p0.g3a67a57.assembly.stream for distgit ose-agent-installer-api-server. |
Fix included in accepted release 4.16.0-0.nightly-2024-01-21-092529 |
/cherry-pick release-4.15 |
@bfournie: new pull request created: #5905 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. |
Ensure that any passwords included in installConfigOverrides are redacted in logs.
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Checklist
docs
, README, etc)Reviewers Checklist