Repository navigation
Support login via SAML 2.0 for enterprise identity providers #7816
Replies: 2 comments
|
@stephan-wolf-ais Thanks for sharing the discussion thread, and apologies for joining the discussion late. Regarding the limitations you've highlighted around OIDC-based RBAC, I'm finding them a little difficult to follow. I've worked with several enterprises and have previously configured OIDC RBAC integration with Dependency-Track and other Single Page Application (SPA). Also, my understanding is that there is already a significant number of DT adopters successfully using OIDC with RBAC. Could you help me understand how you see the role/group mapping differing between OIDC and SAML, particularly in the context of the following points?
I'd be interested to understand whether these are inherent limitations of OIDC or specific to the current implementation in DT, and how SAML addresses these scenarios differently. My main concerns with SAML, however, are from a security perspective. SAML is a relatively old (2005) standard, and its development and standardisation ecosystem has seen limited progress in recent years, The OASIS Security Services Technical Committee (SSTC) the working group responsible for the SAML standard was formally closed in July 2023 . I am also concerned about the lack of widely adopted, up-to-date security profiles to address the rapidly evolving identity threat landscape. Furthermore, SAML implementations can be vulnerable to XML-related attacks when they rely on insecure XML parsing or insufficient validation. SAML also lacks a similarly widespread and recognised ecosystem of conformance testing and certification programmes. Looking at CVEs reported over the past decade, SAML implementations have also had their share of significant security vulnerabilities, including several rated High or Critical. Also, as per my understanding making SAML quantum resistant has many interdependent elements which make hardening SAML a complex and risky endeavour. I appreciate that SAML may address certain integration requirements, but I think we should carefully weigh those benefits against the additional security and maintenance considerations. @stephan-wolf-ais @nscuro @stevespringett I'd be keen to hear your thoughts. |
|
Hello @VinodAnandan ,
Thanks for the thoughtful questions, and no worries about joining late. Both points deserve a proper answer.
On the OIDC limitations
You are right to push back here, and I should have been more precise. I checked the three points against the current code on main. All three are specific to Dependency-Track's implementation, not limitations of OIDC itself:
* Missing groups claim. With team synchronization enabled, isProfileComplete requires a groups claim in the ID token or userinfo response, otherwise the login fails. That is a choice in DT. An implementation could just as well treat a missing claim as "no groups" and remove the team memberships.
* Manually created groups. Team synchronization only considers OIDC groups that an administrator created beforehand, with the exact name the provider sends. Creating unknown groups on login would fix this. I already have a branch that does so through OidcAuthenticationCustomizer.
* Public client. The frontend runs the authorization code flow with PKCE as a public client. OIDC fully supports confidential clients and backend-for-frontend setups. DT just doesn't offer one today.
So none of these is a reason to add SAML on its own. They are reasons to improve the OIDC integration, and I'm happy to contribute that regardless of how we decide on SAML.
Why we need SAML
What makes the difference for us is an organizational constraint rather than a technical one, and it is the reason we started this work. Our IT only accepts Entra ID app registrations that request Microsoft Graph permissions, such as reading users and group memberships, by exception. An OIDC integration is an app registration with such delegated permissions, so every deployment needs an exception. A SAML enterprise application needs no API permissions, because Entra ID issues the claims, including group memberships, directly in the assertion. That is why SAML 2.0 is the approved way to connect applications like Dependency-Track for us.
I don't expect this to be unique to us. Governance processes for Entra ID app registrations are common in larger organizations, and they tend to treat SAML enterprise applications as the lower-risk option.
Fit with the codebase
Independent of the protocol question, the SAML implementation follows the current direction of the codebase. The login flow lives entirely in apiserver, uses JDBI and raw SQL, and adds no new logic to Alpine, as alpine/README.md asks. The only Alpine changes are the SamlUser model and its registration, because the user model itself still lives there. The OIDC integration, by contrast, is still largely Alpine and JDO code. Improving it within the current structure is possible through OidcAuthenticationCustomizer. Deeper changes, such as a server-side flow with a confidential client, would mean either extending Alpine or moving OIDC out of it first.
On security
I share the view that SAML is a harder protocol to get right. The implementation deals with that by supporting as little of SAML as possible and by refusing everything else. ADR 045 lists the full set of checks:
* XML handling. Document type declarations are refused, so there is no entity expansion and no XXE. The JDK's secure validation mode is on, which refuses SHA-1 and other weak algorithms.
* Signature wrapping, the source of most SAML CVEs:
* Exactly one unencrypted assertion, and no duplicate IDs in the document.
* Every signature must sit inside the element it signs and have exactly one reference to it.
* Only the enveloped and exclusive canonicalization transforms are allowed.
* Data is read only from the verified assertion.
* Trust. Signatures are verified only against certificates from the IdP metadata. Keys in the message are ignored. The metadata URL must use HTTPS.
* Replay and login CSRF. Only logins started by DT are accepted. Each request ID can be consumed once, and the assertion must name it in InResponseTo. The resulting one-time code is bound to the browser that started the login with PKCE, and no session token ever appears in a URL.
* Account takeover. Users are identified by an immutable subject identifier, such as the object ID in Entra ID, not by their username.
* Dependencies and tests. No dependencies are added. The unit tests sign their own responses so they can reproduce the known attacks: wrapping variants, foreign keys, modification after signing, duplicate IDs, and replays. An end-to-end test runs the full browser flow against Keycloak.
On your other points:
* Closure of the SSTC. I agree this matters. SAML 2.0 is a finished standard rather than an evolving one, and it gets no new security profiles. On the other hand, the attack classes are well understood, and the defenses I listed address them directly.
* Conformance and certification. Correct, there is no current program comparable to OpenID certification. That is a point in favor of OIDC.
* Post-quantum. Both protocols currently rely on classical RSA or ECDSA signatures, XMLDSig for SAML and JWS for OIDC, and post-quantum algorithms for both are still at the draft stage. I don't think this sets the two apart today, although migrating XMLDSig may well be harder.
Proposal
Given our constraint, I'd prefer to keep SAML in scope:
1. Ship SAML as an opt-in, narrow implementation. It is disabled by default, marked as experimental, and gets an explicit security-focused review before it's marked stable.
2. Improve the OIDC integration in parallel, addressing the three points. For organizations without a constraint like ours, OIDC remains the recommended option.
If the maintainers conclude that the security and maintenance cost outweighs this, I understand. In that case I'd still contribute the OIDC improvements.
Thanks again for taking the time to look into this so carefully.
|
Uh oh!
There was an error while loading. Please reload this page.
Current Behavior
Dependency-Track supports three login methods: managed users, LDAP, and OpenID Connect (OIDC).
There is no support for SAML 2.0, which has been requested in #876.
In many enterprises, SAML 2.0 is the established, and often the only approved, federation protocol for
business applications. Identity providers such as AD FS, Shibboleth, PingFederate, or existing Entra ID
enterprise application setups are commonly operated with SAML, and group memberships are released as
SAML attributes per application.
With OIDC, Dependency-Track can only use group memberships when the provider includes a groups claim in the
ID token or userinfo response. In enterprise setups this is often not available or not approved for OIDC
clients, which leads to concrete limitations today:
entirely, because the profile is considered incomplete.
OIDC group by hand, with exactly the name the provider sends.
integrations for applications that grant access based on group membership.
As a result, organizations that standardized on SAML cannot use single sign-on with Dependency-Track,
or have to maintain users and team memberships manually.
Proposed Behavior
Support SAML 2.0 as an additional login method, with the same automation that OIDC provides:
(HTTP-Redirect binding for requests, HTTP-POST binding for responses). The identity provider is
configured through its SAML metadata, and the API server publishes its own service provider metadata.
exactly as the identity provider sends them, so administrators only need to map them to teams.
REST API and the frontend.
Why: this makes Dependency-Track usable with single sign-on in enterprises where SAML is the standard
protocol, and lets access be controlled centrally through group memberships in the identity provider.
I have opened draft pull requests with an implementation, and would like feedback on the design,
which is described in ADR 044 (
docs/adr/044-saml-authentication.md, status Proposed):The main design decision: OpenSAML 5 is only published to the Shibboleth Maven repository, which the build
does not allow, and pac4j builds on it. The implementation therefore uses the XML signature API of the JDK
(based on Apache Santuario) with a narrow set of strict checks, and adds no dependency. The ADR explains the
trade-offs and the protections against signature wrapping, XXE and replay.
Open questions for the maintainers:
single logout, and more than one IdP.
Checklist
All reactions