-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into master-into-dev/2.38.2-2.39.0-dev
- Loading branch information
Showing
90 changed files
with
1,978 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -678,12 +678,12 @@ [email protected]: | |
dependencies: | ||
jquery ">= 1.0.0" | ||
|
||
jquery-ui@1.13.3: | ||
version "1.13.3" | ||
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.13.3.tgz#d9f5292b2857fa1f2fdbbe8f2e66081664eb9bc5" | ||
integrity sha512-D2YJfswSJRh/B8M/zCowDpNFfwsDmtfnMPwjJTyvl+CBqzpYwQ+gFYIbUUlzijy/Qvoy30H1YhoSui4MNYpRwA== | ||
jquery-ui@1.14.0: | ||
version "1.14.0" | ||
resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.0.tgz#b75d417826f0bab38125f907356d2e3313a9c6d5" | ||
integrity sha512-mPfYKBoRCf0MzaT2cyW5i3IuZ7PfTITaasO5OFLAQxrHuI+ZxruPa+4/K1OMNT8oElLWGtIxc9aRbyw20BKr8g== | ||
dependencies: | ||
jquery ">=1.8.0 <4.0.0" | ||
jquery ">=1.12.0 <5.0.0" | ||
|
||
[email protected]: | ||
version "1.4.1" | ||
|
@@ -699,7 +699,7 @@ jquery.hotkeys@jeresig/jquery.hotkeys#master: | |
version "0.2.0" | ||
resolved "https://codeload.github.com/jeresig/jquery.hotkeys/tar.gz/f24f1da275aab7881ab501055c256add6f690de4" | ||
|
||
"jquery@>= 1.0.0", jquery@>=1.7, jquery@>=1.7.0, "jquery@>=1.8.0 <4.0.0", jquery@^3.7.1: | ||
"jquery@>= 1.0.0", "jquery@>=1.12.0 <5.0.0", jquery@>=1.7, jquery@>=1.7.0, jquery@^3.7.1: | ||
version "3.7.1" | ||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" | ||
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: 'Upgrading to DefectDojo Version 2.39.x' | ||
toc_hide: true | ||
weight: -20240903 | ||
description: No special instructions. | ||
--- | ||
There are no special instructions for upgrading to 2.39.x. Check the [Release Notes](https://github.com/DefectDojo/django-DefectDojo/releases/tag/2.39.0) for the contents of the release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
docs/content/en/integrations/notification_webhooks/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: "Notification Webhooks (experimental)" | ||
description: "How to setup and use webhooks" | ||
weight: 7 | ||
chapter: true | ||
--- | ||
|
||
Webhooks are HTTP requests coming from the DefectDojo instance towards user-defined webserver which expects this kind of incoming traffic. | ||
|
||
## Transition graph: | ||
|
||
It is not unusual that in some cases webhook can not be performed. It is usually connected to network issues, server misconfiguration, or running upgrades on the server. DefectDojo needs to react to these outages. It might temporarily or permanently disable related endpoints. The following graph shows how it might change the status of the webhook definition based on HTTP responses (or manual user interaction). | ||
|
||
```mermaid | ||
flowchart TD | ||
START{{Endpoint created}} | ||
ALL{All states} | ||
STATUS_ACTIVE([STATUS_ACTIVE]) | ||
STATUS_INACTIVE_TMP | ||
STATUS_INACTIVE_PERMANENT | ||
STATUS_ACTIVE_TMP([STATUS_ACTIVE_TMP]) | ||
END{{Endpoint removed}} | ||
START ==> STATUS_ACTIVE | ||
STATUS_ACTIVE --HTTP 200 or 201 --> STATUS_ACTIVE | ||
STATUS_ACTIVE --HTTP 5xx <br>or HTTP 429 <br>or Timeout--> STATUS_INACTIVE_TMP | ||
STATUS_ACTIVE --Any HTTP 4xx response<br>or any other HTTP response<br>or non-HTTP error--> STATUS_INACTIVE_PERMANENT | ||
STATUS_INACTIVE_TMP -.After 60s.-> STATUS_ACTIVE_TMP | ||
STATUS_ACTIVE_TMP --HTTP 5xx <br>or HTTP 429 <br>or Timeout <br>within 24h<br>from the first error-->STATUS_INACTIVE_TMP | ||
STATUS_ACTIVE_TMP -.After 24h.-> STATUS_ACTIVE | ||
STATUS_ACTIVE_TMP --HTTP 200 or 201 --> STATUS_ACTIVE_TMP | ||
STATUS_ACTIVE_TMP --HTTP 5xx <br>or HTTP 429 <br>or Timeout <br>within 24h from the first error<br>or any other HTTP response or error--> STATUS_INACTIVE_PERMANENT | ||
ALL ==Activation by user==> STATUS_ACTIVE | ||
ALL ==Deactivation by user==> STATUS_INACTIVE_PERMANENT | ||
ALL ==Removal of endpoint by user==> END | ||
``` | ||
|
||
Notes: | ||
|
||
1. Transitions: | ||
- bold: manual changes by user | ||
- dotted: automated by celery | ||
- others: based on responses on webhooks | ||
1. Nodes: | ||
- Stadium-shaped: Active - following webhook can be sent | ||
- Rectangles: Inactive - performing of webhook will fail (and not retried) | ||
- Hexagonal: Initial and final states | ||
- Rhombus: All states (meta node to make the graph more readable) | ||
|
||
## Body and Headers | ||
|
||
The body of each request is JSON which contains data about related events like names and IDs of affected elements. | ||
Examples of bodies are on pages related to each event (see below). | ||
|
||
Each request contains the following headers. They might be useful for better handling of events by server this process events. | ||
|
||
```yaml | ||
User-Agent: DefectDojo-<version of DD> | ||
X-DefectDojo-Event: <name of the event> | ||
X-DefectDojo-Instance: <Base URL for DD instance> | ||
``` | ||
## Disclaimer | ||
This functionality is new and in experimental mode. This means Functionality might generate breaking changes in following DefectDojo releases and might not be considered final. | ||
However, the community is open to feedback to make this functionality better and transform it stable as soon as possible. | ||
## Roadmap | ||
There are a couple of known issues that are expected to be implemented as soon as core functionality is considered ready. | ||
- Support events - Not only adding products, product types, engagements, tests, or upload of new scans but also events around SLA | ||
- User webhook - right now only admins can define webhooks; in the future also users will be able to define their own | ||
- Improvement in UI - add filtering and pagination of webhook endpoints | ||
## Events | ||
<!-- Hugo automatically renders list of subpages here --> |
38 changes: 38 additions & 0 deletions
38
docs/content/en/integrations/notification_webhooks/engagement_added.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: "Event: engagement_added" | ||
weight: 3 | ||
chapter: true | ||
--- | ||
|
||
## Event HTTP header | ||
```yaml | ||
X-DefectDojo-Event: engagement_added | ||
``` | ||
## Event HTTP body | ||
```json | ||
{ | ||
"description": null, | ||
"engagement": { | ||
"id": 7, | ||
"name": "notif eng", | ||
"url_api": "http://localhost:8080/api/v2/engagements/7/", | ||
"url_ui": "http://localhost:8080/engagement/7" | ||
}, | ||
"product": { | ||
"id": 4, | ||
"name": "notif prod", | ||
"url_api": "http://localhost:8080/api/v2/products/4/", | ||
"url_ui": "http://localhost:8080/product/4" | ||
}, | ||
"product_type": { | ||
"id": 4, | ||
"name": "notif prod type", | ||
"url_api": "http://localhost:8080/api/v2/product_types/4/", | ||
"url_ui": "http://localhost:8080/product/type/4" | ||
}, | ||
"url_api": "http://localhost:8080/api/v2/engagements/7/", | ||
"url_ui": "http://localhost:8080/engagement/7", | ||
"user": null | ||
} | ||
``` |
32 changes: 32 additions & 0 deletions
32
docs/content/en/integrations/notification_webhooks/product_added.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: "Event: product_added" | ||
weight: 2 | ||
chapter: true | ||
--- | ||
|
||
## Event HTTP header | ||
```yaml | ||
X-DefectDojo-Event: product_added | ||
``` | ||
## Event HTTP body | ||
```json | ||
{ | ||
"description": null, | ||
"product": { | ||
"id": 4, | ||
"name": "notif prod", | ||
"url_api": "http://localhost:8080/api/v2/products/4/", | ||
"url_ui": "http://localhost:8080/product/4" | ||
}, | ||
"product_type": { | ||
"id": 4, | ||
"name": "notif prod type", | ||
"url_api": "http://localhost:8080/api/v2/product_types/4/", | ||
"url_ui": "http://localhost:8080/product/type/4" | ||
}, | ||
"url_api": "http://localhost:8080/api/v2/products/4/", | ||
"url_ui": "http://localhost:8080/product/4", | ||
"user": null | ||
} | ||
``` |
26 changes: 26 additions & 0 deletions
26
docs/content/en/integrations/notification_webhooks/product_type_added.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: "Event: product_type_added" | ||
weight: 1 | ||
chapter: true | ||
--- | ||
|
||
## Event HTTP header | ||
```yaml | ||
X-DefectDojo-Event: product_type_added | ||
``` | ||
## Event HTTP body | ||
```json | ||
{ | ||
"description": null, | ||
"product_type": { | ||
"id": 4, | ||
"name": "notif prod type", | ||
"url_api": "http://localhost:8080/api/v2/product_types/4/", | ||
"url_ui": "http://localhost:8080/product/type/4" | ||
}, | ||
"url_api": "http://localhost:8080/api/v2/product_types/4/", | ||
"url_ui": "http://localhost:8080/product/type/4", | ||
"user": null | ||
} | ||
``` |
Oops, something went wrong.