[go: nahoru, domu]

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 LDAP public key authentication to SFTP #19833

Merged
merged 15 commits into from
Jun 5, 2024

Conversation

zveinn
Copy link
Contributor
@zveinn zveinn commented May 29, 2024

Community Contribution License

All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.

Description

This PR introduces public key authentication for LDAP users in the SFTP driver.
The public key attribute can be included in the users dn attributes using MC:

$ mc idp ldap update [ALIAS] user_dn_attributes=sshPublicKey

More information about the LDAP implementation can be found within this PR: #19758

This PR also includes a new cli parameter for sftp which lets the operator disable password authentication.

--sftp="disable-password-auth=true"

Additionally, we are experimenting with new suffixes for SFTP authentication. In order to force service account or ldap authentication the user can authenticate with =ldap or =svc as suffixes to their usernames.

$ scp -P [port] -i [public_key] [file] [user=ldap]@[minio]:/[bucket]
$ scp -P [port] -i [public_key] [file] [user=svc]@[minio]:/[bucket]

Motivation and Context

How to test this PR?

This repository: https://github.com/minio/minio-iam-testing includes an ldap setup with sftp keys.
Once configured, simply create a bucket and then upload a file using scp:

$ scp -P [port] -i [public_key] [file] [user]@[minio]:/[bucket]

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

go.sum Outdated Show resolved Hide resolved
@klauspost klauspost changed the title Sftp refactor Add LDAP public key authentication to SFTP May 30, 2024
Copy link
Contributor
@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

Just some minor things. I cannot judge if this is functionally correct.

cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
Copy link
Contributor
@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

Did you push the changes to another branch?

cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
@zveinn
Copy link
Contributor Author
zveinn commented May 31, 2024

The changes have been resolved locally, I haven't pushed anything up yet. Harsha asked for some tests to accompany the changes.

@zveinn
Copy link
Contributor Author
zveinn commented May 31, 2024

@klauspost changes are pushed :) sorry for the confusion

cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server_test.go Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Show resolved Hide resolved
cmd/sftp-server.go Outdated Show resolved Hide resolved
Copy link
Contributor
@klauspost klauspost left a comment

Choose a reason for hiding this comment

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

👍🏼

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.

None yet

4 participants