Skip to main content

Integrating A New Hook

In the secureCodeBox we created new Custom Resource Definitions (CRD) for Kubernetes to manage scanners (ScanType) and hooks (see Custom Resource Definitions). To add a new Hook you need to add a new ScanCompletionHook (see ScanCompletionHook).

In the secureCodeBox we use Helm Charts for all our Resources to make the installation of new scanners/hooks as easy as possible and enable us to install only the scanners/hooks we actually need. The directory structure of a hook Helm Chart will look something like this:

โ”œโ”€โ”€ Chart.yamlโ”œโ”€โ”€ Dockerfileโ”œโ”€โ”€ hook.jsโ”œโ”€โ”€ hook.test.jsโ”œโ”€โ”€ package.jsonโ”œโ”€โ”€ package-lock.jsonโ”œโ”€โ”€ README.mdโ”œโ”€โ”€ README.md.gotmplโ”œโ”€โ”€ templatesโ”‚ย ย  โ”œโ”€โ”€ finding-post-processing-hook.yamlโ”‚ย ย  โ”œโ”€โ”€ _helpers.tplโ”‚ย ย  โ””โ”€โ”€ NOTES.txtโ””โ”€โ”€ values.yaml

To create a new Helm Chart for your hook you can use the following command (replace new-hook with the name of the hook):

helm create new-hook

This command will create a new directory named new-hook and some template files provided by helm to simplify the creation of Helm Charts (see Helm | Getting Started).

The following pages describe the purpose of all files and how to configure them.