Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgroup membership implies group membership #25

Open
jjensenral opened this issue Jun 21, 2024 · 4 comments
Open

Subgroup membership implies group membership #25

jjensenral opened this issue Jun 21, 2024 · 4 comments
Labels
AARC-G056 Community profile attributes AARC-G069 Guidelines for expressing group membership and role information authZ Authorisation PROFILE-AARC AARC Attribute Profile PROFILE-GUT Grand Unified Token (GUT) profile

Comments

@jjensenral
Copy link

jjensenral commented Jun 21, 2024

This issue applies to

  1. attribute authorities (AAs) - how group membership is communicated for users who are members of subgroups of groups - and
  2. relying parties (RPs) - how the same group information is parsed.

For a user who is member of a subgroup of a group, the implication is that they are also member of the parent group. Thus, it should not be necessary to assert

{
  "groups":["urn:example:foo:group:snap","urn:example:foo:group:snap:yup","urn:example:foo:group:snap:yup:flap"]
}

Instead, the statement

{
  "groups":"urn:example:foo:group:snap:yup:flap"
}

asserts the same information. The implication is that implementations MUST NOT use full string comparison alone to check whether the user is a member of snap (additionally, this example makes use of the rule that allows a list of one element to be replaced with that element)

The corollary is that RPs MUST do a prefix string match. E.g. in C,

#include <stdio.h>
#include <string.h>
int main()
{
    char const *authorised_group = "urn:group:foo", *user_group = "urn:group:foo:bar";
    if(strncmp(authorised_group, user_group, strlen(authorised_group))==0)
        printf("user is authorised\n");
    return 0;
}

or in python 3.11,

authorised_group="urn:group:foo"
user_group="urn:group:foo:baz"
if user_group.startswith(authorised_group):
    print("user is authorised\n")

In contrast, we would not suggest requiring regexp matching, as the configuration then becomes more complicated.

See also #10 and #24

@NicolasLiampotis NicolasLiampotis added AARC-G069 Guidelines for expressing group membership and role information AARC-G056 Community profile attributes PROFILE-AARC AARC Attribute Profile labels Jun 21, 2024
@NicolasLiampotis NicolasLiampotis added the PROFILE-GUT Grand Unified Token (GUT) profile label Jun 28, 2024
@marcvs
Copy link

marcvs commented Jul 24, 2024

How about explicitly defining it, maybe in a practical way?
From using mqtt quite a bit, this one seems to be solving the same thing (if you replace / with :) : https://mosquitto.org/man/mqtt-7.html

@msalle
Copy link

msalle commented Jul 26, 2024

Not sure how you mean "explicitly defining it" ? You mean no implicit membership, or defining a schema/set of rules?

@marcvs
Copy link

marcvs commented Aug 13, 2024

Examples of my suggestion:

Suppose we have groups:

  • <namespace>:group:a
  • <namespace>:group:a/b
  • <namespace>:group:a/x
  • <namespace>:group:a/c
  • <namespace>:group:a/b/c
  • <namespace>:group:a/b/d
  • <namespace>:group:a/b/d/e
  • <namespace>:group:a/x/c
entitlement groups you're a member of
<namespace>:group:a/b/c a/b/c Exact group
<namespace>:group:a/+/c a/x/c, a/b/c Any group, where a is 1st level and c is 3rd level
<namespace>:group:a/b/# a/b, a/b/c, a/b/d, a/b/c/d Any group starting with a/b/
<namespace>:group:#/c a/b/c, a/x/c, a/c Any group ending with /c

This IS complicated, but it allows expressing all cases and it does work well in mqtt.

@NicolasLiampotis NicolasLiampotis added the authZ Authorisation label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AARC-G056 Community profile attributes AARC-G069 Guidelines for expressing group membership and role information authZ Authorisation PROFILE-AARC AARC Attribute Profile PROFILE-GUT Grand Unified Token (GUT) profile
Projects
None yet
Development

No branches or pull requests

4 participants