Skip to content

Commit 61ce266

Browse files
committed
docs: add new page on custom trust
1 parent 3a4a6fd commit 61ce266

File tree

3 files changed

+42
-10
lines changed

3 files changed

+42
-10
lines changed

docs/content/supported_tools/parsers/api/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ Follow these steps to set up API importing:
2929
4. After this is done, you can import the findings on the `Product` page through
3030
`Findings -> Import Scan Results`. As the `Scan type`, select the related type
3131
(the `API Scan Configuration` created above) and click `Import`.
32+
33+
## Custom Trust
34+
35+
If you are connecting to any of these tools via HTTPS, the issuer of the certificate that is presented by
36+
the tool must be trusted.
37+
38+
For details, have a look at the [custom trust](../../custom_trust) documentation.

docs/content/supported_tools/parsers/api/sonarqube.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,4 @@ If using a version of SonarQube with multi-branch scanning, the branch to be sca
4444
be supplied in the `branch_tag` field at import/re-import time. If the branch does not exist,
4545
a notification will be generated in the alerts table, indicating that branch to be imported
4646
does not exist. If a branch name is not supplied during import/re-import, the default branch
47-
of the SonarQube project will be used.
48-
49-
## Custom Trust
50-
51-
If you are connecting to SonarQube via HTTPS, the issuer of the certificate that is presented by
52-
SonarQube must be trusted.
53-
54-
One way of achieving this is by defining the `REQUESTS_CA_BUNDLE` environment variable to point
55-
to a PEM-encoded certificate file in the container (e.g. `REQUESTS_CA_BUNDLE=/app/media/cacerts.pem`).
56-
To ensure the certificate is persisted, the file should be in a mounted volume.
47+
of the SonarQube project will be used.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "Custom Trust"
3+
toc_hide: true
4+
weight: 2
5+
---
6+
7+
In some cases, you may want to connect to a tool that uses a certificate from a certification authority (CA) that is not
8+
in the default trust store (e.g. a company-internal CA), which requires that you add custom trust to an existing trust
9+
store or replace the existing trust store with your own.
10+
11+
## Using a Custom-Built DefectDojo Image
12+
13+
When you are building your own container image for `django-DefectDojo`, you can simply add the certificates you would
14+
like to include as custom trust to the `docker/certs` path (see
15+
[Dockerfile.django](https://github.com/DefectDojo/django-DefectDojo/blob/861b617bfcb17cb5e858f46e31509134d0e98171/Dockerfile.django#L70))
16+
17+
## Using the Prebuilt DefectDojo Image
18+
19+
1. Create a new mounted volume where the new trust store will be added (ensures persistence).
20+
2. Create a new trust store
21+
1. Prepare a new PEM-encoded trust store file (`custom-cacerts.pem`).
22+
2. Optional, if you want to keep existing trust: Add the custom trust to the existing trust store
23+
1. Find the location of the existing trust store by running `python -m certifi` in the container
24+
2. Append your custom trust to the existing trust store by running
25+
`cat cacert.pem custom-cacerts.pem > extended-cacerts.pem`.
26+
***Important: The consequence of copying the existing trust store is that you will not receive any updates
27+
(added or removed CA certificates).***
28+
3. Copy the new trust store (`custom-cacerts.pem` or `extended-cacerts.pem`) to the mounted volume.
29+
4. Point the environment variable `REQUESTS_CA_BUNDLE` to the new trust store file.
30+
31+
> `REQUESTS_CA_BUNDLE` is an environment variable from the Python `requests` package. By default, it uses the trust
32+
> store provided by the `certifi` package. For more details, check the respective documentation
33+
> ([requests](https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification) or
34+
> [certifii](https://certifiio.readthedocs.io/en/latest/))

0 commit comments

Comments
 (0)