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

Add support for SSH CAs #1098

Merged
merged 3 commits into from
Apr 30, 2024
Merged

Add support for SSH CAs #1098

merged 3 commits into from
Apr 30, 2024

Conversation

johnmaguire
Copy link
Collaborator

@johnmaguire johnmaguire commented Mar 26, 2024

This adds support for configuring SSH CAs. The SSH server will accept authentication for any valid certificate signed by an SSH CA, assuming that the user they connect with matches a principal in the certificate - if no principals are defined in the cert, then any username can be used.

This is a step towards #1076, but does not implement group access control.

While working on this PR I noticed that removing authorized keys from the SSH configuration does not take effect upon reload. wireSSHReload calls configSSH with the existing server, and SSHServer.ClearAuthorizedKeys is not called anywhere in the codebase.

For this reason, I opted for the same behavior with CAs. I can fix this if it's a bug.

sshd/server.go Show resolved Hide resolved
sshd/server.go Outdated Show resolved Hide resolved
@johnmaguire
Copy link
Collaborator Author

johnmaguire commented Mar 27, 2024

In #1076, it was requested that this support a concept of "groups" as SSH certificate principals. In other words, when creating a certificate, you would specify groups (e.g. dev, ops, support.) In the Nebula config file, you'd have a list of allowed_princpials which would only allow certificates containing one of these principals. I imagine this would be a per-CA option (and should alternatively allow for an "any" rule, omitting the list.)

This could get a little awkward though - the current implementation requires that the username you connect with match a principal in the certificate. Ultimately however, the debug SSH server has no concept of permissions, so this username is only used for logging purposes. We could remove the username restriction and update the log line to record both the "key ID" and all principals, in the case of an SSH cert.

@wadey wadey added this to the v1.9.0 milestone Apr 24, 2024
@nbrownus nbrownus modified the milestones: v1.9.0, v1.10.0 Apr 29, 2024
@wadey wadey modified the milestones: v1.10.0, v1.9.0 Apr 30, 2024
@johnmaguire johnmaguire merged commit f31bab5 into slackhq:master Apr 30, 2024
7 checks passed
@johnmaguire johnmaguire deleted the ssh-ca branch April 30, 2024 14:50
johnmaguire added a commit to DefinedNet/nebula-docs that referenced this pull request May 1, 2024
johnmaguire added a commit to DefinedNet/nebula-docs that referenced this pull request May 1, 2024
johnmaguire added a commit to DefinedNet/nebula-docs that referenced this pull request May 1, 2024
@wadey wadey mentioned this pull request May 6, 2024
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants