Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 4 additions & 24 deletions docs/content/en/open_source/notification_webhooks/how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,10 @@ Webhooks are HTTP requests coming from the DefectDojo instance towards a user-de

It is not unusual that in some cases a webhook can not be delivered. 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).

```kroki {type=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
```
<!-- Replaced the kroki rendering with a screenshot to avoid failures in GHA -->
<!-- The transition state diagram is located here: docs/content/en/open_source/notification_webhooks/transition-state -->
Comment thread
Maffooch marked this conversation as resolved.
<!-- Github Issue here: https://github.com/DefectDojo/django-DefectDojo/issues/13457 -->
![image](images/webhook-state-transition-flow.png)

Notes:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```kroki {type=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
```