Skip to content

Commit b135c4c

Browse files
authored
Add support for log_level PKI SCEP configuration (#2525)
* Add support for log_level PKI SCEP configuration. * Bump to latest 1.20 version. * Add changelog entry.
1 parent c0a366a commit b135c4c

8 files changed

+22
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- "vault-enterprise:1.17.17-ent"
6868
- "vault-enterprise:1.18.10-ent"
6969
- "vault-enterprise:1.19.5-ent"
70-
- "vault-enterprise:1.20.0-ent"
70+
- "vault-enterprise:1.20.1-ent"
7171
- "vault:latest"
7272
services:
7373
vault:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ FEATURES:
55
* Add support for `root_password_ttl` in `vault_azure_secret_backend` resource. Requires Vault 1.15+ ([#2529](https://github.com/hashicorp/terraform-provider-vault/pull/2529))
66
* Add support for managed key parameters in the SSH CA config endpoint ([#2480](https://github.com/hashicorp/terraform-provider-vault/pull/2480))
77
* Add new resources `vault_oci_auth_backend` and `vault_oci_auth_backend_role` to manage OCI auth backend and roles. ([#1761](https://github.com/hashicorp/terraform-provider-vault/pull/1761))
8+
* Add support for `log_level` in `vault_pki_secret_backend_config_scep` resource. Requires Vault 1.20.1+ ([#2525](https://github.com/hashicorp/terraform-provider-vault/pull/2525))
89

910
BUGS:
1011
* Fix the tune block issue where it always updates unless field values match Vault server defaults

internal/consts/consts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const (
6767
FieldLastPassword = "last_password"
6868
FieldLastVaultRotation = "last_vault_rotation"
6969
FieldLocal = "local"
70+
FieldLogLevel = "log_level"
7071
FieldSealWrap = "seal_wrap"
7172
FieldExternalEntropyAccess = "external_entropy_access"
7273
FieldAWS = "aws"

vault/data_source_pki_secret_backend_config_scep.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ var pkiSecretBackendConfigScepDataSourceSchema = map[string]*schema.Schema{
9191
},
9292
},
9393
},
94+
consts.FieldLogLevel: {
95+
Type: schema.TypeString,
96+
Optional: true,
97+
Description: "The level of logging verbosity, affects only SCEP logs on this mount",
98+
},
9499
consts.FieldLastUpdated: {
95100
Type: schema.TypeString,
96101
Computed: true,

vault/resource_pki_secret_backend_config_scep.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ var pkiSecretBackendConfigScepResourceSchema = map[string]*schema.Schema{
106106
},
107107
},
108108
},
109+
consts.FieldLogLevel: {
110+
Type: schema.TypeString,
111+
Optional: true,
112+
Computed: true,
113+
Description: "The level of logging verbosity, affects only SCEP logs on this mount",
114+
},
109115
consts.FieldLastUpdated: {
110116
Type: schema.TypeString,
111117
Computed: true, // read-only property

vault/resource_pki_secret_backend_config_scep_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func TestAccPKISecretBackendConfigScep_Empty(t *testing.T) {
5656
resource.TestCheckResourceAttr(resourceBackend, consts.FieldExternalValidation+".#", "1"),
5757
resource.TestCheckResourceAttr(resourceBackend, consts.FieldExternalValidation+".0.%", "1"),
5858
resource.TestCheckResourceAttr(resourceBackend, consts.FieldExternalValidation+".0.intune.%", "0"),
59+
resource.TestCheckResourceAttr(resourceBackend, consts.FieldLogLevel, ""),
5960
resource.TestCheckResourceAttrSet(resourceBackend, consts.FieldLastUpdated),
6061

6162
// Validate we read back the data back as we did upon creation
@@ -75,6 +76,7 @@ func TestAccPKISecretBackendConfigScep_Empty(t *testing.T) {
7576
resource.TestCheckResourceAttr(dataName, consts.FieldExternalValidation+".#", "1"),
7677
resource.TestCheckResourceAttr(dataName, consts.FieldExternalValidation+".0.%", "1"),
7778
resource.TestCheckResourceAttr(dataName, consts.FieldExternalValidation+".0.intune.%", "0"),
79+
resource.TestCheckResourceAttr(dataName, consts.FieldLogLevel, ""),
7880
resource.TestCheckResourceAttrSet(dataName, consts.FieldLastUpdated),
7981
),
8082
},
@@ -132,6 +134,7 @@ resource "vault_pki_secret_backend_config_scep" "test" {
132134
allowed_encryption_algorithms = ["des-cbc", "3des-cbc"]
133135
allowed_digest_algorithms = ["sha-1"]
134136
restrict_ca_chain_to_issuer = true
137+
log_level = "trace"
135138
authenticators {
136139
cert = { "accessor" = "test", "cert_role" = "cert-role" }
137140
scep = { "accessor" = "auth-scep-accessor", "scep_role" = "scep-role"}
@@ -172,6 +175,7 @@ data "vault_pki_secret_backend_config_scep" "test" {
172175
resource.TestCheckResourceAttr(resourceBackend, consts.FieldExternalValidation+".0.intune.%", "2"),
173176
resource.TestCheckResourceAttr(resourceBackend, consts.FieldExternalValidation+".0.intune.client_id", "the client ID"),
174177
resource.TestCheckResourceAttr(resourceBackend, consts.FieldExternalValidation+".0.intune.tenant_id", "the tenant ID"),
178+
resource.TestCheckResourceAttr(resourceBackend, consts.FieldLogLevel, "trace"),
175179

176180
resource.TestCheckResourceAttr(dataName, consts.FieldBackend, backend),
177181
resource.TestCheckResourceAttr(dataName, consts.FieldEnabled, "true"),
@@ -195,6 +199,7 @@ data "vault_pki_secret_backend_config_scep" "test" {
195199
resource.TestCheckResourceAttr(dataName, consts.FieldExternalValidation+".0.intune.%", "2"),
196200
resource.TestCheckResourceAttr(dataName, consts.FieldExternalValidation+".0.intune.client_id", "the client ID"),
197201
resource.TestCheckResourceAttr(dataName, consts.FieldExternalValidation+".0.intune.tenant_id", "the tenant ID"),
202+
resource.TestCheckResourceAttr(dataName, consts.FieldLogLevel, "trace"),
198203
),
199204
},
200205
{

website/docs/d/pki_secret_backend_config_scep.html.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The following arguments are supported:
6262

6363
* `restrict_ca_chain_to_issuer` - If true, only return the issuer CA, otherwise the entire CA certificate chain will be returned if available from the PKI mount.
6464

65+
* `log_level` - The level of logging verbosity, affects only SCEP logs on this mount.
6566

6667
<a id="nestedatt--authenticators"></a>
6768
### Nested Schema for `authenticators`

website/docs/r/pki_secret_backend_config_scep.html.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ The following arguments are supported:
7272

7373
* `restrict_ca_chain_to_issuer` - (Optional) If true, only return the issuer CA, otherwise the entire CA certificate chain will be returned if available from the PKI mount.
7474

75+
* `log_level` - (Optional) The level of logging verbosity, affects only SCEP logs on this mount.
76+
7577

7678
<a id="nestedatt--authenticators"></a>
7779
### Nested Schema for `authenticators`

0 commit comments

Comments
 (0)