Skip to content

Commit 7c971cf

Browse files
InverseIntegralMarcosDY
authored andcommitted
Add warning when skipping TLS verification (spiffe#5058)
Signed-off-by: Matteo Kamm <[email protected]>
1 parent 27963a0 commit 7c971cf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

doc/plugin_server_keymanager_hashicorp_vault.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The plugin accepts the following configuration options:
1313
| namespace | string | | Name of the Vault namespace. This is only available in the Vault Enterprise. | `${VAULT_NAMESPACE}` |
1414
| transit_engine_path | string | | Path of the transit engine that stores the keys. | transit |
1515
| ca_cert_path | string | | Path to a CA certificate file used to verify the Vault server certificate. Only PEM format is supported. | `${VAULT_CACERT}` |
16-
| insecure_skip_verify | bool | | If true, vault client accepts any server certificates | false |
16+
| insecure_skip_verify | bool | | If true, vault client accepts any server certificates. Should only be used for test environments. | false |
1717
| cert_auth | struct | | Configuration for the Client Certificate authentication method | |
1818
| token_auth | struct | | Configuration for the Token authentication method | |
1919
| approle_auth | struct | | Configuration for the AppRole authentication method | |

pkg/server/plugin/keymanager/hashicorpvault/hashicorp_vault.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ func (p *Plugin) Configure(ctx context.Context, req *configv1.ConfigureRequest)
156156
return nil, status.Errorf(codes.InvalidArgument, "unable to decode configuration: %v", err)
157157
}
158158

159+
if config.InsecureSkipVerify {
160+
p.logger.Warn("TLS verification of Vault certificates is skipped. This is only recommended for test environments.")
161+
}
162+
159163
p.mu.Lock()
160164
defer p.mu.Unlock()
161165

0 commit comments

Comments
 (0)