Skip to content

Commit ea0e9d9

Browse files
committed
#1664 Added documentation explaining how to configure the generic-webhook
Signed-off-by: Ilyes Ben Dlala <ilyes.bendlala@iteratec.com>
1 parent 48bee5b commit ea0e9d9

2 files changed

Lines changed: 70 additions & 5 deletions

File tree

‎hooks/generic-webhook/.helm-docs.gotmpl‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,40 @@ Installing the Generic WebHook hook will add a ReadOnly Hook to your namespace w
3030

3131
{{- define "extra.chartConfigurationSection" -}}
3232
## Additional Chart Configurations
33+
The webhook URL is set as follows:
3334

34-
> ✍ This documentation is currently work-in-progress.
35+
```bash
36+
helm upgrade --install generic-webhook secureCodeBox/generic-webhook \
37+
--set="webhookUrl=http://http-webhook/hello-world"
38+
```
39+
Two authentication methods exist for the Generic WebHook Hook. You can either use Basic authentication or API authentication.
40+
The authentication method is set by creating the corresponding secret as follows:
41+
42+
##### Basic authentication:
43+
44+
```bash
45+
kubectl create secret generic generic-webhook-credentials \
46+
--from-literal=username='admin' \
47+
--from-literal=password='ThisIsAPassword'
48+
```
49+
##### API authentication:
50+
51+
```bash
52+
kubectl create secret generic generic-webhook-credentials \
53+
--from-literal=headerName='X-Example-Header' \
54+
--from-literal=headerValue='ThisIsAnAPIkeyValue'
55+
```
56+
57+
Only one authentication method can be used at a time.
58+
59+
The keys for your secret mapping can also be renamed if necessary, for example `headerName` and `headerValue` can be renamed to `name` and `value` respectively.
60+
61+
This is usually done to reuse existing secrets.
62+
```bash
63+
helm upgrade --install generic-webhook secureCodeBox/generic-webhook \
64+
--set="hook.authentication.apikey.headerNameKey=name" \
65+
--set="hook.authentication.apikey.headerValueKey=value"
66+
```
3567
{{- end }}
3668

3769
{{- define "extra.scannerLinksSection" -}}

‎hooks/generic-webhook/README.md‎

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,50 @@ helm upgrade --install generic-webhook secureCodeBox/generic-webhook
4848
Kubernetes: `>=v1.11.0-0`
4949

5050
## Additional Chart Configurations
51+
The webhook URL is set as follows:
5152

52-
> ✍ This documentation is currently work-in-progress.
53+
```bash
54+
helm upgrade --install generic-webhook secureCodeBox/generic-webhook \
55+
--set="webhookUrl=http://http-webhook/hello-world"
56+
```
57+
Two authentication methods exist for the Generic WebHook Hook. You can either use Basic authentication or API authentication.
58+
The authentication method is set by creating the corresponding secret as follows:
59+
60+
##### Basic authentication:
61+
62+
```bash
63+
kubectl create secret generic generic-webhook-credentials \
64+
--from-literal=username='admin' \
65+
--from-literal=password='ThisIsAPassword'
66+
```
67+
##### API authentication:
68+
69+
```bash
70+
kubectl create secret generic generic-webhook-credentials \
71+
--from-literal=headerName='X-Example-Header' \
72+
--from-literal=headerValue='ThisIsAnAPIkeyValue'
73+
```
74+
75+
Only one authentication method can be used at a time.
76+
77+
The keys for your secret mapping can also be renamed if necessary, for example `headerName` and `headerValue` can be renamed to `name` and `value` respectively.
78+
79+
This is usually done to reuse existing secrets.
80+
```bash
81+
helm upgrade --install generic-webhook secureCodeBox/generic-webhook \
82+
--set="hook.authentication.apikey.headerNameKey=name" \
83+
--set="hook.authentication.apikey.headerValueKey=value"
84+
```
5385

5486
## Values
5587

5688
| Key | Type | Default | Description |
5789
|-----|------|---------|-------------|
5890
| hook.affinity | object | `{}` | Optional affinity settings that control how the hook job is scheduled (see: https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/) |
59-
| hook.authentication | object | `{"apikey":{"headerName":"X-Example-Header","headerValue":"example","userSecret":"generic-webhook-credentials"},"basic":{"passwordKey":"password","userSecret":"generic-webhook-credentials","usernameKey":"username"}}` | Optional basic authentication credentials or apikey |
60-
| hook.authentication.apikey.headerName | string | `"X-Example-Header"` | Customize header name as per your needs ex: X-Api-Key |
61-
| hook.authentication.apikey.userSecret | string | `"generic-webhook-credentials"` | Link a pre-existing generic secret with `usernameKey` and `passwordKey` key / value pairs |
91+
| hook.authentication | object | `{"apikey":{"headerNameKey":"headerName","headerValueKey":"headerValue","userSecret":"generic-webhook-credentials"},"basic":{"passwordKey":"password","userSecret":"generic-webhook-credentials","usernameKey":"username"}}` | Optional basic authentication credentials or apikey |
92+
| hook.authentication.apikey.headerNameKey | string | `"headerName"` | Name of the header name key in the `userSecret` secret. Use this if you already have a secret with different key / value pairs |
93+
| hook.authentication.apikey.headerValueKey | string | `"headerValue"` | Name of the header value key in the `userSecret` secret. Use this if you already have a secret with different key / value pairs |
94+
| hook.authentication.apikey.userSecret | string | `"generic-webhook-credentials"` | Link a pre-existing generic secret with `headerNameKey` and `headerValueKey` key / value pairs |
6295
| hook.authentication.basic.passwordKey | string | `"password"` | Name of the password key in the `userSecret` secret. Use this if you already have a secret with different key / value pairs |
6396
| hook.authentication.basic.userSecret | string | `"generic-webhook-credentials"` | Link a pre-existing generic secret with `usernameKey` and `passwordKey` key / value pairs |
6497
| hook.authentication.basic.usernameKey | string | `"username"` | Name of the username key in the `userSecret` secret. Use this if you already have a secret with different key / value pairs |

0 commit comments

Comments
 (0)