You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,7 +67,7 @@ The module requires you to configure what repositories to bind to Vault roles an
65
67
conditions the respective repository should be granted access.
66
68
This is encapsulated by the `oidc_bindings` variable.
67
69
68
-
| :exclamation: Note: This module uses the experimental Terraform feature [`module_variable_optional_attrs`](https://www.terraform.io/language/expressions/type-constraints#experimental-optional-object-type-attributes). |
70
+
| :exclamation: Note: This module uses the experimental Terraform feature [`module_variable_optional_attrs`](https://www.terraform.io/language/expressions/type-constraints#experimental-optional-object-type-attributes) first introduced in v0.14. |
69
71
|---|
70
72
71
73
You will need to opt-in to this experiment in your `terraform` block:
@@ -260,6 +262,18 @@ Do **not** include a leading `/` in the variable content.
260
262
At this time, this module expects to create and manage the JWT backend leveraged for GitHub OIDC auth.
261
263
You cannot pass in a Terraform reference to an existing backend.
262
264
265
+
### github_identity_provider
266
+
267
+
**Optional**
268
+
269
+
By default, this role will communicate with github.com for an OIDC JWT (`https://token.actions.githubusercontent.com`).
270
+
If you run GitHub Enterprise Server, you will need to configure your instance of GitHub as the identity provider and should modify this variable.
271
+
This requires GitHub Enterprise Server version 3.5 or higher.
272
+
273
+
The format is: `https://HOSTNAME/_services/token`.
274
+
275
+
See <https://docs.github.com/en/enterprise-server@latest/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-hashicorp-vault#adding-the-identity-provider-to-hashicorp-vault>.
276
+
263
277
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
264
278
## Requirements
265
279
@@ -292,6 +306,7 @@ No modules.
292
306
| <a name="input_oidc_bindings"></a> [oidc\_bindings](#input\_oidc\_bindings) | A list of OIDC JWT bindings between GitHub repos and Vault roles. For each entry, you must include:<br><br> `audience`: By default, this must be the URL of the repository owner (e.g. `https://github.com/digitalocean`). This can be customized with the `jwtGithubAudience` parameter in [hashicorp/vault-action](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-hashicorp-vault#requesting-the-access-token) . This is the bound audience (`aud`) field from [GitHub's OIDC token](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-token) .<br><br> `vault_role_name`: The name of the Vault role to generate under the OIDC auth backend.<br><br> `bound_subject`: This is what is set in the `sub` field from [GitHub's OIDC token](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-token) . The bound subject can be constructed from various filters, such as a branch, tag, or specific [environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment) . See [GitHub's documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#example-subject-claims) for examples.<br><br> `vault_policies`: A list of Vault policies you wish to grant to the generated token.<br><br> `user_claim`: **Optional**. This is how you want Vault to [uniquely identify](https://www.vaultproject.io/api/auth/jwt#user_claim) this client. This will be used as the name for the Identity entity alias created due to a successful login. This must be a field present in the [GitHub JWT token](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-token) . Defaults to the `default_user_claim` variable if not provided. Consider the impact on [reusable workflows](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/using-openid-connect-with-reusable-workflows#how-the-token-works-with-reusable-workflows) if you are thinking of changing this value from the default.<br><br> `additional_claims`: **Optional**. Any additional `bound_claims` to configure for this role. Claim keys must match a value in [GitHub's OIDC token](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-token) . Do not use this field for the `sub` claim. Use the `bound_subject` parameter instead.<br><br> `ttl`: **Optional**. The default incremental time-to-live for the generated token, in seconds. Defaults to the `default_ttl` value but can be individually specified per binding with this value. | <pre>list(object({<br> audience = string,<br> vault_role_name = string,<br> bound_subject = string,<br> vault_policies = set(string),<br> user_claim = optional(string),<br> additional_claims = optional(map(string)),<br> ttl = optional(number),<br> }))</pre> | n/a | yes |
293
307
| <a name="input_default_ttl"></a> [default\_ttl](#input\_default\_ttl) | The default incremental time-to-live for generated tokens, in seconds. | `number` | `60` | no |
294
308
| <a name="input_default_user_claim"></a> [default\_user\_claim](#input\_default\_user\_claim) | This is how you want Vault to [uniquely identify](https://www.vaultproject.io/api/auth/jwt#user_claim) this client. This will be used as the name for the Identity entity alias created due to a successful login. This must be a field present in the [GitHub OIDC token](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#understanding-the-oidc-token) . Consider the impact on [reusable workflows](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/using-openid-connect-with-reusable-workflows#how-the-token-works-with-reusable-workflows) if you are thinking of changing this value from the default. | `string` | `"job_workflow_ref"` | no |
309
+
| <a name="input_github_identity_provider"></a> [github\_identity\_provider](#input\_github\_identity\_provider) | The JWT authentication URL used for the GitHub OIDC trust configuration. This should not be modified unless you are running GitHub Enterprise Server, in which case you should provide a URL in the format: `https://HOSTNAME/_services/token`. This requires GitHub Enterprise Server version 3.5 or higher. See <https://docs.github.com/en/enterprise-server@latest/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-hashicorp-vault#adding-the-identity-provider-to-hashicorp-vault>. | `string` | `"https://token.actions.githubusercontent.com"` | no |
295
310
| <a name="input_oidc_auth_backend_path"></a> [oidc\_auth\_backend\_path](#input\_oidc\_auth\_backend\_path) | The path to mount the OIDC auth backend. | `string` | `"github-actions"` | no |
Example configuration in this directory binds multiple Vault roles to one GitHub repository with GitHub OIDC.
4
+
When using GitHub Enterprise Server, configure this module as normal and update the `github_identity_provider` variable [as applicable](https://github.com/digitalocean/terraform-vault-github-oidc#github_identity_provider) for your GitHub server.
5
+
6
+
# Usage
7
+
8
+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
| <aname="input_vault_address"></a> [vault\_address](#input\_vault\_address)| The origin URL of the Vault server. This is a URL with a scheme, a hostname, and a port but with no path. |`string`| n/a | yes |
41
+
42
+
## Outputs
43
+
44
+
| Name | Description |
45
+
|------|-------------|
46
+
| <aname="output_auth_backend_accessor"></a> [auth\_backend\_accessor](#output\_auth\_backend\_accessor)| The generated accessor ID for the auth backend. Outputting as demonstration of using a data source with the module. |
47
+
| <aname="output_backend"></a> [backend](#output\_backend)| Exposing the auth backend path as an example. |
48
+
| <aname="output_roles"></a> [roles](#output\_roles)| The list of Vault role names created by the module. This is a reflection of the `vault_role_name` value of each input item in `oidc-bindings`. |
description="The list of Vault role names created by the module. This is a reflection of the `vault_role_name` value of each input item in `oidc-bindings`."
0 commit comments