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

Allow step ssh proxycommand to fall through to standard SSH auth #750

Open
DjLogozzo opened this issue Sep 16, 2022 · 4 comments
Open

Allow step ssh proxycommand to fall through to standard SSH auth #750

DjLogozzo opened this issue Sep 16, 2022 · 4 comments
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Milestone

Comments

@DjLogozzo
Copy link

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

When attempting to SSH into a server that has been setup for SSH Certificate Authentication, with a client that has been setup for SSH Certificate Authentication (ie: step ssh config), it no longer becomes possible to login to accounts not in your principal, eg: break-glass accounts, using the hostname.

We are currently able to bypass this issue by directly using the IP of the server when running the SSH command, as this does not trigger the step ssh check-host command in the default SSH config template, but this feels like a hacky workaround.

A better solution would be to allow step ssh proxycommand to fallthrough to basic SSH auth if the user is not in the principal of the certificate. Possibly as an argument that can be embedded in the config template so it is not default behaviour.

Why is this needed?

It would allow users to login to break-glass, shared, or external auth (ie: LDAP) accounts without resorting to tricks to get around the step ssh check-host check.

I haven't tested this usecase, but I also believe it would be useful for scenarios where the CA is down, but the user still needs to login to the server (possibly to fix the issue of the CA being down lol)

Info about our setup

We currently have our servers setup for SSO using smallstep CA with Azure as the OpenID provider (following this guide).

@DjLogozzo DjLogozzo added enhancement needs triage Waiting for discussion / prioritization by team labels Sep 16, 2022
@dopey dopey added this to the v0.23.0 milestone Sep 21, 2022
@dopey
Copy link
Contributor

dopey commented Oct 5, 2022

Hey @DjLogozzo 👋 . Apologies for the radio silence. We agree that this would be a useful feature and we've added it the next milestone. We don't have an exact date for that yet, but we generally release a new tag (milestone) about once every 1 or 2 months.

Thanks for taking the time to open the issue! Cheers 🍻

@maraino maraino modified the milestones: v0.23.0, v0.24.0 Nov 11, 2022
@weaversam8
Copy link

This would be very helpful for us as well- trying multiple identities in the agent is the default behavior if you just use step ssh login, so it makes sense that proxycommand should support it as well...

@weaversam8
Copy link

@DjLogozzo As a temporary workaround, a configuration like this works quite well!

Match exec "step ssh check-host %h
    # ...
    ProxyCommand bash -c "step ssh proxycommand %r %h %p --provisioner 'Provisioner Name' || nc %h %p"

This falls back to what's essentially a "no-op" ProxyCommand if step ssh proxycommand fails for any reason. I figured out this trick from @jpverkamp's blog, so thanks very much JP!

@jpverkamp
Copy link

Yay! 🎉 I'm glad it helped!

@maraino maraino modified the milestones: v0.24.0, v0.24.1 Apr 12, 2023
@maraino maraino modified the milestones: v0.24.4, v0.24.5 Jul 18, 2023
@maraino maraino modified the milestones: v0.25.0, v0.25.1 Sep 27, 2023
@hslatman hslatman modified the milestones: v0.25.1, v0.25.2 Nov 29, 2023
@hslatman hslatman modified the milestones: v0.25.2, v0.25.3 Feb 20, 2024
@hslatman hslatman modified the milestones: v0.26.0, v0.26.1 Mar 29, 2024
@hslatman hslatman modified the milestones: v0.26.1, v0.26.2 Apr 25, 2024
@hslatman hslatman modified the milestones: v0.26.2, v0.26.3 Jun 17, 2024
@hslatman hslatman modified the milestones: v0.27.0, v0.27.2 Jul 15, 2024
@hslatman hslatman modified the milestones: v0.27.2, v0.27.3 Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

6 participants