minio/docs/sts
Andreas Auernhammer 14876a4df1
ldap: use custom TLS cipher suites (#20221)
This commit replaces the LDAP client TLS config and
adds a custom list of TLS cipher suites which support
RSA key exchange (RSA kex).

Some LDAP server connections experience a significant slowdown
when these cipher suites are not available. The Go TLS stack
disables them by default. (Can be enabled via GODEBUG=tlsrsakex=1).

fixes https://github.com/minio/minio/issues/20214

With a custom list of TLS ciphers, Go can pick the TLS RSA key-exchange
cipher. Ref:
```
	if c.CipherSuites != nil {
		return c.CipherSuites
	}
	if tlsrsakex.Value() == "1" {
		return defaultCipherSuitesWithRSAKex
	}
```
Ref: https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/crypto/tls/common.go;l=1017

Signed-off-by: Andreas Auernhammer <github@aead.dev>
2024-08-07 05:59:47 -07:00
..
client_grants Support for remote tier management (#12090) 2021-04-23 11:58:53 -07:00
.gitignore docs: Add more STS docs with dex and python example (#10047) 2020-07-15 17:25:55 +05:30
assume-role.go fix: close sessionPolicyFile in the sts-assume-role example (#19428) 2024-04-12 09:09:55 -07:00
assume-role.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00
casdoor.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00
client-grants.go fix: enable go1.17 github ci/cd (#12997) 2021-08-18 18:35:22 -07:00
client-grants.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00
client-grants.py Support for remote tier management (#12090) 2021-04-23 11:58:53 -07:00
custom-token-identity.go Add support for Identity Management Plugin (#14913) 2022-05-26 17:58:09 -07:00
custom-token-identity.md Add support for Identity Management Plugin (#14913) 2022-05-26 17:58:09 -07:00
dex.md check for quorum errors for DeleteBucket() (#16859) 2023-03-20 23:38:06 -07:00
dex.yaml docs: Add more STS docs with dex and python example (#10047) 2020-07-15 17:25:55 +05:30
etcd.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00
keycloak.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00
ldap.go ldap: use custom TLS cipher suites (#20221) 2024-08-07 05:59:47 -07:00
ldap.md ldap: Add user DN attributes list config param (#19758) 2024-05-24 16:05:23 -07:00
README.md remove gateway completely (#15929) 2022-10-24 17:44:15 -07:00
rw-ldap-username.json support ldap:username for policy substitution (#12390) 2021-05-28 10:33:07 -07:00
tls.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00
web-identity.go fix: return proper error if OIDC Discoverydoc fails to respond (#17242) 2023-05-19 02:13:33 -07:00
web-identity.md hide some deprecated fields from 'get' output (#20069) 2024-07-10 13:16:44 -07:00
web-identity.py fix: allow audience claim to be an array (#12810) 2021-07-27 18:37:51 -07:00
wso2.md Update links to documentation site (#15750) 2022-09-28 21:28:45 -07:00

MinIO STS Quickstart Guide Slack

The MinIO Security Token Service (STS) is an endpoint service that enables clients to request temporary credentials for MinIO resources. Temporary credentials work almost identically to default admin credentials, with some differences:

  • Temporary credentials are short-term, as the name implies. They can be configured to last for anywhere from a few minutes to several hours. After the credentials expire, MinIO no longer recognizes them or allows any kind of access from API requests made with them.
  • Temporary credentials do not need to be stored with the application but are generated dynamically and provided to the application when requested. When (or even before) the temporary credentials expire, the application can request new credentials.

Following are advantages for using temporary credentials:

  • Eliminates the need to embed long-term credentials with an application.
  • Eliminates the need to provide access to buckets and objects without having to define static credentials.
  • Temporary credentials have a limited lifetime, there is no need to rotate them or explicitly revoke them. Expired temporary credentials cannot be reused.

Identity Federation

AuthN Description
WebIdentity Let users request temporary credentials using any OpenID(OIDC) compatible web identity providers such as KeyCloak, Dex, Facebook, Google etc.
AD/LDAP Let AD/LDAP users request temporary credentials using AD/LDAP username and password.
AssumeRole Let MinIO users request temporary credentials using user access and secret keys.

Understanding JWT Claims

NOTE: JWT claims are only meant for WebIdentity and ClientGrants. AssumeRole or LDAP users can skip the entire portion and directly visit one of the links below.

The id_token received is a signed JSON Web Token (JWT). Use a JWT decoder to decode the id_token to access the payload of the token that includes following JWT claims, policy claim is mandatory and should be present as part of your JWT claim. Without this claim the generated credentials will not have access to any resources on the server, using these credentials application would receive 'Access Denied' errors.

Claim Name Type Claim Value
policy string or []string or comma_separated_value Canned policy name to be applied for STS credentials. (Mandatory) - This can be configured to any desired value such as roles or groups by setting the environment variable MINIO_IDENTITY_OPENID_CLAIM_NAME

Get started

In this document we will explain in detail on how to configure all the prerequisites.

NOTE: If you are interested in AssumeRole API only, skip to here

Prerequisites

Setup MinIO with Identity Provider

Make sure we have followed the previous step and configured each software independently, once done we can now proceed to use MinIO STS API and MinIO server to use these credentials to perform object API operations.

KeyCloak

export MINIO_ROOT_USER=minio
export MINIO_ROOT_PASSWORD=minio123
export MINIO_IDENTITY_OPENID_CONFIG_URL=http://localhost:8080/auth/realms/demo/.well-known/openid-configuration
export MINIO_IDENTITY_OPENID_CLIENT_ID="843351d4-1080-11ea-aa20-271ecba3924a"
minio server /mnt/data

Casdoor

export MINIO_ROOT_USER=minio
export MINIO_ROOT_PASSWORD=minio123
export MINIO_IDENTITY_OPENID_CONFIG_URL=http://CASDOOR_ENDPOINT/.well-known/openid-configuration
export MINIO_IDENTITY_OPENID_CLIENT_ID="843351d4-1080-11ea-aa20-271ecba3924a"
minio server /mnt/data

Using WebIdentiy API

On another terminal run web-identity.go a sample client application which obtains JWT id_tokens from an identity provider, in our case its Keycloak. Uses the returned id_token response to get new temporary credentials from the MinIO server using the STS API call AssumeRoleWithWebIdentity.

$ go run docs/sts/web-identity.go -cid account -csec 072e7f00-4289-469c-9ab2-bbe843c7f5a8  -config-ep "http://localhost:8080/auth/realms/demo/.well-known/openid-configuration" -port 8888
2018/12/26 17:49:36 listening on http://localhost:8888/

This will open the login page of keycloak, upon successful login, STS credentials along with any buckets discovered using the credentials will be printed on the screen, for example:

{
  "buckets": [
    "bucket-x"
  ],
  "credentials": {
    "AccessKeyID": "6N2BALX7ELO827DXS3GK",
    "SecretAccessKey": "23JKqAD+um8ObHqzfIh+bfqwG9V8qs9tFY6MqeFR+xxx",
    "SessionToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiI2TjJCQUxYN0VMTzgyN0RYUzNHSyIsImFjciI6IjAiLCJhdWQiOiJhY2NvdW50IiwiYXV0aF90aW1lIjoxNTY5OTEwNTUyLCJhenAiOiJhY2NvdW50IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJleHAiOjE1Njk5MTQ1NTQsImlhdCI6MTU2OTkxMDk1NCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdDo4MDgxL2F1dGgvcmVhbG1zL2RlbW8iLCJqdGkiOiJkOTk4YTBlZS01NDk2LTQ4OWYtYWJlMi00ZWE5MjJiZDlhYWYiLCJuYmYiOjAsInBvbGljeSI6InJlYWR3cml0ZSIsInByZWZlcnJlZF91c2VybmFtZSI6Im5ld3VzZXIxIiwic2Vzc2lvbl9zdGF0ZSI6IjJiYTAyYTI2LWE5MTUtNDUxNC04M2M1LWE0YjgwYjc4ZTgxNyIsInN1YiI6IjY4ZmMzODVhLTA5MjItNGQyMS04N2U5LTZkZTdhYjA3Njc2NSIsInR5cCI6IklEIn0._UG_-ZHgwdRnsp0gFdwChb7VlbPs-Gr_RNUz9EV7TggCD59qjCFAKjNrVHfOSVkKvYEMe0PvwfRKjnJl3A_mBA"",
    "SignerType": 1
  }
}

NOTE: You can use the -cscopes parameter to restrict the requested scopes, for example to "openid,policy_role_attribute", being policy_role_attribute a client_scope / client_mapper that maps a role attribute called policy to a policy claim returned by Keycloak.

These credentials can now be used to perform MinIO API operations.

Using MinIO Console

  • Open MinIO URL on the browser, lets say http://localhost:9000/
  • Click on Login with SSO
  • User will be redirected to the Keycloak user login page, upon successful login the user will be redirected to MinIO page and logged in automatically, the user should see now the buckets and objects they have access to.

Explore Further