Skip to content

Commit 5d8b067

Browse files
committed
feat(sso): remove SSO surface from open source — Pro only as of 2.58
Strips dojo/sso/ wholesale (the consolidated SSO package merged from origin/dev) and unwires every call site: - dojo/settings/settings.dist.py: drops the SSO_ENV_SCHEMA env merge, the apply_sso_settings(env, globals()) call, the DD_SOCIAL_AUTH_SHOW_LOGIN_FORM / DD_SOCIAL_LOGIN_AUTO_REDIRECT defaults and their derived SHOW_LOGIN_FORM / SOCIAL_LOGIN_AUTO_REDIRECT settings, and the saml2 logger entry. The _DOJO_EXTRA_TEMPLATE_DIRS hook stays — it's still load-bearing for the notifications and github sub-package template trees. - dojo/urls.py: drops the dojo.sso.urls inclusion (which mounted social_django.urls and the conditional ^saml2/ route). - dojo/user/views.py: removes the get_sso_auto_redirect chain in login_view and the SHOW_LOGIN_FORM short-circuit in logout_view. - dojo/context_processors.py: removes SHOW_LOGIN_FORM from the global template context. - dojo/templates/dojo/login.html (Tailwind) and dojo/templates_classic/dojo/login.html (Classic): strip the inline SSO button blocks and the SHOW_LOGIN_FORM gating, leaving the local username/password form, password-toggle, and forgot-password / forgot-username links. - requirements.txt: drops social-auth-app-django, social-auth-core, and djangosaml2; these now ship in DefectDojo Pro's own dependency manifest. - unittests/test_remote_user.py and unittests/test_social_auth_failure_handling.py: removed; the equivalent coverage was ported into Pro's unit_tests/sso/ tree against pro.sso.remote_user and pro.sso.middleware. The only authentication surfaces that remain on open source are the local Django auth login form and the password-reset flow. Pro carries forward — and now owns — the entire SSO surface (SAML, OIDC, Google, Okta, Azure AD, GitLab, Auth0, Keycloak, GitHub Enterprise, remote-user) under pro/sso/, configured via the existing tuner. Upgrade notes in docs/content/releases/os_upgrading/2.58.md describe the cutover at a high level for OS upgraders; the Pro changelog at docs/content/releases/pro/ changelog.md v2.58.0 calls out that Pro's SSO surface is unchanged and now lives in pro/sso/ alongside the dependency move.
1 parent 16d2b5f commit 5d8b067

23 files changed

Lines changed: 45 additions & 1764 deletions

docs/content/releases/os_upgrading/2.58.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'Upgrading to DefectDojo Version 2.58.x'
33
toc_hide: true
44
weight: -20260504
5-
description: Authorized Users panel replaces Members/Groups under legacy authorization; Notification .tpl templates relocated under dojo/notifications/
5+
description: Authorized Users panel replaces Members/Groups under legacy authorization; SSO providers move to DefectDojo Pro; Notification .tpl templates relocated under dojo/notifications/
66
---
77

88
## Authorized Users panel replaces Members/Groups under legacy authorization
@@ -30,6 +30,15 @@ Both endpoints are gated so only `is_staff` / `is_superuser` users can add or re
3030

3131
DefectDojo Pro deployments retain full RBAC. The Pro UX is unchanged — same Members/Groups management surface as before.
3232

33+
## SSO providers are available in DefectDojo Pro only
34+
35+
Single sign-on (SAML, OIDC, Google, Okta, Azure AD, GitLab, Auth0, Keycloak, GitHub Enterprise, and remote-user header authentication) has been consolidated into DefectDojo Pro. Open source DefectDojo now exposes only local username/password login and the password-reset flow.
36+
37+
### Required actions
38+
39+
- **No customizations or local-only login:** No action required.
40+
- **Currently logging in via SSO on open source:** Existing user accounts and group memberships are preserved on upgrade, but SSO sign-in will no longer work after 2.58. To keep an SSO-driven login experience, switch to [DefectDojo Pro](https://defectdojo.com), which carries forward and extends the SSO surface (provider configuration moves to a UI-managed tuner).
41+
3342
## Notification `.tpl` templates relocated
3443

3544
The notification domain has been consolidated under a new `dojo/notifications/` package, and the 62 channel `.tpl` templates that drive alert, mail, MS Teams, Slack, and webhook notifications have moved on disk. The Django template lookup name (e.g. `notifications/mail/scan_added.tpl`) is unchanged, so most customizations keep working without any edits — but operators who override `.tpl` files by mounting them into the source tree need to update their paths.

docs/content/releases/pro/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ For Open Source release notes, please see the [Releases page on GitHub](https://
1515
### May 4, 2026: v2.58.0
1616

1717
* **(Authorization)** Pro deployments are **not impacted** by the OS legacy authorization rewrite. Pro retains full RBAC: the Members / Groups panels on Product and Product Type detail, the Groups panel + Global Role fieldset on the user view / profile / add user pages, the Group Members panel on the user view, the Groups link in the left-nav, and the System Settings default-group fields all continue to render unchanged, driven by Pro RBAC via template overrides at `pro/templates/dojo/`. The eight RBAC v2 API endpoints (`/api/v2/dojo_groups/`, `/api/v2/dojo_group_members/`, `/api/v2/global_roles/`, `/api/v2/product_groups/`, `/api/v2/product_members/`, `/api/v2/product_type_groups/`, `/api/v2/product_type_members/`, `/api/v2/roles/`) are re-registered by Pro's `add_*_urls` hooks. Pro's runtime authorization shadowing in `pro/apps.py:DojoProConfig.ready()` continues to govern object, global, and configuration permissions, so the OS-side `is_staff` bypass for configuration permissions does not affect Pro semantics.
18+
* **(SSO)** SSO providers (SAML, OIDC, Google, Okta, Azure AD, GitLab, Auth0, Keycloak, GitHub Enterprise, and remote-user header auth) are **Pro-only** as of 2.58. The implementation that previously shipped in open source (`dojo/sso/`) was consolidated into Pro at `pro/sso/`, and the social-auth and djangosaml2 dependencies moved to Pro's package. Pro deployments continue to expose the full SSO surface — login buttons, the tuner-driven runtime configuration, and the `remove_sso` management command — unchanged. Open source customers using SSO need to migrate to Pro to retain SSO sign-in.
1819

1920
## Apr 2026: v2.57
2021

dojo/context_processors.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
def globalize_vars(request):
1414
# return the value you want as a dictionnary. you may add multiple values in there.
1515
context = {
16-
"SHOW_LOGIN_FORM": settings.SHOW_LOGIN_FORM,
1716
"FORGOT_PASSWORD": settings.FORGOT_PASSWORD,
1817
"FORGOT_USERNAME": settings.FORGOT_USERNAME,
1918
"CLASSIC_AUTH_ENABLED": settings.CLASSIC_AUTH_ENABLED,

dojo/settings/settings.dist.py

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,8 @@
3030

3131
root = environ.Path(__file__) - 3 # Three folders back
3232

33-
# SSO env schema is merged in if dojo.sso is available
34-
_sso_env_schema = {}
35-
try:
36-
from dojo.sso.settings import SSO_ENV_SCHEMA
37-
_sso_env_schema = SSO_ENV_SCHEMA
38-
except ImportError:
39-
pass
40-
4133
# reference: https://pypi.org/project/django-environ/
42-
env = environ.FileAwareEnv(**{**dict(
34+
env = environ.FileAwareEnv(
4335
# Set casting and default values
4436
DD_SITE_URL=(str, "http://localhost:8080"),
4537
DD_DEBUG=(bool, False),
@@ -140,8 +132,6 @@
140132
DD_FORGOT_PASSWORD=(bool, True), # do we show link "I forgot my password" on login screen
141133
DD_PASSWORD_RESET_TIMEOUT=(int, 259200), # 3 days, in seconds (the deafult)
142134
DD_FORGOT_USERNAME=(bool, True), # do we show link "I forgot my username" on login screen
143-
DD_SOCIAL_AUTH_SHOW_LOGIN_FORM=(bool, True), # do we show user/pass input
144-
DD_SOCIAL_LOGIN_AUTO_REDIRECT=(bool, False), # auto-redirect if there is only one social login method
145135
# Some security policies require allowing users to have only one active session
146136
DD_SINGLE_USER_SESSION=(bool, False),
147137
# if somebody is using own documentation how to use DefectDojo in his own company
@@ -246,7 +236,6 @@
246236
# possible to create new and it will not be possible to use exising.
247237
DD_API_TOKENS_ENABLED=(bool, True),
248238
# Enable endpoint which allow user to get API token when user+pass is provided
249-
# It is useful to disable when non-local authentication (like SAML, Azure, ...) is in place
250239
DD_API_TOKEN_AUTH_ENDPOINT_ENABLED=(bool, True),
251240
# You can set extra Jira headers by suppling a dictionary in header: value format (pass as env var like "headr_name=value,another_header=anohter_value")
252241
DD_ADDITIONAL_HEADERS=(dict, {}),
@@ -273,7 +262,7 @@
273262
DD_ENABLE_V3_ORGANIZATION_ASSET_RELABEL=(bool, False),
274263
# Notification env-vars (SLA notify, alert refresh/counter/cap, system-level trump). Defined in dojo.notifications.settings.
275264
**NOTIFICATIONS_ENV_DEFAULTS,
276-
), **_sso_env_schema})
265+
)
277266

278267

279268
def generate_url(scheme, double_slashes, user, password, host, port, path, params):
@@ -479,9 +468,6 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
479468
REQUIRE_PASSWORD_ON_USER = env("DD_REQUIRE_PASSWORD_ON_USER")
480469
FORGOT_USERNAME = env("DD_FORGOT_USERNAME")
481470
PASSWORD_RESET_TIMEOUT = env("DD_PASSWORD_RESET_TIMEOUT")
482-
# Showing login form (form is not needed for external auth: OKTA, Google Auth, etc.)
483-
SHOW_LOGIN_FORM = env("DD_SOCIAL_AUTH_SHOW_LOGIN_FORM")
484-
SOCIAL_LOGIN_AUTO_REDIRECT = env("DD_SOCIAL_LOGIN_AUTO_REDIRECT")
485471

486472
DOCUMENTATION_URL = env("DD_DOCUMENTATION_URL")
487473

@@ -708,10 +694,10 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
708694
# UIPreferenceLoader; see dojo/template_loaders.py.
709695
_DOJO_TAILWIND_TEMPLATES_DIR = root("dojo/templates")
710696
_DOJO_CLASSIC_TEMPLATES_DIR = root("dojo/templates_classic")
711-
# Sub-package template dirs (dojo/notifications, dojo/github, dojo/sso, ...)
712-
# share a single list that the FilesystemLoader below reads by reference, so
713-
# late-binding appenders like dojo/sso/settings.py:apply_sso_settings can add
714-
# their template dir at startup and have it picked up at render time.
697+
# Sub-package template dirs (dojo/notifications, dojo/github, ...) share a
698+
# single list that the FilesystemLoader below reads by reference, so any
699+
# late-binding settings can append a template dir at startup and have it
700+
# picked up at render time.
715701
_DOJO_EXTRA_TEMPLATE_DIRS = [
716702
root("dojo/notifications/templates"),
717703
root("dojo/github/templates"),
@@ -725,7 +711,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
725711
"DIRS": _DOJO_EXTRA_TEMPLATE_DIRS,
726712
# APP_DIRS is False because dojo's templates are loaded explicitly via
727713
# UIPreferenceLoader; the FilesystemLoader entry below picks up
728-
# template dirs from the dojo/notifications, dojo/github, and dojo/sso
714+
# template dirs from the dojo/notifications and dojo/github
729715
# consolidations; other apps' templates are loaded via the
730716
# app_directories.Loader entry.
731717
"APP_DIRS": False,
@@ -839,15 +825,6 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
839825

840826
vars().update(EMAIL_CONFIG)
841827

842-
# ------------------------------------------------------------------------------
843-
# SSO (loaded from dojo.sso if available)
844-
# ------------------------------------------------------------------------------
845-
try:
846-
from dojo.sso.settings import apply_sso_settings
847-
apply_sso_settings(env, globals())
848-
except ImportError:
849-
pass
850-
851828
# ------------------------------------------------------------------------------
852829
# SINGLE_USER_SESSION
853830
# ------------------------------------------------------------------------------
@@ -1521,11 +1498,6 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
15211498
"level": str(LOG_LEVEL),
15221499
"propagate": False,
15231500
},
1524-
"saml2": {
1525-
"handlers": [rf"{LOGGING_HANDLER}"],
1526-
"level": str(LOG_LEVEL),
1527-
"propagate": False,
1528-
},
15291501
"MARKDOWN": {
15301502
# The markdown library is too verbose in it's logging, reducing the verbosity in our logs.
15311503
"handlers": [rf"{LOGGING_HANDLER}"],

dojo/sso/__init__.py

Whitespace-only changes.

dojo/sso/attribute_maps/__init__.py

Whitespace-only changes.

dojo/sso/attribute_maps/django_saml_uri.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)