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

Part 5/n - Add jwt plugin #103

Merged
merged 174 commits into from
Feb 2, 2024
Merged

Part 5/n - Add jwt plugin #103

merged 174 commits into from
Feb 2, 2024

Conversation

cipherboy
Copy link
Member

This imports the JWT plugin as discussed in #64, bringing it in-tree with history.


This is part of #68, broken up to make review easier.

@naphelps When it comes time for merge, I'd suggest making this one a rebase merge if you can to preserve history. Thanks!

jefferai and others added 30 commits July 6, 2018 14:33
Improve context lifetime handling for OIDC provider
This PR adds OIDC support to the plugin as well as a CLI login helper that can be imported by Vault. It also adds for both OIDC/JWT:

* default role support (fixes openbao#6)
* the ability to copy claims into metadata, whether using OIDC or the existing JWT flow. (see discussion on openbao#14)

It removes the "group_delimiter" method of specifying claims, replacing it with [JSONPointer](https://tools.ietf.org/html/rfc6901).
- verify bound_claims in all paths
- verify bound_claims against /userinfo data
- verify bound_audiences in all paths
- review bound_audiences check when using static keys to conform to our docs
- more tests
Vault must not accept signed JWT tokens through /login path when role
has role_type oidc, since there might be a situation when the client
secret could be compromised, and thus the malicious might be able to
illegitimately get a token with the right aud claim, which Vault would
accept through the /login path.
dependabot bot and others added 22 commits May 25, 2023 11:30
Bumps [github.com/hashicorp/vault/api](https://github.com/hashicorp/vault) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/hashicorp/vault/releases)
- [Changelog](https://github.com/hashicorp/vault/blob/main/CHANGELOG.md)
- [Commits](hashicorp/vault@v1.9.0...v1.9.1)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/vault/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Update dependencies, changelog, go version.
Co-authored-by: hc-github-team-secure-vault-ecosystem <hc-github-team-secure-vault-ecosystem@users.noreply.github.com>
Co-authored-by: hc-github-team-secure-vault-ecosystem <hc-github-team-secure-vault-ecosystem@users.noreply.github.com>
* Support ADC for Google Workspace (dwd/no-dwd)

This commit adds support for authenticating to the Google
Workspace Directory API through [Application Default
Credentials](https://cloud.google.com/docs/authentication/application-default-credentials).
ADC is assumed if `ServiceAccount` is left empty.

Authentication can be performed through domain-wide delegation
of authority by impersonating a workspace user, or directly by
granting the service account the necessary admin roles.

See the
[docs](https://cloud.google.com/identity/docs/how-to/setup#auth-no-dwd)
for authenticating as a service account without domain-wide
delegation of authority.

This commit introduces a new config field,
`ImpersonatePrincipal`. This field is used as a target service
account to create a signed JWT for the Workspace user to
impersonate. This is useful in a scenario where you are doing
ADC with [External Account
Credentials](https://google.aip.dev/auth/4117) but still need
to impersonate a Workspace user through DWDoA. Since you don't
have access to the service account's private key, you need an
extra hop to the Service Account Credentials API to generate
the signed JWT.

* Update comments based on review
As described in hashicorp/vault#21949 endpoints with non-path parameters
that can be made use of during ReadOperation callbacks should have those
fields marked as `Query: true` to ensure the OpenAPI spec truly reflects
how the endpoints can be called.

This should also provide a proper fix to hashicorp/vault-client-go#155.

I'm also changing the operation ID to reflect that GET and POST on
`oidc/callback` are **not** at all the same operation with and without
parameters, but in fact play substantially different roles in the
overall OIDC login flow.
Co-authored-by: hc-github-team-secure-vault-ecosystem <hc-github-team-secure-vault-ecosystem@users.noreply.github.com>
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/v3/CHANGELOG.md)
- [Commits](go-jose/go-jose@v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hc-github-team-secure-vault-ecosystem <hc-github-team-secure-vault-ecosystem@users.noreply.github.com>
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.12.0 to 0.17.0.
- [Commits](golang/crypto@v0.12.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 24.0.5+incompatible to 24.0.7+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Commits](moby/moby@v24.0.5...v24.0.7)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* v0.18.0: adds changelog entry

* update fix text
* Support numeric claims

* Use the same code for both types due to limitation in Go compiler for switch-on-types

* Use json.Number to wrap the string representation of numbers

* Add tests for numeric bound_claims

* =Add changelog entry for the feature
Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
@naphelps naphelps self-requested a review February 2, 2024 20:11
…0caf49b0773851'

git-subtree-dir: builtin/credential/jwt
git-subtree-mainline: 40aecd9
git-subtree-split: 5aa957c
This moves the plugin to the built-in command directory naming format.

Cherry-pick of a59871f.

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
This switches all references to the JWT plugin to use the new internal
location for the plugin over the external, HashiCorp owned plugin.

Cherry-pick of e55805e.

Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
@cipherboy
Copy link
Member Author

@naphelps Updated :-)

@naphelps naphelps merged commit c6db068 into openbao:main Feb 2, 2024
2 of 9 checks passed
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.

None yet