Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5567bd6dac |
@@ -22,12 +22,3 @@ repos:
|
||||
"-d {extends: relaxed, rules: {line-length: disable}, ignore: chart}",
|
||||
"-s",
|
||||
]
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: vault-yaml-tests
|
||||
name: vault yaml definitions pass their unit tests
|
||||
entry: python3 -m unittest discover -s tests -t .
|
||||
language: python
|
||||
additional_dependencies: [pyyaml, pydantic]
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
|
||||
@@ -4,7 +4,7 @@ when:
|
||||
|
||||
steps:
|
||||
- name: apply
|
||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/opentofu:0.1.0
|
||||
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
|
||||
environment:
|
||||
VAULT_AUTH_METHOD: kubernetes
|
||||
VAULT_VERSION: "1.20.0"
|
||||
|
||||
@@ -3,7 +3,7 @@ when:
|
||||
|
||||
steps:
|
||||
- name: plan
|
||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/opentofu:0.1.0
|
||||
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
|
||||
environment:
|
||||
VAULT_AUTH_METHOD: kubernetes
|
||||
VAULT_VERSION: "1.20.0"
|
||||
|
||||
@@ -3,7 +3,7 @@ when:
|
||||
|
||||
steps:
|
||||
- name: pre-commit
|
||||
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/opentofu:0.1.0
|
||||
image: git.unkin.net/unkin/almalinux9-opentofu:20260606
|
||||
commands:
|
||||
- uvx pre-commit run --all-files
|
||||
backend_options:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.PHONY: init plan apply format test
|
||||
.PHONY: init plan apply format
|
||||
|
||||
VAULT_AUTH_METHOD ?= approle
|
||||
VAULT_K8S_ROLE ?= woodpecker_terraform_vault
|
||||
@@ -22,15 +22,12 @@ init:
|
||||
|
||||
plan: init
|
||||
@$(call vault_env) && \
|
||||
terragrunt run --all --parallelism 4 --non-interactive plan -- -lock=false
|
||||
terragrunt run --all --parallelism 4 --non-interactive plan
|
||||
|
||||
apply: init
|
||||
@$(call vault_env) && \
|
||||
terragrunt run --all --parallelism 2 --non-interactive apply
|
||||
|
||||
test:
|
||||
@uv run --with pyyaml --with pydantic python -m unittest discover -s tests -t .
|
||||
|
||||
format:
|
||||
@echo "Formatting OpenTofu files..."
|
||||
@tofu fmt -recursive .
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
# Mints an arrproxy API key scoped to all three arr apps.
|
||||
apps:
|
||||
- prowlarr
|
||||
- radarr
|
||||
- sonarr
|
||||
ttl: 60 # seconds (1m); short-lived by design, renewed on demand
|
||||
- radarr
|
||||
- prowlarr
|
||||
ttl: 3600 # seconds (1h)
|
||||
max_ttl: 86400 # seconds (24h); the engine additionally caps renewal at the
|
||||
# arrproxy admin token's fixed mint expiry.
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
---
|
||||
# Mints an arrproxy API key for the mediamark kids-content marking UI, scoped to
|
||||
# Sonarr and Radarr only (no Prowlarr: mediamark never touches indexers).
|
||||
#
|
||||
# mediamark only lists series/movies and reads metadata + artwork, so its key is
|
||||
# read-only in intent. The engine role cannot express that today: an
|
||||
# arrstack_secret_backend_role carries apps/ttl/max_ttl only, and arrproxy scopes
|
||||
# machine tokens by app, not by HTTP method (the GET/HEAD restriction on the
|
||||
# cheeztv/kids tier is a grant on an OIDC *group*, not on a minted token). Until
|
||||
# the engine and arrproxy grow per-token method scoping, mediamark's read-only
|
||||
# posture is enforced by the app itself and by the arrproxy tier it routes to.
|
||||
apps:
|
||||
- radarr
|
||||
- sonarr
|
||||
ttl: 60 # seconds (1m); short-lived by design, renewed on demand
|
||||
max_ttl: 86400 # seconds (24h); the engine additionally caps renewal at the
|
||||
# arrproxy admin token's fixed mint expiry.
|
||||
@@ -2,6 +2,6 @@
|
||||
# Mints an arrproxy API key scoped to Prowlarr only.
|
||||
apps:
|
||||
- prowlarr
|
||||
ttl: 60 # seconds (1m); short-lived by design, renewed on demand
|
||||
ttl: 3600 # seconds (1h)
|
||||
max_ttl: 86400 # seconds (24h); the engine additionally caps renewal at the
|
||||
# arrproxy admin token's fixed mint expiry.
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
# Mints an arrproxy API key scoped to Radarr only.
|
||||
apps:
|
||||
- radarr
|
||||
ttl: 60 # seconds (1m); short-lived by design, renewed on demand
|
||||
ttl: 3600 # seconds (1h)
|
||||
max_ttl: 86400 # seconds (24h); the engine additionally caps renewal at the
|
||||
# arrproxy admin token's fixed mint expiry.
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
# Mints an arrproxy API key scoped to Sonarr only.
|
||||
apps:
|
||||
- sonarr
|
||||
ttl: 60 # seconds (1m); short-lived by design, renewed on demand
|
||||
ttl: 3600 # seconds (1h)
|
||||
max_ttl: 86400 # seconds (24h); the engine additionally caps renewal at the
|
||||
# arrproxy admin token's fixed mint expiry.
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
token_ttl: 120
|
||||
token_max_ttl: 120
|
||||
bind_secret_id: false
|
||||
token_bound_cidrs:
|
||||
- "10.10.12.200/32"
|
||||
- "198.18.25.102/32"
|
||||
- "198.18.26.91/32"
|
||||
- "198.18.27.40/32"
|
||||
use_deterministic_role_id: true
|
||||
@@ -1,9 +0,0 @@
|
||||
token_ttl: 120
|
||||
token_max_ttl: 120
|
||||
bind_secret_id: false
|
||||
token_bound_cidrs:
|
||||
- "10.10.12.200/32"
|
||||
- "198.18.25.102/32"
|
||||
- "198.18.26.91/32"
|
||||
- "198.18.27.40/32"
|
||||
use_deterministic_role_id: true
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
# Kubernetes auth role for the mediamark app: the default service account in the
|
||||
# mediamark namespace, used by VaultDynamicSecret to read arrstack/creds/mediamark.
|
||||
bound_service_account_names:
|
||||
- default
|
||||
bound_service_account_namespaces:
|
||||
- mediamark
|
||||
token_ttl: 600
|
||||
token_max_ttl: 600
|
||||
audience: vault
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
# Kubernetes auth for the puppetserver compilers, which run certmanager
|
||||
# server-side during catalog compilation. The AppRole equivalent is pinned to
|
||||
# the legacy VM master IPs and cannot be used from autoscaled compiler pods.
|
||||
bound_service_account_names:
|
||||
- default
|
||||
bound_service_account_namespaces:
|
||||
- puppet
|
||||
token_ttl: 30
|
||||
token_max_ttl: 30
|
||||
audience: https://kubernetes.default.svc.cluster.local
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
# Kubernetes auth for the puppetserver compilers, which run sshsignhost
|
||||
# server-side during catalog compilation.
|
||||
bound_service_account_names:
|
||||
- default
|
||||
bound_service_account_namespaces:
|
||||
- puppet
|
||||
token_ttl: 30
|
||||
token_max_ttl: 30
|
||||
audience: https://kubernetes.default.svc.cluster.local
|
||||
@@ -1,7 +0,0 @@
|
||||
bound_service_account_names:
|
||||
- repospawner
|
||||
bound_service_account_namespaces:
|
||||
- repospawner
|
||||
token_ttl: 600
|
||||
token_max_ttl: 600
|
||||
audience: vault
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
# Kubernetes auth role for rspamd: the rspamd service account in the mail
|
||||
# namespace, used by VaultDynamicSecret to read litellm/creds/rspamd.
|
||||
bound_service_account_names:
|
||||
- rspamd
|
||||
bound_service_account_namespaces:
|
||||
- mail
|
||||
token_ttl: 600
|
||||
token_max_ttl: 600
|
||||
audience: vault
|
||||
@@ -1,15 +0,0 @@
|
||||
bound_service_account_names:
|
||||
- default
|
||||
- arrproxy-ci
|
||||
- autobackup-operator-ci
|
||||
- ghp
|
||||
- jellyfin-plugin-sso
|
||||
- kea-operator-ci
|
||||
- mediamark-ci
|
||||
- plugin-docker-buildx
|
||||
- repospawner-ci
|
||||
bound_service_account_namespaces:
|
||||
- woodpecker
|
||||
token_ttl: 600
|
||||
token_max_ttl: 600
|
||||
audience: https://kubernetes.default.svc.cluster.local
|
||||
@@ -1,7 +0,0 @@
|
||||
bound_service_account_names:
|
||||
- terraform-binarylane
|
||||
bound_service_account_namespaces:
|
||||
- woodpecker
|
||||
token_ttl: 600
|
||||
token_max_ttl: 600
|
||||
audience: https://kubernetes.default.svc.cluster.local
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
bound_service_account_names:
|
||||
- terraform-netbox
|
||||
- terraform-infra
|
||||
bound_service_account_namespaces:
|
||||
- woodpecker
|
||||
token_ttl: 600
|
||||
@@ -1,17 +0,0 @@
|
||||
# Authentik (OIDC) human SSO. The mount path is the filename and MUST stay
|
||||
# "oidc": the Authentik provider registers strict redirect URIs containing
|
||||
# /ui/vault/auth/oidc/oidc/callback, which encode the mount path.
|
||||
#
|
||||
# identity.unkin.net serves the public LetsEncrypt wildcard, so the OpenBao VMs
|
||||
# validate discovery against the system roots with no CA bundle work. Do not
|
||||
# swap it for identity.k8s.syd1.au.unkin.net (internal CA).
|
||||
#
|
||||
# listing_visibility unauth makes OIDC the offered default on the UI login page.
|
||||
# client_id/client_secret are read from kv/service/authentik/oidc-vault.
|
||||
---
|
||||
oidc_discovery_url: "https://identity.unkin.net/application/o/vault/"
|
||||
default_role: "default"
|
||||
description: "Authentik SSO - default human login"
|
||||
listing_visibility: "unauth"
|
||||
default_lease_ttl: 24h
|
||||
max_lease_ttl: 168h
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
# this file doesnt need anything in it, so this data is just to make sure yamlencode reads some yaml data
|
||||
# The filename is the Authentik group name asserted in the ak_groups claim.
|
||||
# Only akP-* permission groups may appear here; akR-* roles are grouping-only.
|
||||
description: foo
|
||||
@@ -1,25 +0,0 @@
|
||||
# Default OIDC login role (the mount's default_role), used by both the web UI
|
||||
# and `bao login -method=oidc`.
|
||||
#
|
||||
# The role grants no policies of its own: authorization comes from the external
|
||||
# identity groups under config/auth_oidc_group, matched on the ak_groups claim.
|
||||
# ak_groups is Authentik's hierarchy-expanding claim (plain `groups` only carries
|
||||
# direct memberships), so nested akP-* permission groups resolve.
|
||||
#
|
||||
# allowed_redirect_uris must match the provider's strict URIs exactly.
|
||||
---
|
||||
user_claim: "email"
|
||||
groups_claim: "ak_groups"
|
||||
oidc_scopes:
|
||||
- openid
|
||||
- profile
|
||||
- email
|
||||
- ak_groups
|
||||
bound_audiences:
|
||||
- vault
|
||||
allowed_redirect_uris:
|
||||
- "http://localhost:8250/oidc/callback"
|
||||
- "https://vault.k8s.syd1.au.unkin.net/ui/vault/auth/oidc/oidc/callback"
|
||||
- "https://vault.service.consul:8200/ui/vault/auth/oidc/oidc/callback"
|
||||
token_ttl: 86400
|
||||
token_max_ttl: 604800
|
||||
@@ -97,27 +97,6 @@ locals {
|
||||
})
|
||||
if startswith(file_path, "auth_ldap_group/")
|
||||
}
|
||||
auth_oidc_backend = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "auth_oidc_backend/")
|
||||
}
|
||||
auth_oidc_role = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(replace(file_path, "auth_oidc_role/", ""), ".yaml") => merge(content, {
|
||||
role_name = trimsuffix(basename(file_path), ".yaml")
|
||||
backend = dirname(replace(file_path, "auth_oidc_role/", ""))
|
||||
})
|
||||
if startswith(file_path, "auth_oidc_role/")
|
||||
}
|
||||
auth_oidc_group = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(replace(file_path, "auth_oidc_group/", ""), ".yaml") => merge(content, {
|
||||
groupname = trimsuffix(basename(file_path), ".yaml")
|
||||
backend = split("/", replace(file_path, "auth_oidc_group/", ""))[0]
|
||||
})
|
||||
if startswith(file_path, "auth_oidc_group/")
|
||||
}
|
||||
auth_kubernetes_backend = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(replace(file_path, "auth_kubernetes_backend/", ""), ".yaml") => content
|
||||
@@ -300,47 +279,6 @@ locals {
|
||||
})
|
||||
if startswith(file_path, "netbox_secret_backend_role/")
|
||||
}
|
||||
identity_oidc = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "identity_oidc/")
|
||||
}
|
||||
identity_oidc_key = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "identity_oidc_key/")
|
||||
}
|
||||
identity_oidc_role = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(replace(file_path, "identity_oidc_role/", ""), ".yaml") => merge(content, {
|
||||
name = trimsuffix(basename(file_path), ".yaml")
|
||||
key = dirname(replace(file_path, "identity_oidc_role/", ""))
|
||||
})
|
||||
if startswith(file_path, "identity_oidc_role/")
|
||||
}
|
||||
identity_oidc_client = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(replace(file_path, "identity_oidc_client/", ""), ".yaml") => merge(content, {
|
||||
name = trimsuffix(basename(file_path), ".yaml")
|
||||
key = dirname(replace(file_path, "identity_oidc_client/", ""))
|
||||
})
|
||||
if startswith(file_path, "identity_oidc_client/")
|
||||
}
|
||||
identity_oidc_scope = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "identity_oidc_scope/")
|
||||
}
|
||||
identity_oidc_assignment = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "identity_oidc_assignment/")
|
||||
}
|
||||
identity_oidc_provider = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
if startswith(file_path, "identity_oidc_provider/")
|
||||
}
|
||||
ghp_secret_backend = {
|
||||
for file_path, content in local.all_configs :
|
||||
trimsuffix(basename(file_path), ".yaml") => content
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
consul_roles:
|
||||
- terraform-binarylane
|
||||
ttl: 120
|
||||
max_ttl: 300
|
||||
datacenters: []
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
consul_roles:
|
||||
- terraform-netbox
|
||||
- terraform-infra
|
||||
ttl: 120
|
||||
max_ttl: 300
|
||||
datacenters: []
|
||||
@@ -0,0 +1,15 @@
|
||||
# Role minting ephemeral, scoped ghp agent tokens. Reading ghp/creds/agent mints
|
||||
# a lease-bound token deleted from ghp on revoke/expiry. token_type "agent" binds
|
||||
# the minted token to a ghp App installation, so installation_id is REQUIRED.
|
||||
#
|
||||
# installation_id below is a PLACEHOLDER (0) and MUST be set to the real ghp App
|
||||
# installation id before this role can mint usable tokens. scopes are ghp
|
||||
# permission:level pairs; contents:read is the least-privilege default.
|
||||
---
|
||||
token_type: agent
|
||||
installation_id: 0 # PLACEHOLDER - set to the real ghp App installation id
|
||||
scopes:
|
||||
- contents:read
|
||||
session_prefix: vault
|
||||
ttl: 3600 # 1h
|
||||
max_ttl: 86400 # 24h
|
||||
@@ -1,19 +0,0 @@
|
||||
# Role minting ephemeral tokens for the repospawner service user. repospawner
|
||||
# creates and seeds Gitea repositories on demand, so it gets write on
|
||||
# repositories (create + push) and write on issues (issue/PR comments). Read is
|
||||
# implied by write. No admin/org/user-write scopes.
|
||||
# read:user is required because most API clients validate the login via
|
||||
# GET /api/v1/user, which 403s without it.
|
||||
# Reading gitea/creds/repospawner mints a lease-bound token deleted from Gitea
|
||||
# on revoke/expiry. Consumed by the repospawner pods via Kubernetes auth (see
|
||||
# policies/gitea/creds/repospawner.yaml) -- the agents AppRole is CIDR-bound to
|
||||
# Ben's workstation and cannot be used from in-cluster.
|
||||
---
|
||||
username: repospawner
|
||||
scopes:
|
||||
- write:repository
|
||||
- write:issue
|
||||
- read:user
|
||||
token_name_prefix: vault-repospawner
|
||||
ttl: 3600 # 1h
|
||||
max_ttl: 14400 # 4h
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
issuer: https://vault.service.consul:8200
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
algorithm: RS256
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
algorithm: RS256
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
client_id: artifactapi
|
||||
ttl: 900
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
client_id: artifactapi
|
||||
ttl: 900
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
client_id: encapi-testing
|
||||
ttl: 900
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
client_id: encapi
|
||||
ttl: 900
|
||||
@@ -1,6 +0,0 @@
|
||||
allowed_kubernetes_namespaces:
|
||||
- "vm-system"
|
||||
- "observability"
|
||||
- "logging"
|
||||
kubernetes_role_type: "Role"
|
||||
extra_labels: {}
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
models:
|
||||
- claude-haiku-4-5
|
||||
- claude-sonnet-4-6
|
||||
max_budget: 50
|
||||
ttl: 3600 # seconds (1h)
|
||||
max_ttl: 86400 # seconds (24h)
|
||||
|
||||
+3
-22
@@ -1,44 +1,25 @@
|
||||
# Single declarative source for the terraform-netbox NetBox service identity. The
|
||||
# Single declarative source for the terraform-infra NetBox service identity. The
|
||||
# filename stem is the engine role name AND the NetBox username (1:1); config.hcl
|
||||
# derives both from it, so neither is repeated below. Creating this file creates
|
||||
# the user: the netbox_user_management module synthesizes the NetBox user + object
|
||||
# permissions from the permissions block, and the engine role mints ephemeral
|
||||
# tokens for that same user. write_enabled true because terraform-netbox manages
|
||||
# tokens for that same user. write_enabled true because terraform-infra manages
|
||||
# NetBox IPAM/DCIM; very short TTLs because a token is minted per plan/apply and
|
||||
# revoked when the run's lease ends.
|
||||
#
|
||||
# extras.customfield is what lets the runner declare the custom fields bootapi
|
||||
# reads (pxe_enabled, provision_template, domain, gateway, nameservers), and
|
||||
# dcim.platform is how a device gets the platform slug bootapi selects a distro
|
||||
# catalog entry by.
|
||||
---
|
||||
write_enabled: true
|
||||
ttl: 120 # 2m
|
||||
max_ttl: 300 # 5m
|
||||
permissions:
|
||||
- name: terraform-netbox-write
|
||||
object_types:
|
||||
- object_types:
|
||||
- ipam.prefix
|
||||
- ipam.ipaddress
|
||||
- ipam.iprange
|
||||
- ipam.role
|
||||
- dcim.device
|
||||
- dcim.devicerole
|
||||
- dcim.devicetype
|
||||
- dcim.interface
|
||||
- dcim.macaddress
|
||||
- dcim.manufacturer
|
||||
- dcim.platform
|
||||
- extras.customfield
|
||||
- extras.tag
|
||||
actions:
|
||||
- view
|
||||
- add
|
||||
- change
|
||||
- delete
|
||||
# Sites are looked up with a data source, never created here.
|
||||
- name: terraform-netbox-read
|
||||
object_types:
|
||||
- dcim.site
|
||||
actions:
|
||||
- view
|
||||
@@ -4,16 +4,10 @@
|
||||
# Puppet (openbao-plugin-secrets-arrstack RPM ->
|
||||
# /opt/openbao-plugins/vault-plugin-secrets-arrstack).
|
||||
#
|
||||
# sha256 pins the released v0.2.0 binary; bump it in lockstep with any RPM
|
||||
# sha256 pins the released v0.1.0 binary; bump it in lockstep with any RPM
|
||||
# upgrade or OpenBao will refuse to launch the plugin. Registration only
|
||||
# succeeds once the Puppet PR has installed the binary on the nodes.
|
||||
#
|
||||
# Terraform retunes mounts onto a bumped version; after apply, run
|
||||
# `bao write sys/plugins/reload/backend mounts=arrstack scope=global`.
|
||||
#
|
||||
# Once versioned, keep `version` set: dropping it leaves the mount pinned to a
|
||||
# deregistered version.
|
||||
type: secret
|
||||
command: vault-plugin-secrets-arrstack
|
||||
version: "0.2.0"
|
||||
sha256: "9ea7f16013b3bcbadfcb15b08fd1545f8069893cf864bfdaa57e7e7e72612fa1"
|
||||
version: "0.1.0"
|
||||
sha256: "f8ee60ca7ba14819976acb7dc4cfb6799e3e8da8f871d0bb2bd18d1d9e537972"
|
||||
|
||||
@@ -3,8 +3,6 @@ algorithm_signer: rsa-sha2-256
|
||||
ttl: 315360000 # 87600 * 3600
|
||||
allow_host_certificates: true
|
||||
allow_user_certificates: false
|
||||
# "*" must be the sole entry: OpenBao only treats allowed_domains as unrestricted
|
||||
# when the whole string is "*", and otherwise matches entries exactly or by suffix.
|
||||
allowed_domains: "*"
|
||||
allowed_domains: "main.unkin.net,consul"
|
||||
allow_subdomains: true
|
||||
allow_bare_domains: false
|
||||
|
||||
@@ -60,9 +60,6 @@ inputs = {
|
||||
auth_approle_role = local.config.auth_approle_role
|
||||
auth_ldap_backend = local.config.auth_ldap_backend
|
||||
auth_ldap_group = local.config.auth_ldap_group
|
||||
auth_oidc_backend = local.config.auth_oidc_backend
|
||||
auth_oidc_role = local.config.auth_oidc_role
|
||||
auth_oidc_group = local.config.auth_oidc_group
|
||||
auth_kubernetes_backend = local.config.auth_kubernetes_backend
|
||||
auth_kubernetes_role = local.config.auth_kubernetes_role
|
||||
kv_secret_backend = local.config.kv_secret_backend
|
||||
@@ -98,14 +95,6 @@ inputs = {
|
||||
ghp_secret_backend = local.config.ghp_secret_backend
|
||||
ghp_secret_backend_role = local.config.ghp_secret_backend_role
|
||||
|
||||
identity_oidc = local.config.identity_oidc
|
||||
identity_oidc_key = local.config.identity_oidc_key
|
||||
identity_oidc_role = local.config.identity_oidc_role
|
||||
identity_oidc_client = local.config.identity_oidc_client
|
||||
identity_oidc_scope = local.config.identity_oidc_scope
|
||||
identity_oidc_assignment = local.config.identity_oidc_assignment
|
||||
identity_oidc_provider = local.config.identity_oidc_provider
|
||||
|
||||
# Pass policy maps to vault_cluster module
|
||||
policy_auth_map = local.policies.policy_auth_map
|
||||
policy_rules_map = local.policies.policy_rules_map
|
||||
|
||||
@@ -66,8 +66,8 @@ terraform {
|
||||
version = "0.1.0"
|
||||
}
|
||||
arrstack = {
|
||||
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/vault-secrets-arrstack"
|
||||
version = "0.2.0"
|
||||
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/arrstackvaultsecret"
|
||||
version = "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,55 +64,6 @@ module "auth_ldap_group" {
|
||||
depends_on = [module.auth_ldap_backend]
|
||||
}
|
||||
|
||||
module "auth_oidc_backend" {
|
||||
source = "./modules/auth_oidc_backend"
|
||||
|
||||
for_each = var.auth_oidc_backend
|
||||
|
||||
path = each.key
|
||||
description = each.value.description
|
||||
oidc_discovery_url = each.value.oidc_discovery_url
|
||||
client_secret_mount = each.value.client_secret_mount
|
||||
client_secret_path = each.value.client_secret_path
|
||||
default_role = each.value.default_role
|
||||
listing_visibility = each.value.listing_visibility
|
||||
default_lease_ttl = each.value.default_lease_ttl
|
||||
max_lease_ttl = each.value.max_lease_ttl
|
||||
}
|
||||
|
||||
module "auth_oidc_role" {
|
||||
source = "./modules/auth_oidc_role"
|
||||
|
||||
for_each = var.auth_oidc_role
|
||||
|
||||
backend = each.value.backend
|
||||
role_name = each.value.role_name
|
||||
user_claim = each.value.user_claim
|
||||
groups_claim = each.value.groups_claim
|
||||
oidc_scopes = each.value.oidc_scopes
|
||||
bound_audiences = each.value.bound_audiences
|
||||
allowed_redirect_uris = each.value.allowed_redirect_uris
|
||||
token_ttl = each.value.token_ttl
|
||||
token_max_ttl = each.value.token_max_ttl
|
||||
# Human authorization comes from the external identity groups below, so a
|
||||
# login role carrying no policies is the normal case.
|
||||
token_policies = try(var.policy_auth_map[each.value.backend][each.value.role_name], [])
|
||||
|
||||
depends_on = [module.auth_oidc_backend]
|
||||
}
|
||||
|
||||
module "auth_oidc_group" {
|
||||
source = "./modules/auth_oidc_group"
|
||||
|
||||
for_each = var.auth_oidc_group
|
||||
|
||||
groupname = each.value.groupname
|
||||
policies = var.policy_auth_map[each.value.backend][each.value.groupname]
|
||||
mount_accessor = module.auth_oidc_backend[each.value.backend].accessor
|
||||
|
||||
depends_on = [module.auth_oidc_backend]
|
||||
}
|
||||
|
||||
module "auth_kubernetes_backend" {
|
||||
source = "./modules/auth_kubernetes_backend"
|
||||
|
||||
@@ -396,43 +347,6 @@ module "plugin" {
|
||||
plugin_version = each.value.version
|
||||
}
|
||||
|
||||
locals {
|
||||
plugin_mounts = merge(
|
||||
{ for path, mount in var.arrstack_secret_backend : path => mount.plugin },
|
||||
{ for path, mount in var.ghp_secret_backend : path => mount.plugin },
|
||||
{ for path, mount in var.gitea_secret_backend : path => mount.plugin },
|
||||
{ for path, mount in var.gpg_secret_backend : path => mount.plugin },
|
||||
{ for path, mount in var.litellm_secret_backend : path => mount.plugin },
|
||||
{ for path, mount in var.netbox_secret_backend : path => mount.plugin },
|
||||
{ for path, mount in var.rancher_secret_backend : path => mount.plugin },
|
||||
)
|
||||
}
|
||||
|
||||
# Pins each plugin-backed mount to its plugin's catalog version. Unversioned
|
||||
# catalog entries need no pin (OpenBao rejects an empty plugin_version tune).
|
||||
module "mount_plugin_version" {
|
||||
source = "./modules/mount_plugin_version"
|
||||
|
||||
for_each = {
|
||||
for path, plugin in local.plugin_mounts : path => var.plugins[plugin].version
|
||||
if try(var.plugins[plugin].version, null) != null
|
||||
}
|
||||
|
||||
path = each.key
|
||||
plugin_version = each.value
|
||||
|
||||
depends_on = [
|
||||
module.plugin,
|
||||
module.arrstack_secret_backend,
|
||||
module.ghp_secret_backend,
|
||||
module.gitea_secret_backend,
|
||||
module.gpg_secret_backend,
|
||||
module.litellm_secret_backend,
|
||||
module.netbox_secret_backend,
|
||||
module.rancher_secret_backend,
|
||||
]
|
||||
}
|
||||
|
||||
module "arrstack_secret_backend" {
|
||||
source = "./modules/arrstack_secret_backend"
|
||||
|
||||
@@ -456,7 +370,6 @@ module "arrstack_secret_backend_role" {
|
||||
name = each.value.name
|
||||
backend = each.value.backend
|
||||
apps = each.value.apps
|
||||
methods = each.value.methods
|
||||
ttl = each.value.ttl
|
||||
max_ttl = each.value.max_ttl
|
||||
|
||||
@@ -720,105 +633,3 @@ module "pki_mount_only" {
|
||||
delta_rebuild_interval = each.value.delta_rebuild_interval
|
||||
}
|
||||
|
||||
|
||||
module "identity_oidc" {
|
||||
source = "./modules/identity_oidc"
|
||||
|
||||
for_each = var.identity_oidc
|
||||
|
||||
issuer = each.value.issuer
|
||||
}
|
||||
|
||||
module "identity_oidc_key" {
|
||||
source = "./modules/identity_oidc_key"
|
||||
|
||||
for_each = var.identity_oidc_key
|
||||
|
||||
name = each.key
|
||||
algorithm = each.value.algorithm
|
||||
rotation_period = each.value.rotation_period
|
||||
verification_ttl = each.value.verification_ttl
|
||||
|
||||
depends_on = [module.identity_oidc]
|
||||
}
|
||||
|
||||
module "identity_oidc_role" {
|
||||
source = "./modules/identity_oidc_role"
|
||||
|
||||
for_each = var.identity_oidc_role
|
||||
|
||||
name = each.value.name
|
||||
key = each.value.key
|
||||
template = each.value.template
|
||||
ttl = each.value.ttl
|
||||
client_id = each.value.client_id
|
||||
|
||||
depends_on = [module.identity_oidc, module.identity_oidc_key]
|
||||
}
|
||||
|
||||
module "identity_oidc_assignment" {
|
||||
source = "./modules/identity_oidc_assignment"
|
||||
|
||||
for_each = var.identity_oidc_assignment
|
||||
|
||||
name = each.key
|
||||
entity_ids = each.value.entity_ids
|
||||
group_ids = each.value.group_ids
|
||||
}
|
||||
|
||||
module "identity_oidc_client" {
|
||||
source = "./modules/identity_oidc_client"
|
||||
|
||||
for_each = var.identity_oidc_client
|
||||
|
||||
name = each.value.name
|
||||
key = each.value.key
|
||||
redirect_uris = each.value.redirect_uris
|
||||
assignments = each.value.assignments
|
||||
client_type = each.value.client_type
|
||||
id_token_ttl = each.value.id_token_ttl
|
||||
access_token_ttl = each.value.access_token_ttl
|
||||
|
||||
depends_on = [module.identity_oidc, module.identity_oidc_key, module.identity_oidc_assignment]
|
||||
}
|
||||
|
||||
module "identity_oidc_key_allowed_client_id" {
|
||||
source = "./modules/identity_oidc_key_allowed_client_id"
|
||||
|
||||
for_each = merge(
|
||||
{ for k, v in var.identity_oidc_role : "role/${k}" => { key = v.key, client_id = module.identity_oidc_role[k].client_id } },
|
||||
{ for k, v in var.identity_oidc_client : "client/${k}" => { key = v.key, client_id = module.identity_oidc_client[k].client_id } },
|
||||
)
|
||||
|
||||
key_name = each.value.key
|
||||
allowed_client_id = each.value.client_id
|
||||
|
||||
depends_on = [module.identity_oidc_key]
|
||||
}
|
||||
|
||||
module "identity_oidc_scope" {
|
||||
source = "./modules/identity_oidc_scope"
|
||||
|
||||
for_each = var.identity_oidc_scope
|
||||
|
||||
name = each.key
|
||||
description = each.value.description
|
||||
template = each.value.template
|
||||
}
|
||||
|
||||
module "identity_oidc_provider" {
|
||||
source = "./modules/identity_oidc_provider"
|
||||
|
||||
for_each = var.identity_oidc_provider
|
||||
|
||||
name = each.key
|
||||
issuer_host = each.value.issuer_host
|
||||
https_enabled = each.value.https_enabled
|
||||
scopes_supported = each.value.scopes_supported
|
||||
allowed_client_ids = [
|
||||
for c in each.value.allowed_clients :
|
||||
c == "*" ? c : one([for k, v in var.identity_oidc_client : module.identity_oidc_client[k].client_id if v.name == c])
|
||||
]
|
||||
|
||||
depends_on = [module.identity_oidc, module.identity_oidc_scope, module.identity_oidc_client]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Mounts the arrstack dynamic secrets engine and writes its config via the
|
||||
# vault-secrets-arrstack provider. The plugin is registered in the catalog
|
||||
# arrstackvaultsecret provider. The plugin is registered in the catalog
|
||||
# separately (config/plugins/vault-plugin-secrets-arrstack.yaml). The arrproxy
|
||||
# admin token is sensitive and read from KV, not stored in git:
|
||||
# kv/kubernetes/namespace/arrstack/default/arrproxy-admin-token -> key "token"
|
||||
|
||||
@@ -6,8 +6,8 @@ terraform {
|
||||
version = "5.6.0"
|
||||
}
|
||||
arrstack = {
|
||||
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/vault-secrets-arrstack"
|
||||
version = "0.2.0"
|
||||
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/arrstackvaultsecret"
|
||||
version = "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ resource "arrstack_secret_backend_role" "this" {
|
||||
backend = var.backend
|
||||
name = var.name
|
||||
apps = var.apps
|
||||
methods = var.methods
|
||||
ttl = var.ttl
|
||||
max_ttl = var.max_ttl
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
arrstack = {
|
||||
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/vault-secrets-arrstack"
|
||||
version = "0.2.0"
|
||||
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/arrstackvaultsecret"
|
||||
version = "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,13 +13,6 @@ variable "apps" {
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
variable "methods" {
|
||||
description = "HTTP methods a generated key is limited to (subset of GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS). Null leaves the role unrestricted"
|
||||
type = set(string)
|
||||
# null, not [], so a role yaml that omits methods matches the provider's null read-back and shows no drift.
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "ttl" {
|
||||
description = "Default lease TTL in seconds for keys generated from this role"
|
||||
type = number
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# Expected keys in KV secret: client_id, client_secret (generated and written by
|
||||
# terraform-authentik's oauth2 provider module, never seeded by hand).
|
||||
data "vault_kv_secret_v2" "oidc_client" {
|
||||
mount = var.client_secret_mount
|
||||
name = var.client_secret_path
|
||||
}
|
||||
|
||||
resource "vault_jwt_auth_backend" "oidc" {
|
||||
path = var.path
|
||||
type = "oidc"
|
||||
description = var.description
|
||||
oidc_discovery_url = var.oidc_discovery_url
|
||||
oidc_client_id = data.vault_kv_secret_v2.oidc_client.data["client_id"]
|
||||
oidc_client_secret = data.vault_kv_secret_v2.oidc_client.data["client_secret"]
|
||||
default_role = var.default_role
|
||||
|
||||
tune {
|
||||
default_lease_ttl = var.default_lease_ttl
|
||||
max_lease_ttl = var.max_lease_ttl
|
||||
listing_visibility = var.listing_visibility
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
output "accessor" {
|
||||
description = "Accessor of the OIDC auth mount, used to bind identity group aliases"
|
||||
value = vault_jwt_auth_backend.oidc.accessor
|
||||
}
|
||||
|
||||
output "path" {
|
||||
description = "Mount path of the OIDC auth backend"
|
||||
value = vault_jwt_auth_backend.oidc.path
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
variable "path" {
|
||||
description = "Mount path of the OIDC auth backend"
|
||||
type = string
|
||||
default = "oidc"
|
||||
}
|
||||
|
||||
variable "description" {
|
||||
description = "Human-readable description of the auth mount"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "oidc_discovery_url" {
|
||||
description = "OIDC issuer discovery URL of the identity provider"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "client_secret_mount" {
|
||||
description = "KV-v2 mount holding the OIDC client credentials"
|
||||
type = string
|
||||
default = "kv"
|
||||
}
|
||||
|
||||
variable "client_secret_path" {
|
||||
description = "Path within the KV-v2 mount holding client_id and client_secret"
|
||||
type = string
|
||||
default = "service/authentik/oidc-vault"
|
||||
}
|
||||
|
||||
variable "default_role" {
|
||||
description = "Role used when none is supplied at login (the UI/CLI default)"
|
||||
type = string
|
||||
default = "default"
|
||||
}
|
||||
|
||||
variable "listing_visibility" {
|
||||
description = "Specifies whether to show this mount in the UI-specific listing endpoint. Valid values are 'unauth' or 'hidden'"
|
||||
type = string
|
||||
default = null
|
||||
validation {
|
||||
condition = var.listing_visibility == null || contains(["unauth", "hidden"], var.listing_visibility)
|
||||
error_message = "listing_visibility must be either 'unauth' or 'hidden'."
|
||||
}
|
||||
}
|
||||
|
||||
variable "default_lease_ttl" {
|
||||
description = "Specifies the default time-to-live. If set, this overrides the global default. Must be a valid duration string"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "max_lease_ttl" {
|
||||
description = "Specifies the maximum time-to-live. If set, this overrides the global default. Must be a valid duration string"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
# External identity group: membership is asserted by the IdP through the role's
|
||||
# groups_claim, matched by the alias name below.
|
||||
resource "vault_identity_group" "group" {
|
||||
name = var.groupname
|
||||
type = "external"
|
||||
policies = var.policies
|
||||
}
|
||||
|
||||
resource "vault_identity_group_alias" "alias" {
|
||||
name = var.groupname
|
||||
mount_accessor = var.mount_accessor
|
||||
canonical_id = vault_identity_group.group.id
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
variable "groupname" {
|
||||
description = "Name of the IdP group, as it appears in the groups claim"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "policies" {
|
||||
description = "List of policies to assign to the identity group"
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
variable "mount_accessor" {
|
||||
description = "Accessor of the OIDC auth mount the alias is bound to"
|
||||
type = string
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
resource "vault_jwt_auth_backend_role" "role" {
|
||||
backend = var.backend
|
||||
role_name = var.role_name
|
||||
role_type = "oidc"
|
||||
user_claim = var.user_claim
|
||||
groups_claim = var.groups_claim
|
||||
oidc_scopes = var.oidc_scopes
|
||||
bound_audiences = var.bound_audiences
|
||||
allowed_redirect_uris = var.allowed_redirect_uris
|
||||
token_ttl = var.token_ttl
|
||||
token_max_ttl = var.token_max_ttl
|
||||
token_policies = var.token_policies
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
variable "backend" {
|
||||
description = "The unique path of the OIDC auth backend to configure"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "role_name" {
|
||||
description = "The name of the role"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "user_claim" {
|
||||
description = "Claim used as the entity alias name (the Vault identity of the human)"
|
||||
type = string
|
||||
default = "email"
|
||||
}
|
||||
|
||||
variable "groups_claim" {
|
||||
description = "Claim holding the caller's group memberships, matched against identity group aliases"
|
||||
type = string
|
||||
default = "ak_groups"
|
||||
}
|
||||
|
||||
variable "oidc_scopes" {
|
||||
description = "Scopes requested from the identity provider during the authorization request"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "bound_audiences" {
|
||||
description = "List of audiences (aud claim) accepted in the ID token"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "allowed_redirect_uris" {
|
||||
description = "Redirect URIs accepted for this role. Must match the provider's registered URIs exactly"
|
||||
type = list(string)
|
||||
}
|
||||
|
||||
variable "token_ttl" {
|
||||
description = "The TTL period of tokens issued using this role, in seconds"
|
||||
type = number
|
||||
default = 3600
|
||||
}
|
||||
|
||||
variable "token_max_ttl" {
|
||||
description = "The maximum lifetime for generated tokens in number of seconds. Its current value will be referenced at renewal time."
|
||||
type = number
|
||||
default = 28800
|
||||
}
|
||||
|
||||
variable "token_policies" {
|
||||
description = "List of policies to assign to the role (passed from policy_auth_map). Human authorization normally comes from external identity groups instead"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
resource "vault_identity_oidc" "this" {
|
||||
issuer = var.issuer
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
variable "issuer" {
|
||||
description = "Issuer URL for identity tokens (scheme://host:port, no path); null uses Vault's api_addr"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
resource "vault_identity_oidc_assignment" "this" {
|
||||
name = var.name
|
||||
entity_ids = var.entity_ids
|
||||
group_ids = var.group_ids
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
variable "name" {
|
||||
description = "Assignment name"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "entity_ids" {
|
||||
description = "Identity entity ids in this assignment"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "group_ids" {
|
||||
description = "Identity group ids in this assignment"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
resource "vault_identity_oidc_client" "this" {
|
||||
name = var.name
|
||||
key = var.key
|
||||
redirect_uris = var.redirect_uris
|
||||
assignments = var.assignments
|
||||
client_type = var.client_type
|
||||
id_token_ttl = var.id_token_ttl
|
||||
access_token_ttl = var.access_token_ttl
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
output "client_id" {
|
||||
value = vault_identity_oidc_client.this.client_id
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
variable "name" {
|
||||
description = "OIDC client name"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "key" {
|
||||
description = "Named key that signs this client's ID tokens"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "redirect_uris" {
|
||||
description = "Allowed redirect URIs"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "assignments" {
|
||||
description = "Assignment names allowed to authenticate with this client"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "client_type" {
|
||||
description = "confidential or public"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "id_token_ttl" {
|
||||
description = "ID token TTL in seconds"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "access_token_ttl" {
|
||||
description = "Access token TTL in seconds"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
resource "vault_identity_oidc_key" "this" {
|
||||
name = var.name
|
||||
algorithm = var.algorithm
|
||||
rotation_period = var.rotation_period
|
||||
verification_ttl = var.verification_ttl
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
variable "name" {
|
||||
description = "Name of the named key"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "algorithm" {
|
||||
description = "Signing algorithm (RS256, RS384, RS512, ES256, ES384, ES512, EdDSA)"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "rotation_period" {
|
||||
description = "Seconds between key rotations"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "verification_ttl" {
|
||||
description = "Seconds a rotated public key stays published for verification"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
resource "vault_identity_oidc_key_allowed_client_id" "this" {
|
||||
key_name = var.key_name
|
||||
allowed_client_id = var.allowed_client_id
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
variable "key_name" {
|
||||
description = "Named key the client id may sign with"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "allowed_client_id" {
|
||||
description = "Role or client id allowed to use the key"
|
||||
type = string
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
resource "vault_identity_oidc_provider" "this" {
|
||||
name = var.name
|
||||
issuer_host = var.issuer_host
|
||||
https_enabled = var.https_enabled
|
||||
scopes_supported = var.scopes_supported
|
||||
allowed_client_ids = var.allowed_client_ids
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
variable "name" {
|
||||
description = "OIDC provider name"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "issuer_host" {
|
||||
description = "Issuer host[:port]; null uses Vault's api_addr"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "https_enabled" {
|
||||
description = "Use https in the issuer URL"
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "scopes_supported" {
|
||||
description = "Scope names the provider serves"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "allowed_client_ids" {
|
||||
description = "Client ids allowed to use the provider (\"*\" allows all)"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
resource "vault_identity_oidc_role" "this" {
|
||||
name = var.name
|
||||
key = var.key
|
||||
template = var.template
|
||||
ttl = var.ttl
|
||||
client_id = var.client_id
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
output "client_id" {
|
||||
value = vault_identity_oidc_role.this.client_id
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
variable "name" {
|
||||
description = "Role name (read identity/oidc/token/<name> to mint a token)"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "key" {
|
||||
description = "Named key that signs this role's tokens"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "template" {
|
||||
description = "JSON claims template for issued tokens"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "ttl" {
|
||||
description = "Token TTL in seconds"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "client_id" {
|
||||
description = "Token audience (aud); null lets Vault generate one"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
resource "vault_identity_oidc_scope" "this" {
|
||||
name = var.name
|
||||
description = var.description
|
||||
template = var.template
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
variable "name" {
|
||||
description = "Scope name"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "description" {
|
||||
description = "Scope description"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "template" {
|
||||
description = "JSON claims template added when this scope is requested"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
@@ -16,7 +16,7 @@ locals {
|
||||
resource "vault_kubernetes_secret_backend_role" "role" {
|
||||
backend = var.backend
|
||||
name = var.name
|
||||
allowed_kubernetes_namespaces = sort(var.allowed_kubernetes_namespaces)
|
||||
allowed_kubernetes_namespaces = var.allowed_kubernetes_namespaces
|
||||
kubernetes_role_type = local.use_service_account ? null : var.kubernetes_role_type
|
||||
generated_role_rules = local.use_service_account ? null : file("${path.module}/../../../../../../../../${local.role_rules_file}")
|
||||
service_account_name = var.service_account_name
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# Pins a plugin-backed mount to its catalog version (sys/mounts/<path>/tune).
|
||||
# OpenBao normalises plugin_version to a leading "v" and reads it back that way.
|
||||
# Tune has no delete; destroying this leaves the mount's pin in place.
|
||||
resource "vault_generic_endpoint" "this" {
|
||||
path = "sys/mounts/${var.path}/tune"
|
||||
data_json = jsonencode({ plugin_version = "v${trimprefix(var.plugin_version, "v")}" })
|
||||
ignore_absent_fields = true
|
||||
disable_delete = true
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
terraform {
|
||||
required_version = ">= 1.10"
|
||||
required_providers {
|
||||
vault = {
|
||||
source = "hashicorp/vault"
|
||||
version = "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
variable "path" {
|
||||
description = "Mount path of the plugin-backed secrets engine"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "plugin_version" {
|
||||
description = "Catalog version to pin the mount to (with or without a leading v)"
|
||||
type = string
|
||||
}
|
||||
@@ -9,10 +9,4 @@ resource "vault_plugin" "this" {
|
||||
command = coalesce(var.command, var.name)
|
||||
sha256 = var.sha256
|
||||
version = var.plugin_version
|
||||
|
||||
# A version bump registers the new entry, retunes mounts onto it, then
|
||||
# deregisters the old one, so no mount is left pinned to a missing version.
|
||||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,46 +62,6 @@ variable "auth_ldap_group" {
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "auth_oidc_backend" {
|
||||
description = "Map of OIDC (JWT) auth backends to create"
|
||||
type = map(object({
|
||||
oidc_discovery_url = string
|
||||
description = optional(string)
|
||||
client_secret_mount = optional(string, "kv")
|
||||
client_secret_path = optional(string, "service/authentik/oidc-vault")
|
||||
default_role = optional(string, "default")
|
||||
listing_visibility = optional(string)
|
||||
default_lease_ttl = optional(string)
|
||||
max_lease_ttl = optional(string)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "auth_oidc_role" {
|
||||
description = "Map of OIDC auth roles to create"
|
||||
type = map(object({
|
||||
role_name = string
|
||||
backend = string
|
||||
allowed_redirect_uris = list(string)
|
||||
user_claim = optional(string, "email")
|
||||
groups_claim = optional(string, "ak_groups")
|
||||
oidc_scopes = optional(list(string), [])
|
||||
bound_audiences = optional(list(string), [])
|
||||
token_ttl = optional(number, 3600)
|
||||
token_max_ttl = optional(number, 28800)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "auth_oidc_group" {
|
||||
description = "Map of external identity groups bound to an OIDC auth mount"
|
||||
type = map(object({
|
||||
groupname = string
|
||||
backend = string
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "auth_kubernetes_backend" {
|
||||
description = "Map of Kubernetes auth backends to create"
|
||||
type = map(object({
|
||||
@@ -374,7 +334,6 @@ variable "arrstack_secret_backend_role" {
|
||||
name = string
|
||||
backend = string
|
||||
apps = list(string)
|
||||
methods = optional(set(string))
|
||||
ttl = optional(number)
|
||||
max_ttl = optional(number)
|
||||
}))
|
||||
@@ -578,76 +537,3 @@ variable "policy_rules_map" {
|
||||
default = {}
|
||||
}
|
||||
|
||||
|
||||
variable "identity_oidc" {
|
||||
description = "Identity token issuer config (singleton in practice)"
|
||||
type = map(object({
|
||||
issuer = optional(string)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "identity_oidc_key" {
|
||||
description = "Map of identity OIDC named keys to create"
|
||||
type = map(object({
|
||||
algorithm = optional(string, "RS256")
|
||||
rotation_period = optional(number, 86400)
|
||||
verification_ttl = optional(number, 86400)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "identity_oidc_role" {
|
||||
description = "Map of identity token roles to create, keyed <key>/<role>"
|
||||
type = map(object({
|
||||
name = string
|
||||
key = string
|
||||
template = optional(string)
|
||||
ttl = optional(number, 86400)
|
||||
client_id = optional(string)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "identity_oidc_client" {
|
||||
description = "Map of identity OIDC provider clients to create, keyed <key>/<client>"
|
||||
type = map(object({
|
||||
name = string
|
||||
key = string
|
||||
redirect_uris = optional(list(string), [])
|
||||
assignments = optional(list(string), [])
|
||||
client_type = optional(string, "confidential")
|
||||
id_token_ttl = optional(number, 86400)
|
||||
access_token_ttl = optional(number, 86400)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "identity_oidc_scope" {
|
||||
description = "Map of identity OIDC provider scopes to create"
|
||||
type = map(object({
|
||||
description = optional(string)
|
||||
template = optional(string)
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "identity_oidc_assignment" {
|
||||
description = "Map of identity OIDC client assignments to create"
|
||||
type = map(object({
|
||||
entity_ids = optional(list(string), [])
|
||||
group_ids = optional(list(string), [])
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "identity_oidc_provider" {
|
||||
description = "Map of identity OIDC providers to create; allowed_clients are client names or \"*\""
|
||||
type = map(object({
|
||||
issuer_host = optional(string)
|
||||
https_enabled = optional(bool, true)
|
||||
scopes_supported = optional(list(string), [])
|
||||
allowed_clients = optional(list(string), [])
|
||||
}))
|
||||
default = {}
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# Allow the mediamark app to mint its own Sonarr/Radarr-scoped arrproxy key.
|
||||
# Bound to the dedicated "mediamark" k8s role only, never the shared "default"
|
||||
# role, so no other namespace can read these creds.
|
||||
---
|
||||
rules:
|
||||
- path: "arrstack/creds/mediamark"
|
||||
capabilities:
|
||||
- read
|
||||
|
||||
auth:
|
||||
k8s/au/syd1:
|
||||
- mediamark
|
||||
@@ -1,19 +0,0 @@
|
||||
# Allow full administration of the OIDC auth backend (mount config and login
|
||||
# roles), mirroring policies/auth/ldap/admin.yaml. sys/auth/* already covers
|
||||
# enabling the mount itself; this covers writing auth/oidc/config and
|
||||
# auth/oidc/role/*.
|
||||
---
|
||||
rules:
|
||||
- path: "auth/oidc/*"
|
||||
capabilities:
|
||||
- create
|
||||
- update
|
||||
- read
|
||||
- delete
|
||||
- list
|
||||
|
||||
auth:
|
||||
approle:
|
||||
- tf_vault
|
||||
k8s/au/syd1:
|
||||
- woodpecker_terraform_vault
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
rules:
|
||||
- path: "consul_root/au/syd1/creds/terraform-binarylane"
|
||||
capabilities:
|
||||
- read
|
||||
|
||||
auth:
|
||||
approle:
|
||||
- terraform_binarylane
|
||||
k8s/au/syd1:
|
||||
- woodpecker_terraform_binarylane
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
rules:
|
||||
- path: "consul_root/au/syd1/creds/terraform-infra"
|
||||
capabilities:
|
||||
- read
|
||||
|
||||
auth:
|
||||
approle:
|
||||
- terraform_infra
|
||||
k8s/au/syd1:
|
||||
- woodpecker_terraform_infra
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
rules:
|
||||
- path: "consul_root/au/syd1/creds/terraform-netbox"
|
||||
capabilities:
|
||||
- read
|
||||
|
||||
auth:
|
||||
approle:
|
||||
- terraform_netbox
|
||||
k8s/au/syd1:
|
||||
- woodpecker_terraform_netbox
|
||||
@@ -1,16 +0,0 @@
|
||||
# Lets the repospawner pods mint ephemeral Gitea tokens for the repospawner
|
||||
# service user, so the service authenticates to git.unkin.net as its own
|
||||
# least-privilege identity. Reading gitea/creds/repospawner returns a
|
||||
# lease-bound token scoped by the role (write:repository, write:issue,
|
||||
# read:user -- never merge/admin).
|
||||
# Kubernetes auth only: repospawner runs in-cluster and the agents AppRole is
|
||||
# CIDR-bound to Ben's workstation.
|
||||
---
|
||||
rules:
|
||||
- path: "gitea/creds/repospawner"
|
||||
capabilities:
|
||||
- read
|
||||
|
||||
auth:
|
||||
k8s/au/syd1:
|
||||
- repospawner
|
||||
@@ -10,12 +10,6 @@ rules:
|
||||
- list
|
||||
- sudo
|
||||
|
||||
# The oidc entry is an Authentik akP-* permission group, not an LDAP group name:
|
||||
# it names the external identity group under config/auth_oidc_group, so a human
|
||||
# who logs in via Authentik SSO lands on exactly the policy the LDAP vault_admin
|
||||
# group already carries. akR-* roles are grouping-only and never named here.
|
||||
auth:
|
||||
ldap:
|
||||
- vault_admin
|
||||
oidc:
|
||||
- akP-vault-admin
|
||||
|
||||
+15
-3
@@ -1,8 +1,20 @@
|
||||
# Allow the vault deployer to manage the gpg mount's OpenPGP keys via the
|
||||
# gpgvaultsecret provider. Registering the plugin itself is a sys/plugins/catalog
|
||||
# grant, carried by policies/sys/plugins/catalog/admin.yaml.
|
||||
# Allow the vault deployer to import the gpg plugin and manage its OpenPGP keys.
|
||||
#
|
||||
# terraform-vault registers the plugin itself (vault_plugin -> sys/plugins/catalog,
|
||||
# a sudo-protected path) and manages keys via the gpgvaultsecret provider, so the
|
||||
# deployer needs catalog access on top of the mount access it already has
|
||||
# (sys/mounts/*). Without this, apply 403s on the plugin registration and on
|
||||
# gpg/keys writes.
|
||||
---
|
||||
rules:
|
||||
# Import / register (and deregister) the gpg plugin in the catalog.
|
||||
- path: "sys/plugins/catalog/secret/vault-plugin-secrets-gpg"
|
||||
capabilities:
|
||||
- create
|
||||
- read
|
||||
- update
|
||||
- delete
|
||||
- sudo
|
||||
# Manage keys (create/rotate/config/delete) in the gpg mount.
|
||||
- path: "gpg/keys/*"
|
||||
capabilities:
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Allow the deployer to manage the identity group aliases that map external OIDC
|
||||
# group membership (the ak_groups claim) onto the Vault groups managed under
|
||||
# policies/identity/group/. Both endpoints are needed: create posts to
|
||||
# identity/group-alias, subsequent reads and updates address
|
||||
# identity/group-alias/id/<id>.
|
||||
---
|
||||
rules:
|
||||
- path: "identity/group-alias"
|
||||
capabilities:
|
||||
- create
|
||||
- update
|
||||
- path: "identity/group-alias/*"
|
||||
capabilities:
|
||||
- create
|
||||
- update
|
||||
- read
|
||||
- delete
|
||||
- list
|
||||
|
||||
auth:
|
||||
approle:
|
||||
- tf_vault
|
||||
k8s/au/syd1:
|
||||
- woodpecker_terraform_vault
|
||||
@@ -1,23 +0,0 @@
|
||||
# Allow the deployer to manage the external identity groups that OIDC group
|
||||
# membership (the ak_groups claim) maps onto Vault policies through. Both the
|
||||
# collection endpoint and the per-id endpoints are needed: create posts to
|
||||
# identity/group, subsequent reads and updates address identity/group/id/<id>.
|
||||
---
|
||||
rules:
|
||||
- path: "identity/group"
|
||||
capabilities:
|
||||
- create
|
||||
- update
|
||||
- path: "identity/group/*"
|
||||
capabilities:
|
||||
- create
|
||||
- update
|
||||
- read
|
||||
- delete
|
||||
- list
|
||||
|
||||
auth:
|
||||
approle:
|
||||
- tf_vault
|
||||
k8s/au/syd1:
|
||||
- woodpecker_terraform_vault
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user