Closed jbasney closed 4 years ago
Restating what you just said, just to make sure I understand. We want:
That seems reasonable to me -- and broadly what I did for the X509-based issuer. Here's the example config file for our CMS demo instance:
{
"rules": [
{"match": "fqan:/cms", "scopes": ["read:/store", "write:/store/user/{username}"]}
]
}
So, we have one rule that requires the client to authenticate with a GSI proxy containing a CMS-issued VOMS extension. The server will by default issue a token that allows any CMS file to be read, but only allow the user to write to their home directory (there's some code I'm not highlighting here that maps from DN to username). I'd imagine the group name substitution would be similar.
Note there is some tricky logic (see: https://github.com/bbockelm/x509-scitokens-issuer/blob/master/src/x509_scitokens_issuer/x509_scitokens_issuer.py#L272) around user-specified scopes, since it doesn't necessarily work the same way in SciTokens as in more traditional OAuth2. Basically, a user authorized for scope read:/pathA
should be allowed to ask-and-receive the scope read:/pathA/foo/bar
, even if read:/pathA/foo/bar
isn't explicitly listed in the configuration file.
@jbasney - it's been about a month since this ticket came up. How close are we to an implementation here? Have we settled on the approach?
pinging @jjg-123
As we discussed at the meeting last Wednesday, this is my next project. I have been busy until today on other issues but am now attending to it. I will report when I have more to say.
The current documentation to discuss this has been newly updated and resides at https://docs.google.com/document/d/1qElrTc3F2fHZOfannkwvDcMzIPkxBaUDJycinvX5nMY/edit#heading=h.o63w43ux9kfy . There is also a working demo for this at https://surge.ncsa.illinois.edu/scitokens-client/ which now allows for requesting scopes and having them resolved per templates. Please have a looksee and give feedback
Proposing simple initial policy enforcement in the SciTokens OAuth Provider as follows:
if isMemberof(group, user) # LDAP check then read:/pathA/$GROUP/ write:/pathB/$USER/
where group name and read/write paths can be specified by client configuration.