Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 606102e

Browse files
author
Christophe - CC4
committed
fix: change registration auth to approle
1 parent 847e470 commit 606102e

File tree

3 files changed

+19
-99
lines changed

3 files changed

+19
-99
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
resource "vault_auth_backend" "registration-cert" {
2-
path = "registration-cert"
3-
type = "cert"
1+
resource "vault_auth_backend" "registration" {
2+
type = "approle"
3+
path = "registration"
44
}
55

6-
resource "vault_cert_auth_backend_role" "registration-cert" {
7-
name = "registration-cert"
8-
backend = vault_auth_backend.registration-cert.path
6+
resource "vault_approle_auth_backend_role" "registration-role" {
7+
backend = vault_auth_backend.registration.path
8+
role_name = "registration-role"
9+
token_policies = ["devices-${var.domain}"]
910

10-
certificate = vault_pki_secret_backend_intermediate_set_signed.registration_intermediate.certificate
11-
allowed_organizational_units = ["Registration"]
12-
allowed_common_names = ["registration.${var.domain}"]
11+
token_ttl = 300
12+
token_max_ttl = 600
13+
}
14+
15+
resource "vault_approle_auth_backend_role_secret_id" "registration-secret-id" {
16+
backend = vault_auth_backend.registration.path
17+
role_name = vault_approle_auth_backend_role.registration-role.role_name
18+
}
1319

14-
token_ttl = 300
15-
token_max_ttl = 600
16-
token_policies = [vault_policy.devices-policy.name]
20+
resource "vault_approle_auth_backend_login" "login" {
21+
backend = vault_auth_backend.registration.path
22+
role_id = vault_approle_auth_backend_role.registration-role.role_id
23+
secret_id = vault_approle_auth_backend_role_secret_id.registration-secret-id.secret_id
1724
}

applications/modules/vault/ca_registration.tf

-49
This file was deleted.

applications/modules/vault/registration.tf

-38
This file was deleted.

0 commit comments

Comments
 (0)