Skip to content

Commit 2a36c78

Browse files
committed
docs: add custom trust section
1 parent 2cc2af6 commit 2a36c78

2 files changed

Lines changed: 32 additions & 10 deletions

File tree

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,34 @@ 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+
In some cases, you may want to connect to a tool that uses a certificate from a certification authority (CA) that is not
36+
in the default trust store (e.g. a company-internal CA), which requires that you add custom trust to an existing trust
37+
store or replace the existing trust store with your own.
38+
39+
### Using a Custom-Built DefectDojo Image
40+
41+
When you are building your own container image for `django-DefectDojo`, you can simply add the certificates you would
42+
like to include as custom trust to the `docker/certs` path (see
43+
[Dockerfile.django](https://github.com/DefectDojo/django-DefectDojo/blob/861b617bfcb17cb5e858f46e31509134d0e98171/Dockerfile.django#L70))
44+
45+
### Using the Prebuilt DefectDojo Image
46+
47+
1. Create a new mounted volume where the new trust store will be added (ensures persistence).
48+
2. Create a new trust store
49+
1. Prepare a new PEM-encoded trust store file (`custom-cacerts.pem`).
50+
2. Optional, if you want to keep existing trust: Add the custom trust to the existing trust store
51+
1. Find the location of the existing trust store by running `python -m certifi` in the container
52+
2. Append your custom trust to the existing trust store by running
53+
`cat cacert.pem custom-cacerts.pem > extended-cacerts.pem`.
54+
***Important: The consequence of copying the existing trust store is that you will not receive any updates
55+
(added or removed CA certificates).***
56+
3. Copy the new trust store (`custom-cacerts.pem` or `extended-cacerts.pem`) to the mounted volume.
57+
4. Point the environment variable `REQUESTS_CA_BUNDLE` to the new trust store file.
58+
59+
> `REQUESTS_CA_BUNDLE` is an environment variable from the Python `requests` package. By default, it uses the trust
60+
> store provided by the `certifi` package. For more details, check the respective documentation
61+
> ([requests](https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification) or
62+
> [certifi](https://certifiio.readthedocs.io/en/latest/))

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.

0 commit comments

Comments
 (0)