Skip to content
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

website/integrations: vault: add external group documentation #11994

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mzhaase
Copy link

@mzhaase mzhaase commented Nov 11, 2024

Details

This PR changes the documentation page https://docs.goauthentik.io/integrations/services/hashicorp-vault/.
It adds more in-depth explanation on how to integrate authentik with hashicorp vault when wanting to use external groups.


@mzhaase mzhaase requested a review from a team as a code owner November 11, 2024 14:31
Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 37a5e34
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/67333efa94232800073bfc6b
😎 Deploy Preview https://deploy-preview-11994--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 11, 2024

Deploy Preview for authentik-storybook canceled.

Name Link
🔨 Latest commit 37a5e34
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/67333efa73d5b10008a4a70d

@@ -88,8 +88,64 @@ vault write auth/oidc/role/reader \
policies="reader"
```

## External Groups

If you wish to manage group membership in vault via Authentik you have to use [external groups](https://developer.hashicorp.com/vault/tutorials/auth-methods/oidc-auth#create-an-external-vault-group).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you wish to manage group membership in vault via Authentik you have to use [external groups](https://developer.hashicorp.com/vault/tutorials/auth-methods/oidc-auth#create-an-external-vault-group).
If you wish to manage group membership in Hashicorp Vault via Authentik you have to use [external groups](https://developer.hashicorp.com/vault/tutorials/auth-methods/oidc-auth#create-an-external-vault-group).

:::note
If you intend to create [external groups](https://developer.hashicorp.com/vault/tutorials/auth-methods/oidc-auth#create-an-external-vault-group) in Vault to manage user access the OIDC role will need to specifically request a custom scope using the `oidc_scopes` option when creating the OIDC role.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does one no longer need to use the oidc_scopes option at all?


### Step 1

In authentik, edit the oidc provider created above. Unser "Advanced protocol settings" add "authentik default OAuth Mapping: OpenID 'profile'". This includes the "groups" mapping.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In authentik, edit the oidc provider created above. Unser "Advanced protocol settings" add "authentik default OAuth Mapping: OpenID 'profile'". This includes the "groups" mapping.
In authentik, edit the OIDC provider created above. Unser **Advanced protocol settings** add `authentik default OAuth Mapping: OpenID 'profile'` This includes the groups mapping.


### Step 2

In hashicorp vault, change the reader role
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In hashicorp vault, change the reader role
In Vault, change the reader role to have the following settings:

oidc_scopes=[ "openid profile email" ]
```

Add a group
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add a group
Add a group.

Copy link

codecov bot commented Nov 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.56%. Comparing base (b2c9dff) to head (42f7e36).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11994      +/-   ##
==========================================
- Coverage   92.58%   92.56%   -0.02%     
==========================================
  Files         761      761              
  Lines       37822    37822              
==========================================
- Hits        35016    35009       -7     
- Misses       2806     2813       +7     
Flag Coverage Δ
e2e 49.15% <ø> (-0.06%) ⬇️
integration 24.91% <ø> (ø)
unit 90.15% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

type="external"
```

Get the canonical id of the group
Copy link
Contributor

@tanberry tanberry Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Get the canonical id of the group
Get the canonical ID of the group.

Copy link
Contributor

@tanberry tanberry Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the canonical ID, let's add this full name: vault_identity_group

vault list identity/group/id
```

Get the id of the oidc accessor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Get the id of the oidc accessor
Get the ID of the OIDC accessor.

```


Add a group alias, this maps the group to the oidc backend
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add a group alias, this maps the group to the oidc backend
Add a group alias; this alias maps the group to the OIDC backend.

canonical_id="group_id" \
name="group name in authentik"
```

You should then be able to sign in via OIDC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a period at end of this sentence, please?

Copy link
Contributor

@tanberry tanberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for adding this additional, important info! A couple of edits and suggestions, then let's git it merged! Thanks again.

@tanberry
Copy link
Contributor

You might need to run npm prettier or make website and then push again, @mzhaase ... the linter is failing on the build. ;-(

@rissson rissson changed the title Add external group documentation for vault website/integrations: vault: add external group documentation Nov 12, 2024
@mzhaase
Copy link
Author

mzhaase commented Nov 13, 2024

I implemented the changes in a new commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants