-
Notifications
You must be signed in to change notification settings - Fork 5
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
Rotate logged in host api key #143
Conversation
262d4a8
to
e572160
Compare
newAPIKey, err := client.RotateHostAPIKey(hostID) | ||
var newAPIKey []byte | ||
if hostID == "" { | ||
newAPIKey, err = client.RotateCurrentUserAPIKey() |
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 seems if a user is logged in and ran 'conjur host rotate-api-key' it would also rotate the user's api key. I'm thinking in this case maybe we should fail with an error since that's probably not what the user wants to happen. They may be expecting usage info or something instead.
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.
Good point, the same is also true for conjur host rotate-api-key
. This PR is addressing the particular reported bug. Perhaps we can address that in a separate PR
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.
Almost there, just one tiny typo ;)
e572160
to
9fd4c32
Compare
@doodlesbykumbi I committed the typo fix and filled in the PR description. Can you please add a changelog entry? |
43bc2ff
to
e9e6d01
Compare
Code Climate has analyzed commit e9e6d01 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 82.3% (0.0% change). View more on Code Climate. |
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
Desired Outcome
Rotating your own role's API key in Conjur requires that the request include basic authentication credentials to verify that the user has positive control of either the current password or API key.
Currently there is no way to configure the Golang CLI to send basic authentication for the rotate API key request, so it is not possible to rotate your own API key with the CLI.
Note, it is possible to rotate another role's API key that your role has update privilege for.
Implemented Changes
Change command behavior of
conjur host rotate-api-key
without parameters to rotate the currently logged in host's api key, the same asconjur user rotate-api-key
without parametersConnected Issue/Story
CyberArk internal issue ID: CNJR-2078
Definition of Done
At least 1 todo must be completed in the sections below for the PR to be
merged.
Changelog
CHANGELOG update
Test coverage
changes, or
Documentation
README
s) were updated in this PRBehavior
Security