API Pull
All parsers that use API pull have common basic configuration steps, but with different values.
Follow these steps to set up API importing:
Tool Configuration
- Configure the API authentication details by navigating to
Configuration -> Tool Configuration -> Add Tool Configuration. Enter aName, selecting the relatedTool TypeandAuthentication Type“API Key”. Paste your credentials into the proper fields based on the selected parser.
Product-Level Configuration
Navigate to
Products -> All Productsand select a product from the list.Click on
Settingsand selectAdd API Scan ConfigurationSelect the previously added
Tool Configurationand provide additional values based on the selected parser.After this is done, you can import the findings on the
Productpage throughFindings -> Import Scan Results. As theScan type, select the related type (theAPI Scan Configurationcreated above) and clickImport.
Custom Trust
In some cases, you may want to connect to a tool that uses a certificate from a certification authority (CA) that is not in the default trust store (e.g. a company-internal CA), which requires that you add custom trust to an existing trust store or replace the existing trust store with your own.
Using a Custom-Built DefectDojo Image
When you are building your own container image for django-DefectDojo, you can simply add the certificates you would
like to include as custom trust to the docker/certs path (see
Dockerfile.django)
Using the Prebuilt DefectDojo Image
- Create a new mounted volume where the new trust store will be added (ensures persistence).
- Create a new trust store
- Prepare a new PEM-encoded trust store file (
custom-cacerts.pem). - Optional, if you want to keep existing trust: Add the custom trust to the existing trust store
- Find the location of the existing trust store by running
python -m certifiin the container - Append your custom trust to the existing trust store by running
cat cacert.pem custom-cacerts.pem > extended-cacerts.pem.
Important: The consequence of copying the existing trust store is that you will not receive any updates (added or removed CA certificates).
- Find the location of the existing trust store by running
- Prepare a new PEM-encoded trust store file (
- Copy the new trust store (
custom-cacerts.pemorextended-cacerts.pem) to the mounted volume. - Point the environment variable
REQUESTS_CA_BUNDLEto the new trust store file.
REQUESTS_CA_BUNDLEis an environment variable from the Pythonrequestspackage. By default, it uses the trust store provided by thecertifipackage. For more details, check the respective documentation (requests or certifi)