Skip to content

Conversation

@r4f4
Copy link
Contributor

@r4f4 r4f4 commented Feb 24, 2023

If you tried to authenticate with a certificate and provided the wrong password, the installer error message didn't actually say what the error was. It just said

$ ./openshift-install create install-config --dir ipi-test
INFO Could not get an azure authorizer from file: auth file missing client and certificate credentials
INFO Asking user to provide authentication info
? azure subscription id [? for help]

That happens because the autorest lib would just ignore the auth errors in favor of a generic message [1]. Since the autorest/auth module is going out of support by March 31, 2023, let's get rid of it and load the auth file ourselves.

Now when doing cert authentication with the wrong password we get:

INFO Credentials loaded from file "/root/.azure/osServicePrincipal.json"
WARNING Using client certs to authenticate. Please be warned cluster does not support certs and only the installer does.
ERROR failed to fetch Kubeconfig Admin Client: failed to load asset "Install Config": failed to create install config: creating Azure session: failed to parse client certificate: pkcs12: decryption password incorrect

[1] https://github.com/Azure/go-autorest/blob/main/autorest/azure/auth/auth.go#L264-L270

@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. 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 Feb 24, 2023
@openshift-ci-robot
Copy link
Contributor

@r4f4: This pull request references Jira Issue OCPBUGS-7860, which is invalid:

  • expected the bug to target the "4.13.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.

Details

In response to this:

If you tried to authenticate with a certificate and provided the wrong password, the installer error message didn't actually say what the error was. It just said

$ ./openshift-install create install-config --dir ipi-test
INFO Could not get an azure authorizer from file: auth file missing client and certificate credentials
INFO Asking user to provide authentication info
? azure subscription id [? for help]

That happens because the autorest lib would just ignore the auth errors in favor of a generic message [1]. Since the autorest/auth module is going out of support by March 31, 2023, let's get rid of it and load the auth file ourselves.

Now when doing cert authentication with the wrong password we get:

INFO Credentials loaded from file "/root/.azure/osServicePrincipal.json"
WARNING Using client certs to authenticate. Please be warned cluster does not support certs and only the installer does.
ERROR failed to fetch Kubeconfig Admin Client: failed to load asset "Install Config": failed to create install config: creating Azure session: failed to parse client certificate: pkcs12: decryption password incorrect

[1] https://github.com/Azure/go-autorest/blob/main/autorest/azure/auth/auth.go#L264-L270

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.

@openshift-ci openshift-ci bot requested review from jhixson74 and mtulio February 24, 2023 10:42
@r4f4
Copy link
Contributor Author

r4f4 commented Feb 24, 2023

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 24, 2023
@openshift-ci-robot
Copy link
Contributor

@r4f4: This pull request references Jira Issue OCPBUGS-7860, 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.13.0) matches configured target version for branch (4.13.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jinyunma

Details

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 kubernetes/test-infra repository.

@openshift-ci openshift-ci bot requested a review from jinyunma February 24, 2023 10:42
@r4f4
Copy link
Contributor Author

r4f4 commented Feb 24, 2023

/hold
Ops, forgot to commit the vendor changes. Will do so once the Azure jobs finish.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 24, 2023
@r4f4
Copy link
Contributor Author

r4f4 commented Feb 24, 2023

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 24, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Might be able to clean this warning up a bit. "Certs are only supported by the installer, not the cluster". Maybe something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't add this warning, just moved it. It was added in #6250. But I can reword if we think it's necessary.

r4f4 added 3 commits February 27, 2023 20:24
The `autorest/auth` library expects specific keys in the json file for
certificate authentication [1]. If we ever saved the Credentials object
to a json file during survey, it would have used the wrong keys:
`certificatePath` and `certificatePassword` instead of
`clientCertificate` and `clientCertificatePassword`, respectively.

This change aims to fix that so that the saved `osServicePrincipal.json`
file with certificate authentication details can be correctly loaded by
the autorest library. It'll also be important in a follow-up change
where we are going to load the file ourselves instead of using autorest.

Notice that this is not breaking compatibility with previous versions
since those fields were never used to create a file (we only survey
client secret credentials).

[1] https://github.com/Azure/go-autorest/blob/main/autorest/azure/auth/auth.go#L348-L349
If you tried to authenticate with a certificate and provided the wrong
password, the installer error message didn't actually say what the error
was. It just said

```
$ ./openshift-install create install-config --dir ipi-test
INFO Could not get an azure authorizer from file: auth file missing client and certificate credentials
INFO Asking user to provide authentication info
? azure subscription id [? for help]
```

That happens because the autorest lib would just ignore the auth errors
in favor of a generic message [1]. Since the `autorest/auth` module is
going out of support by March 31, 2023, let's get rid of it and load the
auth file ourselves.

Now when doing cert authentication with the wrong password we get:

```
INFO Credentials loaded from file "/root/.azure/osServicePrincipal.json"
WARNING Using client certs to authenticate. Please be warned cluster does not support certs and only the installer does.
ERROR failed to fetch Kubeconfig Admin Client: failed to load asset "Install Config": failed to create install config: creating Azure session: failed to parse client certificate: pkcs12: decryption password incorrect
```

[1] https://github.com/Azure/go-autorest/blob/main/autorest/azure/auth/auth.go#L264-L270
@r4f4 r4f4 force-pushed the azure-remove-autorest-auth branch from 6abfb63 to fcaccfa Compare February 27, 2023 19:24
@r4f4
Copy link
Contributor Author

r4f4 commented Feb 27, 2023

Added a new commit to isoloate and explain why the json annotations were changed. No code changes were introduced.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 27, 2023

@r4f4: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-upgrade fcaccfa link false /test okd-scos-e2e-aws-upgrade
ci/prow/okd-scos-e2e-aws-ovn fcaccfa link false /test okd-scos-e2e-aws-ovn
ci/prow/okd-e2e-aws-ovn-upgrade fcaccfa link false /test okd-e2e-aws-ovn-upgrade
ci/prow/e2e-azurestack fcaccfa link false /test e2e-azurestack

Full PR test history. Your PR dashboard.

Details

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.

@patrickdillon
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: patrickdillon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Feb 28, 2023
@patrickdillon
Copy link
Contributor

/lgtm
e2e-azure-ovn was successful install. just one e2e test failure re registry.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2023
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 05a6325 and 2 for PR HEAD fcaccfa in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 1445b3b and 1 for PR HEAD fcaccfa in total

@openshift-merge-robot openshift-merge-robot merged commit 9a5ef71 into openshift:master Mar 1, 2023
@openshift-ci-robot
Copy link
Contributor

@r4f4: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-7860 has been moved to the MODIFIED state.

Details

In response to this:

If you tried to authenticate with a certificate and provided the wrong password, the installer error message didn't actually say what the error was. It just said

$ ./openshift-install create install-config --dir ipi-test
INFO Could not get an azure authorizer from file: auth file missing client and certificate credentials
INFO Asking user to provide authentication info
? azure subscription id [? for help]

That happens because the autorest lib would just ignore the auth errors in favor of a generic message [1]. Since the autorest/auth module is going out of support by March 31, 2023, let's get rid of it and load the auth file ourselves.

Now when doing cert authentication with the wrong password we get:

INFO Credentials loaded from file "/root/.azure/osServicePrincipal.json"
WARNING Using client certs to authenticate. Please be warned cluster does not support certs and only the installer does.
ERROR failed to fetch Kubeconfig Admin Client: failed to load asset "Install Config": failed to create install config: creating Azure session: failed to parse client certificate: pkcs12: decryption password incorrect

[1] https://github.com/Azure/go-autorest/blob/main/autorest/azure/auth/auth.go#L264-L270

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants