Terraform module to deploy tenant in Hashicorp Vault community version.
Go to file
Gitea-Actions 76a0481c22
All checks were successful
release / Bump version and create changelog with commitizen (push) Has been skipped
bump: version 0.1.0 → 0.2.0
2024-05-29 22:33:13 +00:00
.gitea/workflows feat: add first roles and approle auth method for tenant 2024-05-24 23:50:51 +02:00
examples feat: add outputs to module for policy names and role details 2024-05-25 00:32:21 +02:00
modules feat: add outputs to module for policy names and role details 2024-05-25 00:32:21 +02:00
policies feat: refactor module, simplify naming and create additional entities for extra roles 2024-05-26 22:14:00 +02:00
.cz.toml fix: adjust .cz.toml which uses wrong tagging convention and useless options 2024-05-28 22:56:43 +02:00
.pre-commit-config.yaml feat: add first roles and approle auth method for tenant 2024-05-24 23:50:51 +02:00
auth.tf feat: refactor module, simplify naming and create additional entities for extra roles 2024-05-26 22:14:00 +02:00
CHANGELOG.md bump: version 0.1.0 → 0.2.0 2024-05-29 22:33:13 +00:00
extra_policies.tf feat: pass extra roles as key value pairs, required the full policy as value 2024-05-29 20:22:24 +02:00
LICENSE Initial commit 2024-05-24 15:31:14 +00:00
main.tf feat: add version constraint to terraform providers 2024-05-25 00:33:58 +02:00
outputs.tf fix: some more old naming things 2024-05-26 22:25:55 +02:00
README.md fix: required_parameters type in root_policy_extra_rules 2024-05-30 00:12:41 +02:00
root.tf fix: required_parameters type in root_policy_extra_rules 2024-05-30 00:15:16 +02:00
variables.tf fix: required_parameters type in root_policy_extra_rules 2024-05-30 00:12:41 +02:00

terraform-vault-tenant

This module aims to provide a way for companies and individuals running the community version of vault, to segregate accesses between teams.

This "tenant" module requires that you have at least one approle auth method mounted prior to deploying it. It will create a tenant admin approle role on these mount, and apply the policy you define. It can also create an additional tenant-scoped approle auth mount, and create roles based on policies that you define.

The idea behind this is that outside of access control, a tenant is free to create whatever secret engine, secrets, etc... As long as those are prefixed with their tenant prefix.

Requirements

Name Version
terraform >= 1.0.0
random ~> 3.6.2
vault ~> 4.2.0

Providers

Name Version
random ~> 3.6.2
vault ~> 4.2.0

Modules

No modules.

Resources

Name Type
random_uuid.extra_secret_id resource
random_uuid.root_secret_id resource
vault_approle_auth_backend_role.extra resource
vault_approle_auth_backend_role.root resource
vault_approle_auth_backend_role_secret_id.extra resource
vault_approle_auth_backend_role_secret_id.root resource
vault_auth_backend.approle resource
vault_identity_entity.extra resource
vault_identity_entity.root resource
vault_identity_entity_alias.extra resource
vault_identity_entity_alias.root resource
vault_identity_group.this resource
vault_policy.extra resource
vault_policy.root resource
vault_policy_document.root data source

Inputs

Name Description Type Default Required
additional_roles A map of additional role names, with the path to the associated policy file to add for this tenant.
A separate approle auth method is created for this tenant (mounted at auth/-approle) including all the roles declared in this variable.
The variable should look like:
additional_roles = {
devs = file("path/to/policy.hcl")
admins = data.vault_policy_document.admins.hcl
}
map(string) {} no
name The name of the tenant you want to create string n/a yes
prefix The prefix to use for the tenant in vault (this will prefix mount points, policies, etc..) string n/a yes
root_policy_extra_rules A map of additional policies to attach to the root policy. These are merged with the default policies for the root role so that you can customize it to your needs
map(
object({
path = string
capabilities = list(string)
description = optional(string)
required_parameters = optional(list(string))
allowed_parameter = optional(map(list(any)))
denied_parameter = optional(map(list(any)))
min_wrapping_ttl = optional(number)
max_wrapping_ttl = optional(number)
})
)
{} no

Outputs

Name Description
approle_mount The approle mount for the tenant
extra_role_policies The tenant extra role policy names
extra_roles The tenant extra approle roles
root_policy The tenant root policy name
root_role The tenant root approle role