Skip to content

Commit 13dd919

Browse files
authored
feat(session): Single user session (#13416)
1 parent 36e059e commit 13dd919

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

dojo/settings/settings.dist.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@
214214
# `RemoteUser` is usually used behind AuthN proxy and users should not know about this mechanism from Swagger because it is not usable by users.
215215
# It should be hidden by default.
216216
DD_AUTH_REMOTEUSER_VISIBLE_IN_SWAGGER=(bool, False),
217+
# Some security policies require allowing users to have only one active session
218+
DD_SINGLE_USER_SESSION=(bool, False),
217219
# if somebody is using own documentation how to use DefectDojo in his own company
218220
DD_DOCUMENTATION_URL=(str, "https://documentation.defectdojo.com"),
219221
# merging findings doesn't always work well with dedupe and reimport etc.
@@ -919,6 +921,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
919921
"auditlog",
920922
"pgtrigger",
921923
"pghistory",
924+
"single_session",
922925
)
923926

924927
# ------------------------------------------------------------------------------
@@ -1149,6 +1152,13 @@ def saml2_attrib_map_format(din):
11491152
("dojo.remote_user.RemoteUserAuthentication",) + \
11501153
REST_FRAMEWORK["DEFAULT_AUTHENTICATION_CLASSES"]
11511154

1155+
# ------------------------------------------------------------------------------
1156+
# SINGLE_USER_SESSION
1157+
# ------------------------------------------------------------------------------
1158+
1159+
SESSION_ENGINE = "django.contrib.sessions.backends.db"
1160+
SINGLE_USER_SESSION = env("DD_SINGLE_USER_SESSION")
1161+
11521162
# ------------------------------------------------------------------------------
11531163
# CELERY
11541164
# ------------------------------------------------------------------------------

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ django-slack==5.19.0
1919
django-watson==1.6.3
2020
django-prometheus==2.4.1
2121
Django==5.1.13
22+
django-single-session==0.2.0
2223
djangorestframework==3.16.1
2324
html2text==2025.4.15
2425
humanize==4.14.0

0 commit comments

Comments
 (0)