DexAuthenticator
Scope: Namespaced
After the DexAuthenticator
object appears in the namespace, the following objects will be created:
- Deployment containing OAuth2-Proxy and Redis containers;
- Service, pointing to OAuth2-Proxy;
- Ingress resource, configured to receive requests on
https://<applicationDomain>/dex-authenticator
and send it to a service side; - Secrets, needed to access Dex.
Warning. After restarting a pod with an OAuth2-Proxy, the current Access Token and ID Token will be queried (using the refresh token) and stored in a Redis memory.
Example:
apiVersion: deckhouse.io/v1
kind: DexAuthenticator
metadata:
name: app-name
namespace: app-namespace
spec:
applicationDomain: app-name.kube.my-domain.com
sendAuthorizationHeader: false
applicationIngressCertificateSecretName: ingress-tls
applicationIngressClassName: nginx
keepUsersLoggedInFor: 720h
allowedGroups:
- everyone
- admins
whitelistSourceRanges:
- 1.1.1.1/32
- 192.168.0.0/24
additionalApplications:
- domain: additional-app-name.kube.my-domain.com
ingressSecretName: ingress-tls
ingressClassName: nginx
signOutURL: "/logout"
whitelistSourceRanges:
- 2.2.2.2/32
- array of objects
A list of additional applications for which user authentication is required.
- string
The name of the Secret containing the TLS certificate (from the domain) used in the applications Ingress resource. The Secret must be in the same namespace as DexAuthenticator.
Pattern:
^(|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$
- string
The URL of the application from which requests will be redirected to the sign-out URL of the
dex-authenticator
.It is used in the application to direct logout requests. A separate Ingress resource will be created for the specified URL, and requests to it will be redirected to
dex-authenticator
. - array of strings
CIDRs that are allowed to authenticate. Authentication is allowed without IP address restrictions, If not specified.
Example:
whitelistSourceRanges: - 192.168.42.0/24
- string
Required value
An address for the application (DNS domain for Ingress resource) from which the user request will be redirected for authentication in Dex.
Warning. Must be specified without HTTP scheme.
Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
Example:
applicationDomain: my-app.domain.com
- string
The name of the Secret containing the TLS certificate for the application domain (is used in the Ingress resource). The Secret must be located in the same namespace as the DexAuthenticator.
Pattern:
^(|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$
Example:
applicationIngressCertificateSecretName: ingress-tls
- string
Required value
The name of the Ingress class to be used in the Ingress resource (it must match the Ingress class name for the application domain).
Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
Example:
applicationIngressClassName: nginx
- boolean
Request to application will be sent with
Authorization: Bearer
header when the option is switched to true. - string
The URL of the application from which requests will be redirected to the sign-out URL of the
dex-authenticator
.It is used in the application to direct logout requests. A separate Ingress resource will be created for the specified URL, and requests to it will be redirected to
dex-authenticator
. - array of objects
If specified the
dex-authenticator
pods tolerations.Format: the standard toleration list. Instance pods inherit this field as is.
- string
Defines how the key and its value are linked — whether the key must be
Equal
to the value or can have any value.Setting it to
Exists
is equivalent to the value having any value so that the pod with the specified toleration can match the corresponding taint.Default:
"Equal"
Allowed values:
Exists
,Equal
- integer
Specifies the period (in seconds) that the scheduler waits before evicting a Pod from a node if the toleration no longer matches the taint (only applicable to the
NoExecute
effect, otherwise ignored).If the parameter is not set, the Pod will not be evicted from the node if the toleration no longer matches the taint. If the parameter is set to zero (or negative), the Pod will be evicted immediately if the toleration no longer matches the taint.
The default is: not set.
- array of strings
CIDRs that are allowed to authenticate. Authentication is allowed without IP address restrictions, If not specified.
Example:
whitelistSourceRanges: - 192.168.42.0/24
- array of objects
Required value
A list of applications for which user authentication is required.
- string
The name of the Secret containing the TLS certificate for the application domain (is used in the Ingress resource). The Secret must be located in the same namespace as the DexAuthenticator.
Pattern:
^(|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$
- string
The URL of the application from which requests will be redirected to the sign-out URL of the
dex-authenticator
.It is used in the application to direct logout requests. A separate Ingress resource will be created for the specified URL, and requests to it will be redirected to
dex-authenticator
. - array of strings
CIDRs that are allowed to authenticate. Authentication is allowed without IP address restrictions, if not specified.
Example:
whitelistSourceRanges: - 192.168.42.0/24
- boolean
Request to application will be sent with
Authorization: Bearer
header when the option is switched to true. - array of objects
If specified the
dex-authenticator
pods tolerations.Format: the standard toleration list. Instance pods inherit this field as is.
- string
Defines how the key and its value are linked — whether the key must be
Equal
to the value or can have any value.Setting it to
Exists
is equivalent to the value having any value so that the pod with the specified toleration can match the corresponding taint.Default:
"Equal"
Allowed values:
Exists
,Equal
- integer
Specifies the period (in seconds) that the scheduler waits before evicting a Pod from a node if the toleration no longer matches the taint (only applicable to the
NoExecute
effect, otherwise ignored).If the parameter is not set, the Pod will not be evicted from the node if the toleration no longer matches the taint. If the parameter is set to zero (or negative), the Pod will be evicted immediately if the toleration no longer matches the taint.
The default is: not set.
Deprecated resource. Support for the resource might be removed in a later release.
After the DexAuthenticator
object appears in the namespace, the following objects will be created:
- Deployment containing OAuth2-Proxy and Redis containers;
- Service, pointing to OAuth2-Proxy;
- Ingress resource, configured to receive requests on
https://<applicationDomain>/dex-authenticator
and send it to a service side; - Secrets, needed to access Dex.
Warning. After restarting a pod with an OAuth2-Proxy, the current Access Token and ID Token will be queried (using the refresh token) and stored in a Redis memory.
Example:
apiVersion: deckhouse.io/v1
kind: DexAuthenticator
metadata:
name: app-name
namespace: app-namespace
spec:
applicationDomain: app-name.kube.my-domain.com
sendAuthorizationHeader: false
applicationIngressCertificateSecretName: ingress-tls
applicationIngressClassName: nginx
keepUsersLoggedInFor: 720h
allowedGroups:
- everyone
- admins
whitelistSourceRanges:
- 1.1.1.1/32
- 192.168.0.0/24
additionalApplications:
- domain: additional-app-name.kube.my-domain.com
ingressSecretName: ingress-tls
ingressClassName: nginx
signOutURL: "/logout"
whitelistSourceRanges:
- 2.2.2.2/32
- array of objects
A list of additional applications for which user authentication is required.
- string
The name of the Secret containing the TLS certificate (from the domain) used in the applications Ingress resource. The Secret must be in the same namespace as DexAuthenticator.
Pattern:
^(|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$
- string
The URL of the application from which requests will be redirected to the sign-out URL of the
dex-authenticator
.It is used in the application to direct logout requests. A separate Ingress resource will be created for the specified URL, and requests to it will be redirected to
dex-authenticator
. - array of strings
CIDRs that are allowed to authenticate. Authentication is allowed without IP address restrictions, If not specified.
Example:
whitelistSourceRanges: - 192.168.42.0/24
- string
Required value
An address for the application (DNS domain for Ingress resource) from which the user request will be redirected for authentication in Dex.
Warning. Must be specified without HTTP scheme.
Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
Example:
applicationDomain: my-app.domain.com
- string
The name of the Secret containing the TLS certificate for the application domain (is used in the Ingress resource). The Secret must be located in the same namespace as the DexAuthenticator.
Pattern:
^(|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$
Example:
applicationIngressCertificateSecretName: ingress-tls
- string
Required value
The name of the Ingress class to be used in the Ingress resource (it must match the Ingress class name for the application domain).
Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
Example:
applicationIngressClassName: nginx
- boolean
Request to application will be sent with
Authorization: Bearer
header when the option is switched to true. - string
The URL of the application from which requests will be redirected to the sign-out URL of the
dex-authenticator
.It is used in the application to direct logout requests. A separate Ingress resource will be created for the specified URL, and requests to it will be redirected to
dex-authenticator
. - array of objects
If specified the
dex-authenticator
pods tolerations.Format: the standard toleration list. Instance pods inherit this field as is.
- string
Defines how the key and its value are linked — whether the key must be
Equal
to the value or can have any value.Setting it to
Exists
is equivalent to the value having any value so that the pod with the specified toleration can match the corresponding taint.Default:
"Equal"
Allowed values:
Exists
,Equal
- integer
Specifies the period (in seconds) that the scheduler waits before evicting a Pod from a node if the toleration no longer matches the taint (only applicable to the
NoExecute
effect, otherwise ignored).If the parameter is not set, the Pod will not be evicted from the node if the toleration no longer matches the taint. If the parameter is set to zero (or negative), the Pod will be evicted immediately if the toleration no longer matches the taint.
The default is: not set.
- array of strings
CIDRs that are allowed to authenticate. Authentication is allowed without IP address restrictions, If not specified.
Example:
whitelistSourceRanges: - 192.168.42.0/24
DexClient
Scope: Namespaced
Allows applications that support DC authentication to interact with Dex.
After the DexClient
object appears in the cluster:
- Dex will register a client with a
dex-client-<NAME>@<NAMESPACE>
clientID, where<NAME>
and<NAMESPACE>
aremetadata.name
andmetadata.namespace
of the DexClient object, respectively. - A
dex-client-<NAME>
Secret containing the client access password (clientSecret) will be created in the corresponding namespace (where<NAME>
ismetadata.name
of the DexClient object).
- array of strings
OAuth2 client IDs that allowed cross authentication with the current client.
Deprecated resource. Support for the resource might be removed in a later release.
Allows applications that support DC authentication to interact with Dex.
After the DexClient
object appears in the cluster:
- Dex will register a client with a
dex-client-<NAME>@<NAMESPACE>
clientID, where<NAME>
and<NAMESPACE>
aremetadata.name
andmetadata.namespace
of the DexClient object, respectively. - A
dex-client-<NAME>
Secret containing the client access password (clientSecret) will be created in the corresponding namespace (where<NAME>
ismetadata.name
of the DexClient object).
- array of strings
OAuth2 client IDs that allowed cross authentication with the current client.
DexProvider
Scope: Cluster
Defines the configuration for connecting a third-party provider.
With it, you can flexibly configure the integration of the account directory with Kubernetes.
- array of strings
A list of allowed Bitbucket Cloud teams (filter).
The user token will contain a set intersection of Bitbucket Cloud teams and teams from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain the user teams in the
groups
claim (similar to other providers).
- boolean
Enables basic authorization for the Kubernetes API server.
The username and password of the user from the application created in Crowd are used as credentials for basic authorization (you can enable it only if there is just one provider of the OIDC/Crowd type). Works only if the
publishAPI
is enabled.Authorization and group data obtained from an IdP are stored in the cache for 10 seconds.
- array of strings
A list of allowed Crowd groups (filter).
The user token will contain a set intersection of Crowd groups and groups from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain all Crowd groups if the parameter is not set.
- array of objects
Filter for user organizations. ID token will contain only organizations from this list. If the user is not in any organization from this list, an authorization will fail.
By default, all organizations allowed.
- array of strings
A list of allowed GitHub teams (filter).
The user token will contain a set intersection of teams from GitHub and teams from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain all GitHub teams if the parameter is not set.
- string
As an example, group claims for member of ‘Site Reliability Engineers’ in Acme organization would yield:
- [‘acme:Site Reliability Engineers’] for ‘Name’
- [‘acme:site-reliability-engineers’] for ‘Slug’
- [‘acme:Site Reliability Engineers’, ‘acme:site-reliability-engineers’] for ‘Both’
‘name’ will be used by default.
Default:
"Name"
Allowed values:
Name
,Slug
,Both
- array of strings
A list (filter) of allowed GitLab groups (group paths and not names).
The user token will contain a set intersection of GitLab groups and groups from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain all GitLab groups if the parameter is not set;
- array of objects
Required value
Following list contains field pairs that are used to match a user to a group. It adds a requirement to the filter that an attribute in the group must match the user’s attribute value.
- boolean
When connecting to the server, connect using the ldap:// protocol then issue a StartTLS command. If unspecified, connections will use the ldaps:// protocol
Default:
false
- object
Required value
User search maps a username and password entered by a user to a LDAP entry. Details…
- object
Some providers return non-standard claims (eg. mail). Claim mappings are hints for Dex how to map claims to standard OIDC claims.
Dex can only map a non-standard claim to a standard one if it’s not included in the id_token returned by OIDC provider.
- boolean
If enabled, the claim mapping will override the standard OIDC claims.
By default, the claim mapping will be used only if the standard OIDC claims are not present, e.g., if there is no
email
claim in the id_token, theclaimMapping.email
will be used.Default:
false
- boolean
Enables basic authorization for the Kubernetes API server.
The username and password of the user from the application created in OIDC are used as credentials for basic authorization (you can enable it only if there is just one provider of the OIDC/Crowd type). Works only if the publishAPI parameter is enabled.
Authorization and group data obtained from an IdP are stored in the cache for 10 seconds.
- array of strings
List of additional scopes to request in token response.
Default:
["openid","profile","email","groups","offline_access"]
Deprecated resource. Support for the resource might be removed in a later release.
Defines the configuration for connecting a third-party provider.
With it, you can flexibly configure the integration of the account directory with Kubernetes.
- array of strings
A list of allowed Bitbucket Cloud teams (filter).
The user token will contain a set intersection of Bitbucket Cloud teams and teams from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain the user teams in the
groups
claim (similar to other providers).
- boolean
Enables basic authorization for the Kubernetes API server.
The username and password of the user from the application created in Crowd are used as credentials for basic authorization (you can enable it only if there is just one provider of the OIDC/Crowd type). Works only if the
publishAPI
is enabled.Authorization and group data obtained from an IdP are stored in the cache for 10 seconds.
- array of strings
A list of allowed Crowd groups (filter).
The user token will contain a set intersection of Crowd groups and groups from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain all Crowd groups if the parameter is not set.
- array of objects
Filter for user organizations. ID token will contain only organizations from this list. If the user is not in any organization from this list, an authorization will fail.
By default, all organizations allowed.
- array of strings
A list of allowed GitHub teams (filter).
The user token will contain a set intersection of teams from GitHub and teams from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain all GitHub teams if the parameter is not set.
- string
As an example, group claims for member of ‘Site Reliability Engineers’ in Acme organization would yield:
- [‘acme:Site Reliability Engineers’] for ‘name’
- [‘acme:site-reliability-engineers’] for ‘slug’
- [‘acme:Site Reliability Engineers’, ‘acme:site-reliability-engineers’] for ‘both’
‘name’ will be used by default.
Default:
"name"
Allowed values:
name
,slug
,both
- array of strings
A list (filter) of allowed GitLab groups (group paths and not names).
The user token will contain a set intersection of GitLab groups and groups from this list. If the set is empty, the authorization will be considered unsuccessful.
The user token will contain all GitLab groups if the parameter is not set;
- array of objects
Required value
Following list contains field pairs that are used to match a user to a group. It adds a requirement to the filter that an attribute in the group must match the user’s attribute value.
- boolean
When connecting to the server, connect using the ldap:// protocol then issue a StartTLS command. If unspecified, connections will use the ldaps:// protocol
Default:
false
- object
Required value
User search maps a username and password entered by a user to a LDAP entry. Details…
- object
Some providers return non-standard claims (eg. mail). Claim mappings are hints for Dex how to map claims to standard OIDC claims.
Dex can only map a non-standard claim to a standard one if it’s not included in the id_token returned by OIDC provider.
- boolean
If enabled, the claim mapping will override the standard OIDC claims.
By default, the claim mapping will be used only if the standard OIDC claims are not present, e.g., if there is no
email
claim in the id_token, theclaimMapping.email
will be used.Default:
false
- boolean
Enables basic authorization for the Kubernetes API server.
The username and password of the user from the application created in OIDC are used as credentials for basic authorization (you can enable it only if there is just one provider of the OIDC/Crowd type). Works only if the publishAPI parameter is enabled.
Authorization and group data obtained from an IdP are stored in the cache for 10 seconds.
- array of strings
List of additional scopes to request in token response.
Default:
["openid","profile","email","groups","offline_access"]
User
Scope: Cluster
Contains information about the static user.
- string
Required value
User email.
Caution! Note that if used together with the user-authz module, you must specify an
email
to grant rights to the specific user as the user name in the ClusterAuthorizationRule CR.Example:
email: user@domain.com
- array of strings
Static user groups.
Since the parameter has been deprecated, use the Group resource to add users to groups.
- string
Required value
User password hash in plaintext or Base64 encoded.
Use the following command to encode the password hash in Base64:
echo "<PASSWORD>" | htpasswd -BinC 10 "" | cut -d: -f2 | base64 -w0
. Alternatively, you can use an online service (such as https://bcrypt-generator.com/).Example:
password: JDJ5JDEwJE9HN1lOOUhnOXU5NmY2cGp4R3NIcS56NWQuOVQxQ0VrdWIud3BRdVJ5Sy5QQU5INlpKNDguCgo=
Deprecated resource. Support for the resource might be removed in a later release.
Contains information about the static user.
- string
Required value
User email.
Caution! Note that if used together with the user-authz module, you must specify an
email
to grant rights to the specific user as the user name in the ClusterAuthorizationRule CR.Example:
email: user@domain.com
- array of strings
Static user groups.
Since the parameter has been deprecated, use the Group resource to add users to groups.
- string
Required value
User password hash in plaintext or Base64 encoded.
Use the following command to encode the password hash in Base64:
echo "<PASSWORD>" | htpasswd -BinC 10 "" | cut -d: -f2 | base64 -w0
. Alternatively, you can use an online service (such as https://bcrypt-generator.com/).Example:
password: JDJ5JDEwJE9HN1lOOUhnOXU5NmY2cGp4R3NIcS56NWQuOVQxQ0VrdWIud3BRdVJ5Sy5QQU5INlpKNDguCgo=