Skip to content

Commit 1c8957b

Browse files
committed
feat: doku and fixes
Signed-off-by: Kai Fink <[email protected]>
1 parent eafff3a commit 1c8957b

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

docs/backends.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ AVP_USERNAME: Your Username
117117
AVP_PASSWORD: Your Password
118118
```
119119
120+
##### Certificate Authentication
121+
For Certificate Authentication, these are the required parameters:
122+
```
123+
VAULT_ADDR: Your HashiCorp Vault Address
124+
AVP_TYPE: vault
125+
AVP_AUTH_TYPE: certificate
126+
AVP_CERT: Your client certificate
127+
AVP_KEY: Your client key
128+
```
129+
120130
##### Examples
121131
122132
###### Path Annotation

docs/config.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ We support all the backend specific environment variables each backend's SDK wil
7272
We also support these AVP specific variables:
7373

7474
| Name | Description | Notes |
75-
| -------------------------- |-----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
75+
|----------------------------|-----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
7676
| AVP_TYPE | The type of Vault backend | Supported values: `vault`, `ibmsecretsmanager`, `awssecretsmanager`, `gcpsecretmanager`, `yandexcloudlockbox` and `1passwordconnect` |
7777
| AVP_KV_VERSION | The vault secret engine | Supported values: `1` and `2` (defaults to 2). KV_VERSION will be ignored if the `avp.kubernetes.io/kv-version` annotation is present in a YAML resource. |
78-
| AVP_AUTH_TYPE | The type of authentication | Supported values: vault: `approle, github, k8s, token`. Only honored for `AVP_TYPE` of `vault` |
78+
| AVP_AUTH_TYPE | The type of authentication | Supported values: vault: `approle, github, k8s, token, certificate`. Only honored for `AVP_TYPE` of `vault` |
7979
| AVP_GITHUB_TOKEN | Github token | Required with `AUTH_TYPE` of `github` |
8080
| AVP_ROLE_ID | Vault AppRole Role_ID | Required with `AUTH_TYPE` of `approle` |
8181
| AVP_SECRET_ID | Vault AppRole Secret_ID | Required with `AUTH_TYPE` of `approle` |
@@ -90,7 +90,8 @@ We also support these AVP specific variables:
9090
| AVP_YCL_KEY_ID | Yandex Cloud Lockbox service account Key ID | Required with `TYPE` of `yandexcloudlockbox` |
9191
| AVP_YCL_PRIVATE_KEY | Yandex Cloud Lockbox service account private key | Required with `TYPE` of `yandexcloudlockbox` |
9292
| AVP_PATH_VALIDATION | Regular Expression to validate the Vault path | Optional. Can be used for e.g. to prevent path traversals. |
93-
93+
| AVP_CERT | Your Vault client certificate | Required with `AUTH_TYPE`of `certificate` |
94+
| AVP_KEY | Your Vault client key | Required with `AUTH_TYPE`of `certificate` |
9495
### Full List of Supported Annotation
9596

9697
We support several different annotations that can be used inside a kubernetes resource. These annotations will override any corresponding configuration set via Environment Variable or Configuration File.

pkg/auth/vault/certificate.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,18 @@ func (a *CertificateAuth) Authenticate(vaultClient *api.Client) error {
6262
}
6363
defer os.Remove(tempKey.Name())
6464

65+
// Clone Client with new TLS Settings
6566
apiClientConfig := vaultClient.CloneConfig()
6667

67-
/*tlsConfig := &api.TLSConfig{
68+
tlsConfig := &api.TLSConfig{
6869
ClientKey: tempKey.Name(),
6970
ClientCert: tempCrt.Name(),
7071
}
7172

7273
err = apiClientConfig.ConfigureTLS(tlsConfig)
7374
if err != nil {
7475
return err
75-
}*/
76+
}
7677

7778
certVaultClient, err := api.NewClient(apiClientConfig)
7879

0 commit comments

Comments
 (0)