generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 58
RHIDP-7612 Added _Enablig user provisioning with LDAP_ #1268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+396
−0
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
001f944
RHIDP-7612 Added _Enablig user provisioning with LDAP_
themr0c bd46ec3
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 99e054c
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 4c306f2
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 392aa28
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 8692290
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 41dd1fb
Merge branch 'main' into RHIDP-7612
themr0c 66b9dfe
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 962afaf
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c 253bf93
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c e5eceab
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c cf302e1
Update modules/authentication/proc-enabling-user-provisioning-with-ld…
themr0c File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
372 changes: 372 additions & 0 deletions
372
modules/authentication/proc-enabling-user-provisioning-with-ldap.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,372 @@ | ||
| :_mod-docs-content-type: PROCEDURE | ||
|
|
||
| [id="enabling-user-provisioning-with-ldap"] | ||
| = Enabling user provisioning with LDAP | ||
|
|
||
| When your authentication provider depends on Lightweight Directory Access Protocol (LDAP) to resolve user and grop identitites, provision users and groups from LDAP to the {product} software catalog, rather than using the provisioning mechanism from your authentication provider. | ||
|
|
||
| .Prerequisites | ||
| * You link:{configuring-book-url}[added a custom {product-short} application configuration], and have sufficient permissions to modify it. | ||
|
|
||
| * You have configured xref:assembly-authenticating-with-rhbk[authentication with {rhbk-brand-name} ({rhbk})]. | ||
|
|
||
| * You have collected the required LDAP credentials: | ||
|
|
||
| LDAP URL:: | ||
themr0c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Your LDAP server URL, such as `ldaps://ds.example.net`. | ||
|
|
||
| Bind dn:: | ||
| Your bind distinguished name, such as `cn=admin,OU=Users,DC=rhdh,DC=test` | ||
|
|
||
| LDAP secret:: | ||
| Your LDAP secret. | ||
|
|
||
| Recommended: LDAP certificates and keys:: | ||
| Your LDAP certificates and keys, when using a secure LDAP connexion (`ldaps://`). | ||
|
|
||
|
|
||
| .Procedure | ||
| . Enter your LDAP credentials to {product-short}, by adding the following key/value pairs to link:{configuring-dynamic-plugins-book-url}#provisioning-your-custom-configuration[your {product-short} secrets]. | ||
| You can use these secrets in the {product-short} configuration files by using their respective environment variable name. | ||
|
|
||
| `LDAP_SECRET`:: | ||
| Enter your LDAP secret. | ||
|
|
||
| . Recommended: To use a secure LDAP connection (`ldaps://`), add your LDAP certificates and keys files to link:{configuring-dynamic-plugins-book-url}#provisioning-your-custom-configuration[your {product-short} secrets]. | ||
|
|
||
| `ldap_certs`:: | ||
|
|
||
| `ldap_keys`:: | ||
|
|
||
| . Enable the LDAP organization provisioning plugin (`backstage-plugin-catalog-backend-module-ldap`). | ||
| This plugin ingests LDAP users and groups to the {product-short} software catalog. | ||
| + | ||
| .`dynamic-plugins.yaml` file fragment | ||
| [source,yaml] | ||
| ---- | ||
| plugins: | ||
| - package: './dynamic-plugins/dist/backstage-plugin-catalog-backend-module-ldap' | ||
themr0c marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| disabled: false | ||
| ---- | ||
|
|
||
| . Enable provisioning GitHub users and groups to the {product-short} software catalog, by adding the LDAP catalog provider section to your `{my-app-config-file}` file: | ||
|
|
||
| .. Optional: Remove other catalog providers, by removing the other catalog providers section. | ||
|
|
||
| .. Enter the mandatory fields: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| catalog: | ||
| providers: | ||
| ldapOrg: | ||
| default: | ||
| target: ldaps://ds.example.net | ||
| bind: | ||
| dn: cn=admin,ou=Users,dc=rhdh | ||
| secret: ${LDAP_SECRET} | ||
| users: | ||
| - dn: OU=Users,OU=RHDH Local,DC=rhdh,DC=test | ||
| options: | ||
| filter: (uid=*) | ||
| groups: | ||
| - dn: OU=Groups,OU=RHDH Local,DC=rhdh,DC=test | ||
| schedule: | ||
| frequency: PT1H | ||
| timeout: PT15M | ||
| ---- | ||
|
|
||
| `target`:: | ||
| Enter your LDAP server URL, such as `ldaps://ds.example.net`. | ||
|
|
||
| `bind`:: | ||
| Enter your service account informations: | ||
|
|
||
| `dn`::: | ||
| Enter your service account distinguished name (DN), such as `cn=admin,OU=Users,DC=rhdh,DC=test` | ||
|
|
||
| `secret`::: | ||
| Enter the name of the variable containing your LDAP secret: `${LDAP_SECRET}`. | ||
|
|
||
| `users`:: | ||
| Enter information about how to find your users: | ||
|
|
||
| `dn`::: | ||
| Enter the DN containing the user information. | ||
|
|
||
| `options`::: | ||
|
|
||
| `filter`:::: | ||
| Enter your filter, such as `(uid=*)` to provision to the {product-very-short} software catalog only users with a valid `uid`. | ||
themr0c marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| `groups`:: | ||
| Enter information about how to find your groups: | ||
|
|
||
| `dn`::: | ||
| Enter the DN containing the group information. | ||
|
|
||
| `schedule`:: | ||
| Enter your schedule information: | ||
|
|
||
| `frequency`::: | ||
| Enter your schedule frequency, in the cron, ISO duration, or "human duration" format. | ||
themr0c marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| `timeout`::: | ||
| Enter your schedule timeout, in the ISO duration or "human duration" format. | ||
|
|
||
| `initialDelay`::: | ||
| Enter your schedule initial delay, in the ISO duration or "human duration" format. | ||
|
|
||
| .. Optional: To change how {product-short} maps LDAP user fields to the software catalog, enter optional `maps` and `set` fields. | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| catalog: | ||
| providers: | ||
| ldapOrg: | ||
| default: | ||
| target: ldaps://ds.example.net | ||
| bind: | ||
| dn: cn=admin,ou=Users,dc=rhdh | ||
| secret: ${LDAP_SECRET} | ||
| users: | ||
| - dn: OU=Users,OU=RHDH Local,DC=rhdh,DC=test | ||
| options: | ||
| filter: (uid=*) | ||
| map: | ||
| rdn: uid | ||
| name: uid | ||
| description: {} | ||
| displayName: cn | ||
| email: mail | ||
| picture: {} | ||
| memberOf: memberOf | ||
| set: | ||
| metadata.customField: 'hello' | ||
| groups: | ||
| - dn: OU=Groups,OU=RHDH Local,DC=rhdh,DC=test | ||
| schedule: | ||
| frequency: PT1H | ||
| timeout: PT15M | ||
| ---- | ||
|
|
||
| `rdn`:: | ||
| To change the default value: `uid`, enter the relative distinguished name of each entry. | ||
|
|
||
| `name`:: | ||
| To change the default value: `uid`, enter the LDAP field to map to the {product-very-short} `metadata.name` field. | ||
|
|
||
| `description`:: | ||
| To set a value, enter the LDAP field to map to the {product-very-short} `metadata.description` field. | ||
|
|
||
| `displayName`:: | ||
| To change the default value: `cn`, enter the LDAP field to map to the {product-very-short} `metadata.displayName` field. | ||
|
|
||
| `email`:: | ||
| To change the default value: `mail`, enter the LDAP field to map to the {product-very-short} `spec.profile.email` field. | ||
|
|
||
| `picture`:: | ||
| To set a value, enter the LDAP field to map to the {product-very-short} `spec.profile.picture` field. | ||
|
|
||
| `memberOf`:: | ||
| To change the default value: `memberOf`, enter the LDAP field to map to the {product-very-short} `spec.memberOf` field. | ||
|
|
||
| `set`:: | ||
| To set a value, enter the hard coded JSON to apply to the entities after ingestion, such as `metadata.customField: 'hello'`. | ||
|
|
||
| .. Optional: To change how {product-short} maps LDAP group fields to the software catalog, enter optional `groups.maps` fields. | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| catalog: | ||
| providers: | ||
| ldapOrg: | ||
| default: | ||
| target: ldaps://ds.example.net | ||
| bind: | ||
| dn: cn=admin,ou=Users,dc=rhdh | ||
| secret: ${LDAP_SECRET} | ||
| users: | ||
| - dn: OU=Users,OU=RHDH Local,DC=rhdh,DC=test | ||
| options: | ||
| filter: (uid=*) | ||
| groups: | ||
| - dn: OU=Groups,OU=RHDH Local,DC=rhdh,DC=test | ||
| map: | ||
| rdn: uid | ||
| name: uid | ||
| description: {} | ||
| displayName: cn | ||
| email: mail | ||
| picture: {} | ||
| memberOf: memberOf | ||
| members: member | ||
| type: groupType | ||
| set: | ||
| metadata.customField: 'hello' | ||
| schedule: | ||
| frequency: PT1H | ||
| timeout: PT15M | ||
| ---- | ||
|
|
||
| `rdn`:: | ||
| To change the default value: `cn`, enter the relative distinguished name of each entry. | ||
|
|
||
| `name`:: | ||
| To change the default value: `cn`, enter the LDAP field to map to the {product-very-short} `metadata.name` field. | ||
|
|
||
| `description`:: | ||
| To set a value, enter the LDAP field to map to the {product-very-short} `metadata.description` field. | ||
|
|
||
| `displayName`:: | ||
| To change the default value: `cn`, enter the LDAP field to map to the {product-very-short} `metadata.displayName` field. | ||
|
|
||
| `email`:: | ||
| To change the default value: `mail`, enter the LDAP field to map to the {product-very-short} `spec.profile.email` field. | ||
|
|
||
| `picture`:: | ||
| To set a value, enter the LDAP field to map to the {product-very-short} `spec.profile.picture` field. | ||
|
|
||
| `memberOf`:: | ||
| To change the default value: `memberOf`, enter the LDAP field to map to the {product-very-short} `spec.memberOf` field. | ||
|
|
||
| `members`:: | ||
| To change the default value: `member`, enter the LDAP field to map to the {product-very-short} `spec.children` field. | ||
|
|
||
| `type`:: | ||
| To change the default value: `groupType`, enter the LDAP field to map to the {product-very-short} `spec.type` field. | ||
|
|
||
| `set`:: | ||
| To set a value, enter the hard coded JSON to apply to the entities after ingestion, such as `metadata.customField: 'hello'`. | ||
|
|
||
| .. Recommended: To use a secure LDAP connection (`ldaps://`), enter optional `tls` fields. | ||
| + | ||
| .Optional `tls` fields | ||
| [source,yaml] | ||
| ---- | ||
| catalog: | ||
| providers: | ||
| ldapOrg: | ||
| default: | ||
| target: ldaps://ds.example.net | ||
| bind: | ||
| dn: cn=admin,ou=Users,dc=rhdh | ||
| secret: ${LDAP_SECRET} | ||
| users: | ||
| ldapOrg: | ||
| default: | ||
| tls: | ||
| rejectUnauthorized: true | ||
| keys: '/path/to/keys.pem' | ||
| certs: '/path/to/certs.pem' | ||
| ---- | ||
|
|
||
| `rejectUnauthorized`:: | ||
| Set to `false` to allow self-signed certificates | ||
| + | ||
| [WARNING] | ||
| ==== | ||
| This option is not recommended for production. | ||
| ==== | ||
|
|
||
| `keys`:: | ||
| Enter a file containing private keys in PEM format | ||
|
|
||
| `certs`:: | ||
| Enter a file containing cert chains in PEM format | ||
|
|
||
| .. Optional: Enter configuration for vendor-specific attributes to set custom attribute names for distinguished names (DN) and universally unique identifiers (UUID) in LDAP directories. | ||
| Default values are defined per supported vendor and automatically detected. | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| catalog: | ||
| providers: | ||
| ldapOrg: | ||
| default: | ||
| vendor: | ||
| dnAttributeName: customDN | ||
| uuidAttributeName: customUUID | ||
| ---- | ||
|
|
||
| `dnAttributeName`:: | ||
| Enter the attribute name that holds the distinguished name (DN) for an entry. | ||
|
|
||
| `uuidAttributeName`:: | ||
| Enter the attribute name that holds a universal unique identifier (UUID) for an entry. | ||
|
|
||
| .. Optional: Enter low level users and groups configuration in the `options` subsection. | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| catalog: | ||
| providers: | ||
| ldapOrg: | ||
| default: | ||
| target: ldaps://ds.example.net | ||
| bind: | ||
| dn: cn=admin,ou=Users,dc=rhdh | ||
| secret: ${LDAP_SECRET} | ||
| users: | ||
| options: | ||
| scope: sub | ||
| filter: (uid=*) | ||
| attributes: | ||
| - cn | ||
| - uid | ||
| - description | ||
| paged: | ||
| pageSize: 500 | ||
| groups: | ||
| options: | ||
| scope: sub | ||
| filter: (cn=*) | ||
| attributes: | ||
| - cn | ||
| - uid | ||
| - description | ||
| paged: | ||
| pageSize: 500 | ||
| pagePause: true | ||
| ---- | ||
|
|
||
| `scope`:: | ||
| To change the default value: `one`, enter how deep the search should go within the directory tree: | ||
| * `base` to search only the base DN. | ||
| * `one` to search one level below the base DN. | ||
| * `sub` to search all descendant entries. | ||
|
|
||
| `filter`:: | ||
| To change the default value: `(objectclass=*)`, enter your LDAP filter. | ||
| With the default mapping: | ||
| * For users, enter `(uid=*)` to make sure only users with valid uid field is synced, since users without uid will cause error and ingestion fails. | ||
| * For groups, enter `(cn=*)` | ||
| + | ||
| [TIP] | ||
| ==== | ||
| When you change the mapping, also update the filter. | ||
| ==== | ||
|
|
||
| `attributes`:: | ||
| To change the default value: all attributes `['*', '+']`, enter the array of attribute names to import from LDAP. | ||
|
|
||
| `paged`:: | ||
| Enter a value to enable paged results. | ||
|
|
||
| `pageSize`::: | ||
| Enter a value to set the results page size, such as `500`. | ||
|
|
||
| `pagePause`::: | ||
| Enter `true` to tell the client to wait for the asynchronous results of the next page, | ||
| when the page limit has been reached. | ||
|
|
||
|
|
||
| .Verification | ||
| * To verify user and group provisioning, check the console logs. | ||
| + | ||
| Successful synchronization example: | ||
| + | ||
| [source,json] | ||
| ---- | ||
|
|
||
themr0c marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ---- | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.