Skip to content

Commit 625547e

Browse files
authored
Merge pull request #496 from secureCodeBox/documentation/local-dd-hook-setup
Added Documentation on How-To run DefectDojo Hook Locally
2 parents 8bc8f79 + 5053984 commit 625547e

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

hooks/persistence-defectdojo/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,29 @@ helm upgrade --install dd secureCodeBox/persistence-defectdojo \
136136
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images |
137137
| image.repository | string | `"docker.io/securecodebox/persistence-defectdojo"` | Hook image repository |
138138
| image.tag | string | `nil` | Container image tag |
139+
140+
## Running Locally from Source
141+
For Development, it can be useful to run the Hook locally. You can do so by following these steps:
142+
143+
1. Make sure you have access to a running [DefectDojo](https://github.com/DefectDojo/django-DefectDojo) Instance
144+
2. [Run a Scan](https://docs.securecodebox.io/docs/getting-started/first-scans) of your choice.
145+
3. Supply Download Links for the Scan Results (Raw Result and Findings.json). You can e.g., access them from the
146+
included [Minio Instance](https://docs.securecodebox.io/docs/getting-started/installation/#accessing-the-included-minio-instance)
147+
and upload them to a GitHub gist.
148+
149+
4. Set the following environment variables
150+
151+
- DEFECTDOJO_URL (e.g http://192.168.0.228:8080);
152+
- DEFECTDOJO_USERNAME (e.g admin)
153+
- DEFECTDOJO_APIKEY= (e.g. b09c.., can be fetched from the DefectDojo Settings)
154+
- IS_DEV=true
155+
- SCAN_NAME (e.g nmap-scanme.nmap.org, must be set exactly to the name of the scan used in step 2)
156+
157+
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}.
158+
See the code snippet below. You have to adjust the filename of the jar for other versions than the '0.1.0-SNAPSHOT'.
159+
Also you will need to change the download URLs for the Raw Result and Findings to the ones from Step 3.
160+
161+
```bash
162+
./gradlew build
163+
java -jar build/libs/defectdojo-persistenceprovider-0.1.0-SNAPSHOT.jar https://gist.githubusercontent.com/.../scanme-nmap-org.xml https://gist.githubusercontent.com/.../nmap-findings.json https://httpbin.org/put https://httpbin.org/put
164+
```

hooks/persistence-defectdojo/README.md.gotmpl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,29 @@ helm upgrade --install dd secureCodeBox/persistence-defectdojo \
132132
## Chart Configuration
133133

134134
{{ template "chart.valuesTable" . }}
135+
136+
## Running Locally from Source
137+
For Development, it can be useful to run the Hook locally. You can do so by following these steps:
138+
139+
1. Make sure you have access to a running [DefectDojo](https://github.com/DefectDojo/django-DefectDojo) Instance
140+
2. [Run a Scan](https://docs.securecodebox.io/docs/getting-started/first-scans) of your choice.
141+
3. Supply Download Links for the Scan Results (Raw Result and Findings.json). You can e.g., access them from the
142+
included [Minio Instance](https://docs.securecodebox.io/docs/getting-started/installation/#accessing-the-included-minio-instance)
143+
and upload them to a GitHub gist.
144+
145+
4. Set the following environment variables
146+
147+
- DEFECTDOJO_URL (e.g http://192.168.0.228:8080);
148+
- DEFECTDOJO_USERNAME (e.g admin)
149+
- DEFECTDOJO_APIKEY= (e.g. b09c.., can be fetched from the DefectDojo Settings)
150+
- IS_DEV=true
151+
- SCAN_NAME (e.g nmap-scanme.nmap.org, must be set exactly to the name of the scan used in step 2)
152+
153+
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}.
154+
See the code snippet below. You have to adjust the filename of the jar for other versions than the '0.1.0-SNAPSHOT'.
155+
Also you will need to change the download URLs for the Raw Result and Findings to the ones from Step 3.
156+
157+
```bash
158+
./gradlew build
159+
java -jar build/libs/defectdojo-persistenceprovider-0.1.0-SNAPSHOT.jar https://gist.githubusercontent.com/.../scanme-nmap-org.xml https://gist.githubusercontent.com/.../nmap-findings.json https://httpbin.org/put https://httpbin.org/put
160+
```

0 commit comments

Comments
 (0)