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

Azure SSH: clear current identity before logging in again #149

Conversation

GGonryun
Copy link
Contributor

@GGonryun GGonryun commented Dec 5, 2024

This PR adds runs the az logout before logging in so that we wipe any currently connected identities. This resolves a handful of issues we're seeing for example:

  1. granting a user access, relinquishing access, and then granting again will use an old cached identity which will have a temporary block on access.
  2. granting sudo access, and regular user access and relinquishing one temporarily blocks access to the account.
  3. if someone runs az login and uses a different identity that has the same subscription id.

@GGonryun GGonryun self-assigned this Dec 5, 2024
Copy link
Contributor

@p0-andrewa p0-andrewa left a comment

Choose a reason for hiding this comment

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

One question inline

Comment on lines +19 to +22
export const azLogoutCommand = () => ({
command: "az",
args: ["logout"],
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the az logout command be added to the azureSshProvider.reproCommands() output for completeness?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed 👍

Copy link
Contributor

@p0-andrewa p0-andrewa left a comment

Choose a reason for hiding this comment

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

:shipit:

@GGonryun GGonryun merged commit 491941e into main Dec 5, 2024
3 checks passed
@GGonryun GGonryun deleted the miguelcampos/eng-3261-azure-ssh-revoking-access-and-requesting-again-picks-up-the branch December 5, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants