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

OCPBUGS-24428: Redact passwords logged in installConfigOverrides #5868

Merged
merged 1 commit into from Jan 20, 2024

Conversation

bfournie
Copy link
Contributor

@bfournie bfournie commented Jan 7, 2024

Ensure that any passwords included in installConfigOverrides are redacted in logs.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 7, 2024
@openshift-ci-robot
Copy link

@bfournie: This pull request references Jira Issue OCPBUGS-24428, which is invalid:

  • expected the bug to target the "4.16.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Ensure that any passwords included in installConfigOverrides are redacted in logs.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-ci openshift-ci bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 7, 2024
Copy link

openshift-ci bot commented Jan 7, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2024
@bfournie
Copy link
Contributor Author

bfournie commented Jan 7, 2024

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jan 7, 2024
@openshift-ci-robot
Copy link

@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
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @mhanss

In response to this:

/jira refresh

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jan 7, 2024
@openshift-ci openshift-ci bot requested a review from mhanss January 7, 2024 21:15
@bfournie
Copy link
Contributor Author

bfournie commented Jan 7, 2024

/cc @rwsu

@openshift-ci openshift-ci bot requested a review from rwsu January 7, 2024 21:16
@bfournie
Copy link
Contributor Author

bfournie commented Jan 7, 2024

/uncc @lranjbar

@openshift-ci openshift-ci bot removed the request for review from lranjbar January 7, 2024 21:17
Copy link

codecov bot commented Jan 7, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (513ec44) 68.03% compared to head (ff0fddf) 68.12%.
Report is 14 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            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     
Files Coverage Δ
cmd/agentbasedinstaller/register.go 11.35% <0.00%> (-0.13%) ⬇️

... and 13 files with indirect coverage changes

@@ -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*"[^\,]*"`)
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed regex.

Copy link
Member

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.
@zaneb
Copy link
Member

zaneb commented Jan 17, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 17, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD a75c684 and 2 for PR HEAD ff0fddf in total

@bfournie
Copy link
Contributor Author

/retest

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD b66149d and 1 for PR HEAD ff0fddf in total

Copy link

openshift-ci bot commented Jan 20, 2024

@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.

@openshift-merge-bot openshift-merge-bot bot merged commit 3a67a57 into openshift:master Jan 20, 2024
14 checks passed
@openshift-ci-robot
Copy link

@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:

Ensure that any passwords included in installConfigOverrides are redacted in logs.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-bot
Copy link
Contributor

[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.
All builds following this will include this PR.

@openshift-merge-robot
Copy link

Fix included in accepted release 4.16.0-0.nightly-2024-01-21-092529

@bfournie bfournie deleted the agent-redact-pwds branch January 22, 2024 14:55
@bfournie
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@bfournie: new pull request created: #5905

In response to this:

/cherry-pick release-4.15

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants