Skip to content

Commit 298bb1b

Browse files
authored
[doc] various updates (#14484)
* implement lychee * pass unit tests * update contribution guidelines for docs * [doc] close_old_findings diff between import types * remove usage docs from open_source/archive * move docs archive up a folder * rules engine is pro only * create a single notification_webhooks article * mv remaining open_source articles * chore: normalize line endings to LF per .gitattributes * fix links * remove redundant upgrade file
1 parent ee5f04b commit 298bb1b

40 files changed

Lines changed: 724 additions & 1532 deletions

docs/content/admin/notifications/about_notifications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ For more information about this behavior see the [related pull request #9699](ht
7575

7676
### Webhooks (experimental)
7777

78-
DefectDojo also supports webhooks that follow the same events as other notifications (you can be notified in the same situations). Details about setup are described in [related page](/open_source/notification_webhooks/how_to).
78+
DefectDojo also supports webhooks that follow the same events as other notifications (you can be notified in the same situations). Details about setup are described in [the related page](/automation/api/notification_webhooks/).

docs/content/admin/sso/OS__ldap.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
title: "LDAP Authentication"
3+
description: "Authenticate users via LDAP by building custom Docker images"
4+
weight: 20
5+
audience: opensource
6+
aliases:
7+
- /en/open_source/ldap-authentication
8+
---
9+
10+
**This feature is experimental, and is not implemented in DefectDojo Pro**.
11+
12+
DefectDojo does not support LDAP authentication out of the box. However, since DefectDojo is built on Django, LDAP can be added by building your own Docker images and modifying a small number of configuration files.
13+
14+
## Files to Modify
15+
16+
- `Dockerfile.django-*`
17+
- `Dockerfile.nginx-*`
18+
- `requirements.txt`
19+
- `local_settings.py`
20+
- `docker-compose.yml` *(optional — for passing secrets via environment variables)*
21+
22+
## Dockerfile Modifications
23+
24+
In both `Dockerfile.django-alpine` and `Dockerfile.nginx-alpine`, add the following to the `apk add` layer:
25+
26+
```bash
27+
openldap-dev \
28+
cyrus-sasl-dev \
29+
```
30+
31+
In `Dockerfile.django-debian`, add the following to the `apt-get install` layer:
32+
33+
```bash
34+
libldap2-dev \
35+
libsasl2-dev \
36+
ldap-utils \
37+
```
38+
39+
## requirements.txt
40+
41+
Check [pypi.org](https://pypi.org) for the latest versions at the time of implementation, then add:
42+
43+
```
44+
python-ldap==3.4.5
45+
django-auth-ldap==5.2.0
46+
```
47+
48+
- [python-ldap](https://pypi.org/project/python-ldap/)
49+
- [django-auth-ldap](https://pypi.org/project/django-auth-ldap/)
50+
51+
## local_settings.py
52+
53+
Find the settings file (see `/dojo/settings/settings.py` for instructions on using `local_settings.py`) and make the following additions.
54+
55+
At the top of the file:
56+
57+
```python
58+
import ldap
59+
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
60+
import environ
61+
```
62+
63+
Add LDAP variables to the `env` dict:
64+
65+
```python
66+
# LDAP
67+
env = environ.FileAwareEnv(
68+
DD_LDAP_SERVER_URI=(str, 'ldap://ldap.example.com'),
69+
DD_LDAP_BIND_DN=(str, ''),
70+
DD_LDAP_BIND_PASSWORD=(str, ''),
71+
)
72+
```
73+
74+
Then add the LDAP settings beneath the `env` dict:
75+
76+
```python
77+
AUTH_LDAP_SERVER_URI = env('DD_LDAP_SERVER_URI')
78+
AUTH_LDAP_BIND_DN = env('DD_LDAP_BIND_DN')
79+
AUTH_LDAP_BIND_PASSWORD = env('DD_LDAP_BIND_PASSWORD')
80+
81+
AUTH_LDAP_USER_SEARCH = LDAPSearch(
82+
"ou=Groups,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"
83+
)
84+
85+
AUTH_LDAP_USER_ATTR_MAP = {
86+
"first_name": "givenName",
87+
"last_name": "sn",
88+
"email": "mail",
89+
}
90+
```
91+
92+
Customise all search variables to match your organisation's LDAP configuration.
93+
94+
### Optional: Group Controls
95+
96+
```python
97+
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
98+
"dc=example,dc=com",
99+
ldap.SCOPE_SUBTREE,
100+
"(objectClass=groupOfNames)",
101+
)
102+
AUTH_LDAP_GROUP_TYPE = GroupOfNamesType(name_attr="cn")
103+
104+
AUTH_LDAP_REQUIRE_GROUP = "cn=DD_USER_ACTIVE,ou=Groups,dc=example,dc=com"
105+
106+
AUTH_LDAP_USER_FLAGS_BY_GROUP = {
107+
"is_active": "cn=DD_USER_ACTIVE,ou=Groups,dc=example,dc=com",
108+
"is_staff": "cn=DD_USER_STAFF,ou=Groups,dc=example,dc=com",
109+
"is_superuser": "cn=DD_USER_ADMIN,ou=Groups,dc=example,dc=com",
110+
}
111+
```
112+
113+
Finally, add `django_auth_ldap.backend.LDAPBackend` to `AUTHENTICATION_BACKENDS`:
114+
115+
```python
116+
AUTHENTICATION_BACKENDS = (
117+
'django_auth_ldap.backend.LDAPBackend',
118+
'django.contrib.auth.backends.RemoteUserBackend',
119+
'django.contrib.auth.backends.ModelBackend',
120+
)
121+
```
122+
123+
Full documentation: [Django Authentication with LDAP](https://django-auth-ldap.readthedocs.io/en/latest/)
124+
125+
## docker-compose.yml
126+
127+
To pass LDAP credentials to the container via environment variables, add these to the `uwsgi` service environment section:
128+
129+
```yaml
130+
DD_LDAP_SERVER_URI: "${DD_LDAP_SERVER_URI:-ldap://ldap.example.com}"
131+
DD_LDAP_BIND_DN: "${DD_LDAP_BIND_DN:-}"
132+
DD_LDAP_BIND_PASSWORD: "${DD_LDAP_BIND_PASSWORD:-}"
133+
```
134+
135+
Alternatively, set these values directly in `local_settings.py`.

docs/content/admin/user_management/set_user_permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Configuration Permissions are not related to a specific Product or Product Type
120120
* **Finding Templates:** Access to the Findings \> Finding Templates page
121121
* **Groups**: Access the 👤Users \> Groups page
122122
* **Jira Instances:** Access the ⚙️Configuration \> JIRA page
123-
* **Language Types**:Access the [Language Types](/open_source/languages/) API endpoint
123+
* **Language Types**:Access the [Language Types](/automation/api/languages/) API endpoint
124124
* **Login Banner**: Edit the ⚙️Configuration \> Login Banner page
125125
* **Announcements**: Access ⚙️Configuration \> Announcements
126126
* **Note Types:** Access the ⚙️Configuration \> Note Types page
File renamed without changes.
File renamed without changes.

docs/content/open_source/archived_docs/google-sheets-sync.md renamed to docs/content/archived_docs/google-sheets-sync.md

File renamed without changes.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "OWASP ASVS Benchmarks"
3+
description: "Benchmark a Product against the OWASP Application Security Verification Standard"
4+
weight: 6
5+
audience: opensource
6+
---
7+
8+
DefectDojo supports benchmarking Products against the [OWASP Application Security Verification Standard (ASVS)](https://owasp.org/www-project-application-security-verification-standard/), which provides a basis for testing web application technical security controls.
9+
10+
Benchmarks allow you to measure how well a Product meets your organization's defined security requirements, and to publish a score on the Product page for visibility.
11+
12+
## Accessing Benchmarks
13+
14+
Benchmarks are available from the **Product** page. To open the Benchmarks view, select the dropdown menu in the upper-right area of the Product page and choose **OWASP ASVS v.3.1** near the bottom of the menu.
15+
16+
## Benchmark Levels
17+
18+
OWASP ASVS defines three levels of verification coverage:
19+
20+
- **Level 1** – For all software. Covers the most critical security requirements with the lowest cost to verify. This is the default level in DefectDojo.
21+
- **Level 2** – For applications that contain sensitive data. Appropriate for most applications.
22+
- **Level 3** – For the most critical applications, such as those performing high-value transactions or storing sensitive medical, financial, or safety data.
23+
24+
You can switch between levels using the dropdown in the upper-right of the Benchmarks view.
25+
26+
## Benchmark Score
27+
28+
The left side of the Benchmarks view displays the current score for your Product at the selected ASVS level:
29+
30+
- The **desired score** your organization has set as a target
31+
- The **percentage of benchmarks passed** toward achieving that score
32+
- The **total number of enabled benchmarks** for the selected level
33+
34+
Enabling the **Publish** checkbox will display the ASVS score directly on the Product page.
35+
36+
## Managing Benchmark Entries
37+
38+
Individual benchmark entries can be marked as passed or failed as your team works through the ASVS controls. Additional benchmark entries, beyond the default ASVS set, can be added or updated through the **Django admin site**.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "Languages and Lines of Code"
3+
description: "Import language composition data for a Product using the cloc tool"
4+
weight: 3
5+
audience: opensource
6+
aliases:
7+
- /en/open_source/languages
8+
---
9+
10+
DefectDojo can display a breakdown of programming languages and lines of code for a Product, populated by importing a report from the [cloc](https://github.com/AlDanial/cloc) (Count Lines of Code) tool via the API.
11+
12+
## Generating the cloc Report
13+
14+
Run `cloc` against your codebase using the `--json` flag to produce a JSON file in the correct format:
15+
16+
```bash
17+
cloc --json /path/to/your/project > cloc-report.json
18+
```
19+
20+
## Importing via the API
21+
22+
Upload the JSON report to DefectDojo via the API. When importing, all existing language data for the Product is replaced with the contents of the new file.
23+
24+
The import endpoint is documented in the [DefectDojo API v2 docs](../api-v2-docs/).
25+
26+
## Viewing Results
27+
28+
After import, the language breakdown is displayed on the left side of the Product details page, showing each language and its line count. Colors for each language are defined by entries in the `Language_Type` table, pre-populated with data from GitHub.
29+
30+
## Updating Language Colors
31+
32+
GitHub periodically updates language colors as new languages emerge. To pull the latest color data, run the following management command:
33+
34+
```bash
35+
./manage.py import_github_languages
36+
```
37+
38+
This reads from [ozh/github-colors](https://github.com/ozh/github-colors) and adds new languages or updates existing colors.

0 commit comments

Comments
 (0)