sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.74k stars 706 forks source link

Decide: How should SAML intersect with Sandstorm identity? #1737

Open paulproteus opened 8 years ago

paulproteus commented 8 years ago

Context

NOTE: Thanks to @jparyani I edited this to say urn:oasis:names:tc:SAML:2.0:nameid-format:persistent and persistent name ID, rather than urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified and unspecified name ID.

jparyani commented 8 years ago

1 correction, we request a v2 persistent nameId (see https://github.com/sandstorm-io/sandstorm/blob/ba4486cf12ad7780846c9b17b99611e563d96311/shell/packages/accounts-saml/saml_utils.js#L30). It's worth noting that IDPs can seemingly ignore this request, and actually return whatever format of nameId they desire.

paulproteus commented 8 years ago

Thanks @jparyani - I corrected this!

paulproteus commented 8 years ago

For what it's worth, the Shibboleth identity provider (a server that speaks SAML)

by default, the Shibboleth IdP creates the persistent ID proper by calculating the SHA-1 hash of the SP’s entity ID plus a user attribute value plus an admin-specified salt (i.e., the output is 20 bytes, Base64 encoded)

@jparyani says that Okta uses just an email address, which sure is simpler.

UPDATE: See also:

paulproteus commented 8 years ago

Shibboleth's approach seems to be pretty reasonable, honestly, although it's not an email address. Curious for @kentonv's +1/-1. The algorithm (take some stuff, then append a "salt", then hash it) seems not to be trivially length-extension-able, but it doesn't strike me as great. It hopefully does prevent enumeration, though, of valid identity IDs, and uses the salt as a kind of server namespace.

paulproteus commented 8 years ago

I've asked two educational SAML users to get back to me on how they configure this, for what it's worth.

kentonv commented 8 years ago

If Shibboleth is baking the SP into the NameID, that's a problem -- it implies that two different Sandstorm servers will get different NameIDs, therefore grains will not be transferable between them.

paulproteus commented 8 years ago

Then presumably the best decision is:

An alternative is to carefully write Shibboleth-specific smarts, relying on https://wiki.shibboleth.net/confluence/display/IDP30/NameIDGenerationConfiguration#NameIDGenerationConfiguration-FormatSelectionFormatSelection , but I think that's a bad idea.

@kentonv if you're +1 on this, then I request you close this with a comment that says: +1 (or similar)

kentonv commented 8 years ago

But... SAML's security is designed around authenticating a NameID, not around authenticating an email address. If we use email address as our primary ID, that means that we're putting a lot of faith in the email field to be accurate.

Possible problems:

So, I am -1 on using email address.

I would like to understand better what the configuration options are for administrators. Is it possibly easy for them to configure Shibboleth to use global IDs rather than SP-local ones? My quota for reading SAML documentation has run out for today.

paulproteus commented 8 years ago

All fair points. I will try find out the answer to your question.