Skip to content

Commit 1a8bba3

Browse files
committed
Enable ACME support
1 parent 282656c commit 1a8bba3

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "vault_pki_secret_backend_config_cluster" "pki_config_cluster" {
2+
backend = vault_mount.pki-svc.path
3+
path = "https://vault.service.consul:8200/v1/pki-svc"
4+
aia_path = "https://vault.service.consul:8200/v1/pki-svc"
5+
}
6+
7+
resource "vault_pki_secret_backend_role" "acme" {
8+
backend = vault_mount.pki-svc.path
9+
name = "acme"
10+
ttl = 72 * 3600
11+
max_ttl = 72 * 3600
12+
allow_any_name = true
13+
no_store = false
14+
key_type = "any"
15+
}
16+
17+
resource "vault_pki_secret_backend_config_urls" "pki-svc" {
18+
backend = vault_mount.pki-svc.path
19+
issuing_certificates = ["{{cluster_aia_path}}/issuer/{{issuer_id}}/der"]
20+
crl_distribution_points = ["{{cluster_aia_path}}/issuer/{{issuer_id}}/crl/der"]
21+
ocsp_servers = ["{{cluster_path}}/ocsp"]
22+
enable_templating = true
23+
}
24+
25+
resource "vault_pki_secret_backend_config_acme" "acme" {
26+
backend = vault_mount.pki-svc.path
27+
enabled = true
28+
default_directory_policy = "role:${vault_pki_secret_backend_role.acme.name}"
29+
allowed_roles = [vault_pki_secret_backend_role.acme.name]
30+
allow_role_ext_key_usage = false
31+
dns_resolver = ""
32+
eab_policy = "not-required"
33+
}

mkosi.images/terraform/share/terraform/pki.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ resource "vault_mount" "pki-svc" {
2121
path = var.intermediate-pki-svc-path
2222
type = "pki"
2323
max_lease_ttl_seconds = var.intermediate-max-lease-ttl
24+
allowed_response_headers = [
25+
"Last-Modified",
26+
"Location",
27+
"Replay-Nonce",
28+
"Link"
29+
]
30+
passthrough_request_headers = ["If-Modified-Since"]
2431
}
2532

2633
resource "vault_mount" "pki-nodes" {

0 commit comments

Comments
 (0)