secureCodeBox/secureCodeBox

View on GitHub
hooks/generic-webhook/.helm-docs.gotmpl

Summary

Maintainability
Test Coverage
{{- /*
SPDX-FileCopyrightText: the secureCodeBox authors

SPDX-License-Identifier: Apache-2.0
*/ -}}

{{- define "extra.docsSection" -}}
---
title: "Generic WebHook"
category: "hook"
type: "integration"
state: "released"
usecase: "Publishes Scan Findings as WebHook."
---
{{- end }}

{{- define "extra.dockerDeploymentSection" -}}
## Supported Tags
- `latest`  (represents the latest stable release build)
- tagged releases, e.g. `3.0.0`, `2.9.0`, `2.8.0`, `2.7.0`
{{- end }}

{{- define "extra.chartAboutSection" -}}
## What is "Generic WebHook" Hook about?
Installing the Generic WebHook hook will add a ReadOnly Hook to your namespace which is capable of sending scan results containing `findings` to a given webhook url.

{{- end }}

{{- define "extra.scannerConfigurationSection" -}}{{- end }}

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

```bash
helm upgrade --install generic-webhook secureCodeBox/generic-webhook \
    --set="webhookUrl=http://http-webhook/hello-world"
```
Two authentication methods exist for the Generic WebHook Hook. You can either use  Basic authentication or API authentication.
The authentication method is set by creating the corresponding secret as follows:

##### Basic authentication:
    
```bash
kubectl create secret generic generic-webhook-credentials \
--from-literal=username='admin' \
--from-literal=password='ThisIsAPassword'
```
##### API authentication:

```bash
kubectl create secret generic generic-webhook-credentials \
--from-literal=headerName='X-Example-Header' \
--from-literal=headerValue='ThisIsAnAPIkeyValue'
```

Only one authentication method can be used at a time.

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.

This is usually done to reuse existing secrets.
```bash
helm upgrade --install generic-webhook secureCodeBox/generic-webhook \
--set="hook.authentication.apikey.headerNameKey=name"  \
--set="hook.authentication.apikey.headerValueKey=value"
```
{{- end }}

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