Skip to content

Commit 5795099

Browse files
authored
Merge branch 'dev' into finding-group-push-individual-jira
2 parents 9229677 + 1df2832 commit 5795099

File tree

7 files changed

+48
-16
lines changed

7 files changed

+48
-16
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node
2222
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2323
with:
24-
node-version: '24.10.0' # TODO: Renovate helper might not be needed here - needs to be fully tested
24+
node-version: '24.11.0' # TODO: Renovate helper might not be needed here - needs to be fully tested
2525

2626
- name: Cache dependencies
2727
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0

.github/workflows/renovate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
uses: suzuki-shunsuke/github-action-renovate-config-validator@c22827f47f4f4a5364bdba19e1fe36907ef1318e # v1.1.1
2222
with:
2323
strict: "true"
24-
validator_version: 41.163.6 # renovate: datasource=github-releases depName=renovatebot/renovate
24+
validator_version: 41.165.5 # renovate: datasource=github-releases depName=renovatebot/renovate

.github/workflows/validate_docs_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Node
1919
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
2020
with:
21-
node-version: '24.10.0' # TODO: Renovate helper might not be needed here - needs to be fully tested
21+
node-version: '24.11.0' # TODO: Renovate helper might not be needed here - needs to be fully tested
2222

2323
- name: Cache dependencies
2424
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0

docs/content/en/open_source/ldap-authentication.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ weight: 4
77

88
## LDAP Authentication
99

10-
Out of the box Defect Dojo does not support LDAP authentication.
10+
Out of the box DefectDojo does not support LDAP authentication.
1111

12-
*However*, since Defect Dojo is built using Django, it isn't too difficult to add support for LDAP.
12+
*However*, since DefectDojo is built using Django, it isn't too difficult to add support for LDAP.
1313
So long as you don't mind building your own Docker images...
1414

15-
We will need to modify a grand total of 4-5 files, depending on how you want to pass Dojo your LDAP secrets.
15+
We will need to modify a grand total of 4-5 files, depending on how you want to pass DefectDojo your LDAP secrets.
1616

1717
- Dockerfile.django-*
1818
- Dockerfile.nginx-*
@@ -23,7 +23,14 @@ We will need to modify a grand total of 4-5 files, depending on how you want to
2323

2424
#### Dockerfile modifications
2525

26-
In both Dockerfile.django and Dockerfile.nginx, you want to add the following lines to the apt-get install layers:
26+
In both `Dockerfile.django-alpine` and `Dockerfile.nginx-alpine`, you need to add the following lines to the `apk add` layers:
27+
28+
```bash
29+
openldap-dev \
30+
cyrus-sasl-dev \
31+
```
32+
33+
Also, in `Dockerfile.django-debian`, you need to add the following lines to the `apt-get install` layers:
2734

2835
```bash
2936
libldap2-dev \
@@ -42,8 +49,8 @@ Please check for the latest version of these requirements at the time of impleme
4249
Otherwise add the following to requirements.txt:
4350

4451
```python
45-
python-ldap==3.4.2
46-
django-auth-ldap==4.1.0
52+
python-ldap==3.4.5
53+
django-auth-ldap==5.2.0
4754
```
4855

4956

@@ -55,21 +62,25 @@ At the top of the file:
5562
```python
5663
import ldap
5764
from django_auth_ldap.config import LDAPSearch, GroupOfNamesType
65+
import environ
5866
```
5967

6068
Then further down add LDAP settings to the env dict:
6169
```python
6270
# LDAP
63-
DD_LDAP_SERVER_URI=(str, 'ldap://ldap.example.com'),
64-
DD_LDAP_BIND_DN=(str, ''),
65-
DD_LDAP_BIND_PASSWORD=(str, ''),
71+
env = environ.FileAwareEnv(
72+
DD_LDAP_SERVER_URI=(str, 'ldap://ldap.example.com'),
73+
DD_LDAP_BIND_DN=(str, ''),
74+
DD_LDAP_BIND_PASSWORD=(str, ''),
75+
)
6676
```
6777

6878
Then under the env dict add:
6979
```python
7080
AUTH_LDAP_SERVER_URI = env('DD_LDAP_SERVER_URI')
7181
AUTH_LDAP_BIND_DN = env('DD_LDAP_BIND_DN')
7282
AUTH_LDAP_BIND_PASSWORD = env('DD_LDAP_BIND_PASSWORD')
83+
7384
AUTH_LDAP_USER_SEARCH = LDAPSearch(
7485
"ou=Groups,dc=example,dc=com", ldap.SCOPE_SUBTREE, "(uid=%(user)s)"
7586
)
@@ -116,7 +127,7 @@ Read the docs for Django Authentication with LDAP here: https://django-auth-ldap
116127

117128
#### docker-compose.yml
118129

119-
In order to pass the variables to the local_settings.py file via docker, it's a good idea to add these to the docker compose file.
130+
In order to pass the variables to the `local_settings.py` file via docker, it's a good idea to add these to the `docker-compose.yml` file.
120131

121132
You can do this by adding the following variables to the environment section for the uwsgi image:
122133
```yaml
@@ -125,4 +136,4 @@ DD_LDAP_BIND_DN: "${DD_LDAP_BIND_DN:-}"
125136
DD_LDAP_BIND_PASSWORD: "${DD_LDAP_BIND_PASSWORD:-}"
126137
```
127138
128-
Alternatively you can set these values in a local_settings.py file.
139+
Alternatively you can set these values in a `local_settings.py` file.

dojo/api_v2/serializers.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,9 @@ class FindingSerializer(serializers.ModelSerializer):
16921692
many=True, read_only=True, source="risk_acceptance_set",
16931693
)
16941694
push_to_jira = serializers.BooleanField(default=False)
1695+
found_by = serializers.PrimaryKeyRelatedField(
1696+
queryset=Test_Type.objects.all(), many=True,
1697+
)
16951698
age = serializers.IntegerField(read_only=True)
16961699
sla_days_remaining = serializers.IntegerField(read_only=True, allow_null=True)
16971700
finding_meta = FindingMetaSerializer(read_only=True, many=True)
@@ -1774,6 +1777,16 @@ def update(self, instance, validated_data):
17741777
if parsed_vulnerability_ids:
17751778
save_vulnerability_ids(instance, parsed_vulnerability_ids)
17761779

1780+
# Get found_by from validated_data
1781+
found_by = validated_data.pop("found_by", None)
1782+
# Handle updates to found_by data
1783+
if found_by:
1784+
instance.found_by.set(found_by)
1785+
# If there is no argument entered for found_by, the user would like to clear out the values on the Finding's found_by field
1786+
# Findings still maintain original found_by value associated with their test
1787+
# In the event the user does not supply the found_by field at all, we do not modify it
1788+
elif isinstance(found_by, list) and len(found_by) == 0:
1789+
instance.found_by.clear()
17771790
instance = super().update(
17781791
instance, validated_data,
17791792
)

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ titlecase==2.4.1
4343
social-auth-app-django==5.6.0
4444
social-auth-core==4.8.1
4545
gitpython==3.1.45
46-
python-gitlab==6.5.0
46+
python-gitlab==7.0.0
4747
cpe==1.3.1
4848
packageurl-python==0.17.5
4949
django-crum==0.7.9
@@ -62,7 +62,7 @@ django-ratelimit==4.1.0
6262
argon2-cffi==25.1.0
6363
blackduck==1.1.3
6464
pycurl==7.45.7 # Required for Celery Broker AWS (SQS) support
65-
boto3==1.40.60 # Required for Celery Broker AWS (SQS) support
65+
boto3==1.40.62 # Required for Celery Broker AWS (SQS) support
6666
netaddr==1.3.0
6767
vulners==3.1.1
6868
fontawesomefree==6.6.0

run-unittest.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ usage() {
1717
echo "You must specify a test case (arg)!"
1818
echo "Any additional arguments will be passed to the test command."
1919
echo
20+
echo "Make sure you run this script in dev mode."
21+
echo "You can enter dev mode using the following command:"
22+
echo "./docker/setEnv.sh dev"
23+
echo
24+
echo "Lastly, make sure the application is running by using the following docker commands:"
25+
echo "docker compose build"
26+
echo "docker compose up"
27+
echo
2028
echo "Example commands:"
2129
echo "./run-unittest.sh --test-case unittests.tools.test_stackhawk_parser.TestStackHawkParser"
2230
echo "./run-unittest.sh --test-case unittests.tools.test_stackhawk_parser.TestStackHawkParser -v3 --failfast"

0 commit comments

Comments
 (0)