Replace additional occurrences of incorrect `RoleARN` with `RoleArn`. Staged http://192.241.195.202:9000/staging/DOCS-1102-2/linux/index.html Remaining item, fixes https://github.com/minio/docs/issues/1102
7.4 KiB
OpenID Connect Access Management
minio
Table of Contents
MinIO supports using an OpenID Connect (OIDC) compatible IDentity Provider (IDP) such as Okta, KeyCloak, Dex, Google, or Facebook for external management of user identities.
For identities managed by the external OpenID Connect (OIDC) compatible provider, MinIO can use either of two methods to assign policies to the authenticated user.
- Use the JSON Web
Token claim returned as part of the OIDC authentication flow to
identify the
policies <minio-policy>
to assign to the authenticated user. - Use the
RoleArn
specified in the authorization request to assign the policies attached to the provider's RolePolicy.
MinIO by default denies access to all actions or resources not
explicitly allowed by a user's assigned or inherited policies <minio-policy>
. Users managed by an
OIDC provider must specify the necessary policies as part of the JWT
claim. If the user JWT claim has no matching MinIO policies, that user
has no permissions to access any action or resource on the MinIO
deployment.
The specific claim which MinIO looks for is configured as part of
deploying the cluster with OIDC identity management <minio-external-iam-oidc>
.
This page focuses on creating MinIO policies to match the configured
OIDC claims.
Authentication and Authorization Flow
MinIO supports two OIDC authentication and authorization flows:
The RolePolicy flow sets the assigned policies for an authenticated user in the MinIO configuration.
MinIO recommends using the RolePolicy method for authenticating with an OpenID provider.
The JWT flow sets the assigned policies for an authenticated user as part of the OIDC configuration.
MinIO supports multiple OIDC provider configurations. However, you can configure only one JWT claim-based OIDC provider per deployment. All other providers must use RolePolicy.
RolePolicy and RoleArn
With a RolePolicy, all clients which generate an STS credential using
a given RoleArn receive the policy or policies <minio-policy>
associated to
the RolePolicy configuration for that RoleArn.
You can use OpenID Policy Variables <minio-policy-variables-oidc>
to create policies that programmatically manage what each individual
user has access to.
The login flow for an application using OIDC (OpenID Connect)
credentials with a RolePolicy claim flow is as follows:
Create an OIDC Configuration.
Record the RoleArn assigned to the configuration either at time of creation or at MinIO start. Use this RoleArn with the
AssumeRoleWithWebIdentity <minio-sts-assumerolewithwebidentity>
STS API.Create a RolePolicy to use with the RoleArn. Use either the
MINIO_IDENTITY_OPENID_ROLE_POLICY
environment variable or theidentity_openid role_policy <identity_openid.role_policy>
configuration setting to define the list of policies to use for the providerUsers select the configured OIDC provider when logging in to MinIO.
Users complete authentication to the configured
OIDC (OpenID Connect)
provider and redirect back to MinIO.MinIO only supports the OpenID Authorization Code Flow. Authentication using Implicit Flow is not supported.
MinIO verifies the
RoleArn
in the API call and checks for theRolePolicy <minio-external-identity-management-openid-access-control>
to use. Any authentication request with the RoleArn receives the same policy access permissions.MinIO returns temporary credentials in the STS API response in the form of an access key, secret key, and session token. The credentials have permissions matching those policies specified in the RolePolicy.
Applications use the temporary credentials returned by the STS endpoint to perform authenticated S3 operations on MinIO.
JSON Web Token Claim
Using JSON Web Tokens allows you to have individual assignment of policies. However, the use of web tokens also comes at the increased cost of managing multiple policies for separate claims.
The login flow for an application using OIDC (OpenID Connect)
credentials with a JSON Web Token Claim flow is as follows:
Authenticate to the configured
OIDC (OpenID Connect)
provider and retrieve a JSON Web Token (JWT).MinIO only supports the OpenID Authorization Code Flow. Authentication using Implicit Flow is not supported.
Specify the
JWT (JSON Web Token)
to the MinIO Security Token Service (STS)minio-sts-assumerolewithwebidentity
API endpoint.MinIO verifies the
JWT (JSON Web Token)
against the configured OIDC provider.If the JWT is valid, MinIO checks for a
claim <minio-external-identity-management-openid-access-control>
specifying a list of one or morepolicies <minio-policy>
to assign to the authenticated user. MinIO defaults to checking thepolicy
claim.MinIO returns temporary credentials in the STS API response in the form of an access key, secret key, and session token. The credentials have permissions matching those policies specified in the JWT claim.
Applications use the temporary credentials returned by the STS endpoint to perform authenticated S3 operations on MinIO.
MinIO provides an example Go application web-identity.go <minio/blob/master/docs/sts/web-identity.go>
that handles the full login flow.
OIDC users can alternatively create access keys <minio-idp-service-account>
. Access
Keys are long-lived credentials which inherit their privileges from the
parent user. The parent user can further restrict those privileges while
creating the access keys. To create a new access key, log into the MinIO Console <minio-console>
using the
OIDC-managed user credentials. From the Identity
section of the left navigation, select
Access Keys
followed by the Create access keys +
button.
Identifying the JWT Claim Value
MinIO uses the JWT token returned as part of the OIDC authentication flow to identify the specific policies to assign to the authenticated user.
You can use a JWT Debugging tool to decode the returned JWT token and validate that the user attributes include the required claims.
See RFC 7519: JWT Claim for more information on JWT claims.
Defer to the documentation for your preferred OIDC provider for instructions on configuring user claims.
Creating Policies to Match Claims
Use either the MinIO Console or the mc admin policy
command to
create policies that match one or more claim values.