You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hooks/persistence-defectdojo/README.md
+59-59Lines changed: 59 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,27 +56,6 @@ This hook reads only from _raw findings_ and **not** from _secureCodeBox finding
56
56
57
57
For scan types which are not supported by _DefectDojo_, the generic importer is used, which will result in a less sophisticated display of the results and fewer features inside _DefectDojo_. In the worst case, it can lead to some findings being lost - see the note below.
58
58
59
-
:::note
60
-
A big amount of findings may require higher resource limits. Changing them may be required to avoid OOM errors. The default values are:
61
-
62
-
```yaml
63
-
requests: {
64
-
cpu: "200m",
65
-
memory: "100Mi"
66
-
},
67
-
limits: {
68
-
cpu: "400m",
69
-
memory: "200Mi"
70
-
}
71
-
```
72
-
73
-
For example, to set the memory limit to 512Mi, we run the following command:
Be careful when using the _DefectDojo Hook_ in combination with other _ReadAndWrite Hooks_. By default, the _secureCodeBox_ makes no guarantees about the execution order of multiple ReadAndWrite hooks, they can be executed in any order. This can lead to "lost update" problems as the _DefectDojo_ hook will overwrite all findings, which disregards the results of previously run ReadAndWrite hooks. ReadOnly hooks work fine with the _DefectDojo_ hook as they are always executed after ReadAndWrite Hooks. If you want to control the order of execution of the different hooks, take a look at the [hook priority documentation](https://www.securecodebox.io/docs/how-tos/hooks#hook-order) (supported with secureCodeBox 3.4.0 and later).
82
61
:::
@@ -85,29 +64,6 @@ Be careful when using the _DefectDojo Hook_ in combination with other _ReadAndWr
85
64
The _DefectDojo_ hook will send all scan results to _DefectDojo_, including those for which _DefectDojo_ does not have native support. In this case, _DefectDojo_ may incorrectly deduplicate findings, which can in some cases [lead to incomplete imports and even data loss](https://github.com/DefectDojo/django-DefectDojo/issues/5312). You can set the hook to read-only mode, which will prevent it from writing the results back to _secureCodeBox_ (`--set defectdojo.syncFindingsBack=false` during installation of the hook) if you want to rule out any data loss inside _secureCodeBox_, but this will not prevent the incorrect deduplication from affecting the data you see inside _DefectDojo_ (for this, you will need to [contribute a parser to DefectDojo](https://defectdojo.github.io/django-DefectDojo/contributing/how-to-write-a-parser/)). You can also selectively disable the _DefectDojo_ hook for certain scans using the [hook selector feature](https://www.securecodebox.io/docs/how-tos/hooks#hook-selector) (supported with _secureCodeBox_ 3.4.0 and later).
86
65
:::
87
66
88
-
### Running _Persistence DefectDojo Hook_ Locally from Source
89
-
90
-
For development purposes, it can be useful to run this hook locally. You can do so by following these steps:
91
-
92
-
1. Make sure you have access to a running [DefectDojo](https://github.com/DefectDojo/django-DefectDojo) instance.
93
-
2.[Run a Scan](https://www.securecodebox.io/docs/getting-started/first-scans) of your choice.
94
-
3. Supply Download Links for the Scan Results (Raw Result and Findings.json). You can access them from the
95
-
included [Minio Instance](https://www.securecodebox.io/docs/getting-started/installation/#accessing-the-included-minio-instance)
96
-
and upload them to a GitHub Gist.
97
-
4. Set the following environment variables:
98
-
-`DEFECTDOJO_URL`: URL to your DefectDojo server, e.g `DEFECTDOJO_URL="http://192.168.0.1:8080"`. (Required by _defectdojo-client-java_ lib.)
99
-
-`DEFECTDOJO_USERNAME`: User you want to use to import findings, e.g `DEFECTDOJO_USERNAME="admin"`. (Required by _defectdojo-client-java_ lib.)
100
-
-`DEFECTDOJO_APIKEY`: API key, e.g. `DEFECTDOJO_APIKEY="..."` (Can be fetched from the _DefectDojo_ API information page). (Required by _defectdojo-client-java_ lib.)
101
-
-`DEFECTDOJO_IS_DEV`: To enable dev mode, which loads a k8s config from `~/.kube/config`, e.g. `DEFECTDOJO_IS_DEV="true"`.
102
-
-`SCAN_NAME`: (optional) For mocking purpose when debugging locally, e.g `SCAN_NAME="nmap-scanme.nmap.org"`. Must be set exactly to the name of the scan used in step 2. Typically, this is set automatically by _secureCodeBox_.
103
-
-`NAMESPACE`: (optional) For mocking purpose when debugging locally, e.g `NAMESPACE=my-namespace`. Typically, this is set automatically by _secureCodeBox_.
104
-
5. Build the jar with gradle and run it with the following CLI arguments: \{Raw Result Download URL\}\{Findings Download URL\}\{Raw Result Upload URL\}\{Findings Upload URL\}. See the code snippet below. You have to adjust the filename of the jar. Also, you will need to change the download URLs for the Raw Result and Findings to the ones from Step 3.
The hook will automatically import the scan results into an engagement in _DefectDojo_. If the engagement doesn't exist the hook will create the engagement (CI/CD engagement) and all objects required for it (product & product type). The hook will then pull the imported information from _DefectDojo_ and use them to replace the findings inside _secureCodeBox_.
135
-
136
-
In case you use a _DefectDojo_ instance with a self-signed root CA, upgrade the hook with:
90
+
### Configuring Where In DefectDojo Results Are Ingested To
After, you can update `/etc/ssl/certs/java/cacerts` with your certificate.
92
+
The hook will automatically import the scan results into an engagement in _DefectDojo_. If the engagement doesn't exist the hook will create the engagement (CI/CD engagement) and all objects required for it (product & product type). The hook will then pull the imported information from _DefectDojo_ and use them to replace the findings inside _secureCodeBox_.
146
93
147
94
You don't need any configuration for that to work, the hook will infer engagement & product names from the scan name. If you want more control over the names or add additional meta information like the version of the tested software you can add these via annotation to the scan. See examples below.
148
95
@@ -228,7 +175,6 @@ _DefectDojo_ >2.0.0 refined their user access rights, allowing you to restrict t
228
175
229
176
#### Limitations of the Low Privileged Mode
230
177
231
-
- Instead of the username, the userId **must** be configured as the low privileged can't use the users list api to look up its own userId.
232
178
- The configured product type must exist beforehand as the low privileged user isn't permitted to create a new one
233
179
- The hook will not create / link the engagement to the _secureCodeBox_ orchestration engine tool type.
234
180
- The low privileged user must have at least the `Maintainer` role in the configured product type.
## Assinging more resources (CPU/Memory) to the Hook
263
+
264
+
:::note
265
+
When ingesting a large amount of findings into DefectDojo, you may require higher resource limits. Changing them may be required to avoid OOM errors. The default values are:
266
+
:::
267
+
```yaml
268
+
requests:
269
+
cpu: "200m"
270
+
memory: "100Mi"
271
+
limits:
272
+
cpu: "400m"
273
+
memory: "200Mi"
274
+
```
275
+
276
+
For example, to set the memory limit to 512Mi, we run the following command:
After, you can update `/etc/ssl/certs/java/cacerts` with your certificate.
294
+
295
+
## Running _Persistence DefectDojo Hook_ Locally from Source
296
+
297
+
For development purposes, it can be useful to run this hook locally. You can do so by following these steps:
298
+
299
+
1. Make sure you have access to a running [DefectDojo](https://github.com/DefectDojo/django-DefectDojo) instance.
300
+
2.[Run a Scan](https://www.securecodebox.io/docs/getting-started/first-scans) of your choice.
301
+
3. Supply Download Links for the Scan Results (Raw Result and Findings.json). You can access them from the
302
+
included [Minio Instance](https://www.securecodebox.io/docs/getting-started/installation/#accessing-the-included-minio-instance)
303
+
and upload them to a GitHub Gist.
304
+
4. Set the following environment variables:
305
+
-`DEFECTDOJO_URL`: URL to your DefectDojo server, e.g `DEFECTDOJO_URL="http://192.168.0.1:8080"`. (Required by _defectdojo-client-java_ lib.)
306
+
-`DEFECTDOJO_APIKEY`: API key, e.g. `DEFECTDOJO_APIKEY="..."` (Can be fetched from the _DefectDojo_ API information page). (Required by _defectdojo-client-java_ lib.)
307
+
-`DEFECTDOJO_IS_DEV`: To enable dev mode, which loads a k8s config from `~/.kube/config`, e.g. `DEFECTDOJO_IS_DEV="true"`.
308
+
-`SCAN_NAME`: (optional) For mocking purpose when debugging locally, e.g `SCAN_NAME="nmap-scanme.nmap.org"`. Must be set exactly to the name of the scan used in step 2. Typically, this is set automatically by _secureCodeBox_.
309
+
-`NAMESPACE`: (optional) For mocking purpose when debugging locally, e.g `NAMESPACE=my-namespace`. Typically, this is set automatically by _secureCodeBox_.
310
+
5. Build the jar with gradle and run it with the following CLI arguments: \{Raw Result Download URL\}\{Findings Download URL\}\{Raw Result Upload URL\}\{Findings Upload URL\}. See the code snippet below. You have to adjust the filename of the jar. Also, you will need to change the download URLs for the Raw Result and Findings to the ones from Step 3.
0 commit comments