|
2 | 2 |
|
3 | 3 | ## Developing the SCB Operator |
4 | 4 |
|
| 5 | +### Prerequisites |
| 6 | + |
| 7 | +#### Golang |
| 8 | + |
| 9 | +The operator is written in Golang. |
| 10 | +To build the operator you will need to install [Go](https://golang.org/). |
| 11 | + |
| 12 | +#### Minikube or Kind |
| 13 | + |
| 14 | +For local development we recommend to use [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) or [kind](https://github.com/kubernetes-sigs/kind). |
| 15 | +Both projects will enable you to run a local kubernetes cluster on your development machine. |
| 16 | + |
| 17 | +#### Operating your local kubernetes cluster |
| 18 | + |
| 19 | +To operate your (local) kubernetes cluster you will need to install [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) and [helm](https://helm.sh/) |
| 20 | + |
| 21 | +#### Minio |
| 22 | + |
| 23 | +For your local development you will need a S3 compatible storage. |
| 24 | +We would recommend to use [Minio](https://min.io/download#/) inside a podman or docker container. |
| 25 | + |
| 26 | +```bash |
| 27 | +podman run --name minio -p 9000:9000 minio/minio server /data |
| 28 | +``` |
| 29 | + |
| 30 | +In the Minio management GUI you will need to add a new bucket for the operator. |
| 31 | +The default credentials for your minio instance are *minioadmin:minioadmin*. |
| 32 | +You might change those. |
| 33 | + |
| 34 | +After setting up your bucket you will need to specify some environment variables to enable the operator to use the bucket. |
| 35 | + |
| 36 | +```bash |
| 37 | +$ export S3_ACCESS_KEY="your-minio-access-key" |
| 38 | +$ export S3_SECRET_KEY="your-minio-secret-key" |
| 39 | +$ export S3_BUCKET="name-of-your-bucket" |
| 40 | +$ export S3_USE_SSL="false" # This ensures that the operator will connect even without HTTPS |
| 41 | +$ export S3_ENDPOINT="<your.local.ip1address>:9000/" |
| 42 | +``` |
| 43 | + |
| 44 | +### Build and run the operator |
| 45 | + |
| 46 | +To build an run the operator you can simply execute *make* in the root directory of this repository. |
| 47 | + |
| 48 | +```bash |
| 49 | +$ make |
| 50 | +``` |
| 51 | + |
| 52 | +To run the operator locally you can simply execute *make run* |
| 53 | + |
| 54 | +*NOTICE:* You will need to uninstall the operator from your local cluster first or it will result in undefined behavior! |
| 55 | + |
| 56 | +```bash |
| 57 | +$ make run |
| 58 | +``` |
| 59 | + |
5 | 60 | ## How to a new security scanner |
6 | 61 |
|
7 | 62 | ### ScanType Definition |
|
15 | 70 | ### Hook SDK |
16 | 71 |
|
17 | 72 | # Guidelines |
| 73 | + |
18 | 74 | ## Coding Guidelines |
19 | 75 |
|
20 | 76 | ### JSON |
| 77 | + |
21 | 78 | We're using snake_case (lower case) for json attributes. If an enum type is used as attribute its converted to lower case. If it's an value it's always used UPPERCASE. This is to hold the attribute api consistent, but make shure Enums are recognized as enums. |
22 | 79 |
|
23 | 80 | ```json |
|
0 commit comments