An example of the module configuration | Пример конфигурации модуля |
The example shows the configuration of the ‘user-authn` module in the Deckhouse Kubernetes Platform. | В примере представлена конфигурация модуля |
yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: user-authn spec: version: 2 enabled: true settings: kubeconfigGenerator:
| yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: user-authn spec: version: 2 enabled: true settings: kubeconfigGenerator:
|
Configuring a provider | Примеры настройки провайдера |
GitHub | GitHub |
The example shows the provider’s settings for integration with GitHub. | В примере представлены настройки провайдера для интеграции с GitHub. |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: github spec: type: Github displayName: My Company Github github: clientID: plainstring clientSecret: plainstring | yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: github spec: type: Github displayName: My Company GitHub github: clientID: plainstring clientSecret: plainstring |
In your GitHub organization, create a new application: | В организации GitHub необходимо создать новое приложение. |
To do this, go to | Для этого выполните следующие шаги:
|
Paste the generated | Полученные |
If the GitHub organization is managed by the client, go to | Если организация GitHub находится под управлением клиента, перейдите в |
GitLab | GitLab |
The example shows the provider’s settings for integration with GitLab. | В примере представлены настройки провайдера для интеграции с GitLab. |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: gitlab spec: type: Gitlab displayName: Dedicated GitLab gitlab: baseURL: https://gitlab.example.com clientID: plainstring clientSecret: plainstring groups:
| yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: gitlab spec: type: Gitlab displayName: Dedicated GitLab gitlab: baseURL: https://gitlab.example.com clientID: plainstring clientSecret: plainstring groups:
|
Create a new application in the GitLab project. | В GitLab проекта необходимо создать новое приложение. |
To do this, you need to:
| Для этого выполните следующие шаги:
|
Paste the generated | Полученные |
Atlassian Crowd | Atlassian Crowd |
The example shows the provider’s settings for integration with Atlassian Crowd. | В примере представлены настройки провайдера для интеграции с Atlassian Crowd. |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: crowd spec: type: Crowd displayName: Crowd crowd: baseURL: https://crowd.example.com/crowd clientID: plainstring clientSecret: plainstring enableBasicAuth: true groups:
| yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: crowd spec: type: Crowd displayName: Crowd crowd: baseURL: https://crowd.example.com/crowd clientID: plainstring clientSecret: plainstring enableBasicAuth: true groups:
|
Create a new | В соответствующем проекте Atlassian Crowd необходимо создать новое |
To do this, go to | Для этого выполните следующие шаги:
|
Paste the generated | Полученные |
CROWD groups are specified in the lowercase format for the custom resource | Группы CROWD укажите в lowercase-формате для Custom Resource |
Bitbucket Cloud | Bitbucket Cloud |
The example shows the provider’s settings for integration with Bitbucket Cloud. | В примере представлены настройки провайдера для интеграции с Bitbucket. |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: bitbucket spec: type: BitbucketCloud displayName: Bitbucket bitbucketCloud: clientID: plainstring clientSecret: plainstring includeTeamGroups: true teams:
| yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: gitlab spec: type: BitbucketCloud displayName: Bitbucket bitbucketCloud: clientID: plainstring clientSecret: plainstring includeTeamGroups: true teams:
|
Create a new OAuth consumer in the Bitbucket’s team menu. | Для настройки аутентификации необходимо в Bitbucket в меню команды создать нового OAuth consumer. |
To do this, go to | Для этого выполните следующие шаги:
|
Paste the generated | Полученные |
OIDC (OpenID Connect) | OIDC (OpenID Connect) |
Authentication through the OIDC provider requires registering a client (or “creating an application”). Please refer to the provider’s documentation on how to do it (e.g., Okta, Keycloak, Gluu). | Аутентификация через OIDC-провайдера требует регистрации клиента (или создания приложения). Сделайте это по документации вашего провайдера (например, Okta, Keycloak, Gluu или Blitz). |
Paste the generated | Полученные в ходе выполнения инструкции |
Keycloak | Ниже можно ознакомиться с некоторыми примерами. |
After selecting a | Keycloak |
| После выбора |
The example shows the provider’s settings for integration with Keycloak. |
|
yaml
apiVersion: deckhouse.io/v1
kind: DexProvider
metadata:
name: keycloak
spec:
type: OIDC
displayName: My Company Keycloak
oidc:
issuer: https://keycloak.my-company.com/realms/myrealm # Use the name of your realm
clientID: plainstring
clientSecret: plainstring
insecureSkipEmailVerified: true
| В примере представлены настройки провайдера для интеграции с Keycloak: |
When using Keycloak as an Identity Provider, remove the | yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: keycloak spec: type: OIDC displayName: My Company Keycloak oidc: issuer: https://keycloak.my-company.com/realms/myrealm # Используйте имя вашего realm clientID: plainstring clientSecret: plainstring insecureSkipEmailVerified: true getUserInfo: true scopes:
|
Okta | При использовании Keycloak, как Identity Provider во вкладке Client scopes удалите маппинг |
The example shows the provider’s settings for integration with Okta. | Okta |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: okta spec: type: OIDC displayName: My Company Okta oidc: issuer: https://my-company.okta.com clientID: plainstring clientSecret: plainstring insecureSkipEmailVerified: true getUserInfo: true | В примере представлены настройки провайдера для интеграции с Okta: |
Blitz Identity Provider | yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: okta spec: type: OIDC displayName: My Company Okta oidc: issuer: https://my-company.okta.com clientID: plainstring clientSecret: plainstring insecureSkipEmailVerified: true getUserInfo: true |
Note that you must specify a URL to redirect the user after authorization when registering the application with the Blitz Identity Provider. When using | Blitz Identity Provider |
The example below shows the provider settings for integration with Blitz Identity Provider. | На стороне провайдера Blitz Identity Provider при регистрации приложения необходимо указать URL для перенаправления пользователя после авторизации. При использовании |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: blitz spec: displayName: Blitz Identity Provider oidc: basicAuthUnsupported: false claimMapping: email: email groups: your_claim # Claim for getting user groups, configured on the Blitz clientID: clientID clientSecret: clientSecret getUserInfo: true insecureSkipEmailVerified: true # Set to true if there is no need to verify the user’s email insecureSkipVerify: false issuer: https://yourdomain.idblitz.ru/blitz promptType: consent scopes:
| В примере представлены настройки провайдера для интеграции с Blitz Identity Provider: |
For the application logout to work correctly (the token being revoked so that re-authorization is required), set | yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: blitz spec: displayName: Blitz Identity Provider oidc: basicAuthUnsupported: false claimMapping: email: email groups: your_claim # Claim для получения групп пользователя, группы пользователя настраиваются на стороне провайдера Blitz Identity Provider clientID: clientID clientSecret: clientSecret getUserInfo: true insecureSkipEmailVerified: true # Установить true, если нет необходимости в проверке email пользователя insecureSkipVerify: false issuer: https://yourdomain.idblitz.ru/blitz promptType: consent scopes:
|
To ensure granular user access to applications, you have to: | Чтобы корректно отрабатывал выход из приложений (происходил отзыв токена и требовалась повторная авторизация), нужно установить |
| Для обеспечения гранулированного доступа пользователя к приложениям необходимо: |
Below is an example for prometheus: |
|
yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: prometheus spec: version: 2 settings: auth: allowedUserGroups:
| Пример для Prometheus: |
LDAP | yaml apiVersion: deckhouse.io/v1alpha1 kind: ModuleConfig metadata: name: prometheus spec: version: 2 settings: auth: allowedUserGroups:
|
The example shows the provider’s settings for integration with Active Directory. | LDAP |
yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: active-directory spec: type: LDAP displayName: Active Directory ldap: host: ad.example.com:636 insecureSkipVerify: true | В примере представлены настройки провайдера для интеграции с Active Directory: |
bindDN: cn=Administrator,cn=users,dc=example,dc=com bindPW: admin0! | yaml apiVersion: deckhouse.io/v1 kind: DexProvider metadata: name: active-directory spec: type: LDAP displayName: Active Directory ldap: host: ad.example.com:636 insecureSkipVerify: true |
usernamePrompt: Email Address | bindDN: cn=Administrator,cn=users,dc=example,dc=com bindPW: admin0! |
userSearch: baseDN: cn=Users,dc=example,dc=com filter: “(objectClass=person)” username: userPrincipalName idAttr: DN emailAttr: userPrincipalName nameAttr: cn | usernamePrompt: Email Address |
groupSearch: baseDN: cn=Users,dc=example,dc=com filter: “(objectClass=group)” userMatchers:
| userSearch: baseDN: cn=Users,dc=example,dc=com filter: “(objectClass=person)” username: userPrincipalName idAttr: DN emailAttr: userPrincipalName nameAttr: cn |
To configure authentication, create a read-only user (service account) in LDAP. | groupSearch: baseDN: cn=Users,dc=example,dc=com filter: “(objectClass=group)” userMatchers:
|
Specify the generated user path and password in the
| Для настройки аутентификации заведите в LDAP read-only-пользователя (service account). |
Configuring the OAuth2 client in Dex for connecting an application | Полученные путь до пользователя и пароль укажите в параметрах
|
This configuration is suitable for applications that can independently perform oauth2 authentication without using an oauth2 proxy.
The | Настройка OAuth2-клиента в Dex для подключения приложения |
Этот вариант настройки подходит приложениям, которые имеют возможность использовать OAuth2-аутентификацию самостоятельно, без помощи | |
yaml apiVersion: deckhouse.io/v1 kind: DexClient metadata: name: myname namespace: mynamespace spec: redirectURIs:
| |
yaml apiVersion: deckhouse.io/v1 kind: DexClient metadata: name: myname namespace: mynamespace spec: redirectURIs:
| |
After the | |
The client access password (clientSecret) will be stored in the secret object: | После создания такого ресурса в Dex будет зарегистрирован клиент с идентификатором (clientID) |
yaml apiVersion: v1 kind: Secret metadata: name: dex-client-myname namespace: mynamespace type: Opaque data: clientSecret: c2VjcmV0 | Пароль доступа к клиенту (clientSecret) сохранится в секрете: |
yaml apiVersion: v1 kind: Secret metadata: name: dex-client-myname namespace: mynamespace type: Opaque data: clientSecret: c2VjcmV0 | |
An example of creating a static user | |
Create a password and enter its hash in the | Пример создания статического пользователя |
Use the command below to calculate the password hash: | Придумайте пароль и укажите его хэш-сумму в поле |
shell echo “$password” | htpasswd -BinC 10 “” | cut -d: -f2 | base64 -w0 | Для вычисления хэш-суммы пароля воспользуйтесь командой: |
If the | shell echo “$password” | htpasswd -BinC 10 “” | cut -d: -f2 | base64 -w0 |
| Если команда |
Alternatively, you can use the online service to calculate the password hash. |
|
Note that in the below example the | Также можно воспользоваться онлайн-сервисом. |
Обратите внимание, что в приведенном примере указан | |
yaml apiVersion: deckhouse.io/v1 kind: User metadata: name: admin spec: email: admin@yourcompany.com password: $2a$10$etblbZ9yfZaKgbvysf1qguW3WULdMnxwWFrkoKpRH1yeWa5etjjAa ttl: 24h | |
yaml apiVersion: deckhouse.io/v1 kind: User metadata: name: admin spec: email: admin@yourcompany.com password: $2a$10$etblbZ9yfZaKgbvysf1qguW3WULdMnxwWFrkoKpRH1yeWa5etjjAa ttl: 24h | |
Example of adding a static user to a group | |
Пример добавления статического пользователя в группу | |
yaml apiVersion: deckhouse.io/v1alpha1 kind: Group metadata: name: admins spec: name: admins members:
| |
yaml apiVersion: deckhouse.io/v1alpha1 kind: Group metadata: name: admins spec: name: admins members:
| |
How to set permissions for a user or group | |
Parameters in the custom resource | Выдача прав пользователю или группе |
Для настройки используются параметры в Custom Resource |