Skip to content

Commit 529e67d

Browse files
authored
Changes for several issues related to SFTP and LDAP (#1252)
- Adds info the docs about recent changes to LDAP and SFTP authentication - Adds new config/envvar parameter - Adds new sftp option for server - Adds new example for forcing ldap or sa auth to SFTP - Adds new example for using certificate authority for auth to SFTP Closes #1240 Closes #1229 Closes #1226 Closes #1208
1 parent 7ffa8b6 commit 529e67d

File tree

8 files changed

+199
-2
lines changed

8 files changed

+199
-2
lines changed

source/includes/common-minio-ad-ldap-params.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434

3535
This parameter corresponds with the :envvar:`MINIO_IDENTITY_LDAP_LOOKUP_BIND_PASSWORD` environment variable.
3636

37+
.. mc-cmd:: user_dn_attributes
38+
:optional:
39+
40+
.. include:: /includes/common-minio-external-auth.rst
41+
:start-after: start-minio-ad-ldap-user-dn-attributes
42+
:end-before: end-minio-ad-ldap-user-dn-attributes
43+
3744
.. mc-cmd:: user_dn_search_base_dn
3845
:required:
3946

source/includes/common-minio-external-auth.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,24 @@ Specify the password for the :ref:`Lookup-Bind
211211

212212
.. end-minio-ad-ldap-lookup-bind-password
213213
214+
.. start-minio-ad-ldap-user-dn-attributes
215+
216+
.. versionadded:: RELEASE.2024-06-06T09-36-42Z
217+
218+
Comma-separated list of user DN attributes.
219+
220+
Some valid values include, ``uid,cn,mail,sshPublicKey``.
221+
222+
To enable public authentication for LDAP users, pass ``sshPublicKey`` as a DN attribute.
223+
The user can then use the passed SSH Public Key to log in to SFTP servers.
224+
225+
.. code-block:: text
226+
:class: copyable
227+
228+
mc idp ldap update ALIAS user_dn_attributes=sshPublicKey
229+
230+
.. end-minio-ad-ldap-user-dn-attributes
231+
214232
.. start-minio-ad-ldap-user-dn-search-base-dn
215233
216234
Specify the base Distinguished Name (DN) MinIO uses when querying for

source/includes/k8s/file-transfer-protocol-k8s.rst

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ MinIO supports the following authentication providers:
5353
- :ref:`MinIO IDP <minio-internal-idp>` users and their service accounts
5454
- :ref:`Active Directory/LDAP <minio-external-identity-management-ad-ldap>` users and their service accounts
5555
- :ref:`OpenID/OIDC <minio-external-identity-management-openid>` service accounts
56+
- :ref:`Certificate Key File <minio-certificate-key-file-sftp-k8s>`
5657

5758
:ref:`STS <minio-security-token-service>` credentials **cannot** access buckets or objects over SFTP.
5859

@@ -165,3 +166,73 @@ If SFTP is enabled, the output resembles the following:
165166
166167
enableSFTP: true
167168
169+
.. _minio-certificate-key-file-sftp-k8s
170+
171+
Connect to MinIO Using SFTP with a Certificate Key File
172+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173+
174+
.. versionadded:: RELEASE.2024-05-07T06-41-25Z
175+
176+
177+
MinIO supports mutual TLS (mTLS) certificate-based authentication on SFTP, where both the server and the client verify the authenticity of each other.
178+
179+
This type of authentication requires the following:
180+
181+
1. Public key file for the trusted certificate authority
182+
2. Public key file for the MinIO Server minted and signed by the trusted certificate authority
183+
3. Public key file for the user minted and signed by the trusted certificate authority for the client connecting by SFTP and located in the user's ``.ssh`` folder (or equivalent for the operating system)
184+
185+
The keys must include a `principals list <https://man.openbsd.org/ssh-keygen#CERTIFICATES>`__ of the user(s) that can authenticate with the key:
186+
187+
.. code-block:: console
188+
:class: copyable
189+
190+
ssh-keygen -s ~/.ssh/ca_user_key -I miniouser -n miniouser -V +1h -z 1 miniouser1.pub
191+
192+
- ``-s`` specifies the path to the certificate authority public key to use for generating this key.
193+
The specified public key must have a ``principals`` list that includes this user.
194+
- ``-I`` specifies the key identity for the public key.
195+
- ``-n`` creates the ``user principals`` list for which this key is valid.
196+
You must include the user for which this key is valid, and the user must match the username in MinIO.
197+
- ``-V`` limits the duration for which the generated key is valid.
198+
In this example, the key is valid for one hour.
199+
Adjust the duration for your requirements.
200+
- ``-z`` adds a serial number to the key to distinguish this generated public key from other keys signed by the same certificate authority public key.
201+
202+
MinIO requires specifying the Certificate Authority used to sign the certificates for SFTP access.
203+
Start or restart the MinIO Server and specify the path to the trusted certificate authority's public key using an ``--sftp="trusted-user-ca-key=PATH"`` flag:
204+
205+
.. code-block:: console
206+
:class: copyable
207+
208+
minio server {path-to-server} --sftp="trusted-user-ca-key=/path/to/.ssh/ca_user_key.pub" {...other flags}
209+
210+
When connecting to the MinIO Server with SFTP, the client verifies the MinIO Server's certificate.
211+
The client then passes its own certificate to the MinIO Server.
212+
The MinIO Server verifies the key created above by comparing its value to the the known public key from the certificate authority provided at server startup.
213+
214+
Once the MinIO Server verifies the client's certificate, the user can connect to the MinIO server over SFTP:
215+
216+
.. code-block:: bash
217+
:class: copyable:
218+
219+
sftp -P <SFTP port> <server IP>
220+
221+
Require service account or LDAP for authentication
222+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223+
224+
To force authentication to SFTP using LDAP or service account credentials, append a suffix to the username.
225+
Valid suffixes are either ``=ldap`` or ``=svc``.
226+
227+
.. code-block:: console
228+
229+
> sftp -P 8022 my-ldap-user=ldap@[minio@localhost]:/bucket
230+
231+
232+
.. code-block:: console
233+
234+
> sftp -P 8022 my-ldap-user=svc@[minio@localhost]:/bucket
235+
236+
237+
- Replace ``my-ldap-user`` with the username to use.
238+
- Replace ``[minio@localhost]`` with the address of the MinIO server.

source/includes/linux/file-transfer-protocol-not-k8s.rst

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Overview
44
--------
55

6-
Starting with :minio-release:`MinIO Server RELEASE.2023-04-20T17-56-55Z <RELEASE.2023-04-20T17-56-55Z>`, you can use the File Transfer Protocol (FTP) to interact with the objects on a MinIO deployment.
6+
Starting with :minio-release:`MinIO Server RELEASE.2023-04-20T17-56-55Z <RELEASE.2023-04-20T17-56-55Z>`, you can use the File Transfer Protocol (FTP) or SSH File Transfer Protocol (SFTP) to interact with the objects on a MinIO deployment.
77

88
You must specifically enable FTP or SFTP when starting the server.
99
Enabling either server type does not affect other MinIO features.
@@ -67,7 +67,7 @@ Specifically:
6767

6868
- For read operations, MinIO only returns the latest version of the requested object(s) to the FTP client.
6969
- For write operations, MinIO applies normal versioning behavior and creates a new object version at the specified namespace.
70-
``rm`` and ``rmdir`` operations create ``DeleteMarker`` objects.
70+
``delete`` and ``rmdir`` operations create ``DeleteMarker`` objects.
7171

7272

7373
Authentication and Access
@@ -223,3 +223,71 @@ The following example connects to an SFTP server, lists the contents of a bucket
223223
Fetching /runner/chunkdocs/metadata to metadata
224224
metadata 100% 226 16.6KB/s 00:00
225225
226+
Connect to MinIO Using SFTP with a Certificate Key File
227+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
228+
229+
.. versionadded:: RELEASE.2024-05-07T06-41-25Z
230+
231+
232+
MinIO supports mutual TLS (mTLS) certificate-based authentication on SFTP, where both the server and the client verify the authenticity of each other.
233+
234+
This type of authentication requires the following:
235+
236+
1. Public key file for the trusted certificate authority
237+
2. Public key file for the MinIO Server minted and signed by the trusted certificate authority
238+
3. Public key file for the user minted and signed by the trusted certificate authority for the client connecting by SFTP and located in the user's ``.ssh`` folder (or equivalent for the operating system)
239+
240+
The keys must include a `principals list <https://man.openbsd.org/ssh-keygen#CERTIFICATES>`__ of the user(s) that can authenticate with the key:
241+
242+
.. code-block:: console
243+
:class: copyable
244+
245+
ssh-keygen -s ~/.ssh/ca_user_key -I miniouser -n miniouser -V +1h -z 1 miniouser1.pub
246+
247+
- ``-s`` specifies the path to the certificate authority public key to use for generating this key.
248+
The specified public key must have a ``principals`` list that includes this user.
249+
- ``-I`` specifies the key identity for the public key.
250+
- ``-n`` creates the ``user principals`` list for which this key is valid.
251+
You must include the user for which this key is valid, and the user must match the username in MinIO.
252+
- ``-V`` limits the duration for which the generated key is valid.
253+
In this example, the key is valid for one hour.
254+
Adjust the duration for your requirements.
255+
- ``-z`` adds a serial number to the key to distinguish this generated public key from other keys signed by the same certificate authority public key.
256+
257+
MinIO requires specifying the Certificate Authority used to sign the certificates for SFTP access.
258+
Start or restart the MinIO Server and specify the path to the trusted certificate authority's public key using an ``--sftp="trusted-user-ca-key=PATH"`` flag:
259+
260+
.. code-block:: console
261+
:class: copyable
262+
263+
minio server {path-to-server} --sftp="trusted-user-ca-key=/path/to/.ssh/ca_user_key.pub" {...other flags}
264+
265+
When connecting to the MinIO Server with SFTP, the client verifies the MinIO Server's certificate.
266+
The client then passes its own certificate to the MinIO Server.
267+
The MinIO Server verifies the key created above by comparing its value to the the known public key from the certificate authority provided at server startup.
268+
269+
Once the MinIO Server verifies the client's certificate, the user can connect to the MinIO server over SFTP:
270+
271+
.. code-block:: bash
272+
:class: copyable:
273+
274+
sftp -P <SFTP port> <server IP>
275+
276+
Require service account or LDAP for authentication
277+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278+
279+
To force authentication to SFTP using LDAP or service account credentials, append a suffix to the username.
280+
Valid suffixes are either ``=ldap`` or ``=svc``.
281+
282+
.. code-block:: console
283+
284+
> sftp -P 8022 my-ldap-user=ldap@[minio@localhost]:/bucket
285+
286+
287+
.. code-block:: console
288+
289+
> sftp -P 8022 my-ldap-user=svc@[minio@localhost]:/bucket
290+
291+
292+
- Replace ``my-ldap-user`` with the username to use.
293+
- Replace ``[minio@localhost]`` with the address of the MinIO server.

source/reference/minio-mc-admin/mc-admin-group.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ Syntax
224224
already exist. Use :mc-cmd:`mc admin group ls` to review the existing
225225
groups on a deployment.
226226

227+
A group name cannot contain the characters ``=`` (equal sign) or ``,`` (comma).
228+
227229
.. mc-cmd:: MEMBERS
228230

229231
The name of the user to add to the group.

source/reference/minio-mc/mc-idp-ldap-accesskey-create.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Parameters
7777
:optional:
7878

7979
An access key to use for the account.
80+
The access key cannot contain the characters ``=`` (equal sign) or ``,`` (comma).
8081

8182
Requires :mc-cmd:`~mc idp ldap accesskey create --secret-key`
8283

source/reference/minio-server/minio-server.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ The command accepts the following arguments:
192192
- Path to the user's private key file.
193193
- Absolute path or relative path from current location to the key file to use.
194194

195+
* - ``trusted-user-ca-key``
196+
- Specifies a file containing public key of a certificate authority that is trusted to sign user certificates for authentication.
197+
The file must contain a `user principals list <https://man.openbsd.org/ssh-keygen#CERTIFICATES>`__, and the list must include the user(s) that can authenticate with the key.
198+
- Absolute path or relative path from current location to the user's trusted certificate authority public key file.
199+
195200
* - ``pub-key-algos``
196201
- Comma-separated list of the public key algorithms to support.
197202
-
@@ -253,6 +258,9 @@ The command accepts the following arguments:
253258
hmac-sha1
254259
hmac-sha1-96
255260
261+
* - ``disable-password-auth``
262+
- Disable password authentication.
263+
- ``true``
256264

257265
For example:
258266

source/reference/minio-server/settings/iam/ldap.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,28 @@ User DN Search Filter
198198
:start-after: start-minio-ad-ldap-user-dn-search-filter
199199
:end-before: end-minio-ad-ldap-user-dn-search-filter
200200

201+
User DN Attributes
202+
~~~~~~~~~~~~~~~~~~
203+
204+
*Optional*
205+
206+
.. tab-set::
207+
208+
.. tab-item:: Environment Variable
209+
:sync: envvar
210+
211+
.. envvar:: MINIO_IDENTITY_LDAP_USER_DN_ATTRIBUTES
212+
213+
.. tab-item:: Configuration Setting
214+
:sync: config
215+
216+
.. mc-conf:: identity_ldap user_dn_attributes
217+
:delimiter: " "
218+
219+
.. include:: /includes/common-minio-external-auth.rst
220+
:start-after: start-minio-ad-ldap-user-dn-attributes
221+
:end-before: end-minio-ad-ldap-user-dn-attributes
222+
201223
Enabled
202224
~~~~~~~
203225

0 commit comments

Comments
 (0)