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

Supporting LDAP group attribute member attribute instead of user attribute memberof for authentication #16918

Open
olifur opened this issue May 27, 2022 · 4 comments
Labels
help wanted The issues that is valid but needs help from community kind/requirement New feature or idea on top of harbor

Comments

@olifur
Copy link

olifur commented May 27, 2022

Dear developers,

In our company we use OpenLDAP without the memberof user attribute because it is not supported.

LDAP by default (see RFC https://datatracker.ietf.org/doc/html/rfc4519#section-2.17) defines only a member attribute on groups and not a memberof attribute on users.

As we have no control over the companys LDAP configuration but need to authorize by LDAP groups in harbor, its important for us that the member group attributes gets supported in harbor. Memberof overlays are no option for us.

I have seen that there is MR for this feature, but it has not been approved or enhanced.

We would like to have this feature, as it is crucial for us to use the harbor registry in an enterprise environment.

Best,
Oliver

Sources:

https://stackoverflow.com/questions/22003134/is-there-an-ldap-standard-group-membership-attribute-for-users
#9328
#13501
https://datatracker.ietf.org/doc/html/rfc4519#section-2.17

@stonezdj stonezdj added help wanted The issues that is valid but needs help from community kind/requirement New feature or idea on top of harbor labels May 30, 2022
@chrifey
Copy link

chrifey commented Jun 7, 2022

Hi,

we are also facing this issue. I tried to summarize this a bit, since there are some issues / PRs already open.

As mentioned, the issue occurs when the ldap object looks like per RFC:

Group (contains two members):

dn: cn=projekt-power-dev,ou=groups,dc=example,dc=com
cn: projekt-power-dev
description:: UHJvamVrdCBEZXZlbG9wZXIgZsO8ciBkYXMgUHJvamVrdCBLw7xobHVuZw==
member: cn=Larry,ou=users,dc=example,dc=com
member: cn=Lenny,ou=users,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
owner: cn=admin,dc=example,dc=com

User (no memberof overlay, so no reference to the groups from there):

dn: cn=Lenny,ou=users,dc=example,dc=com
cn: Lenny
displayname: Lenford Leonard
mail: Lenny@example.com
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: top
sn: Lenny
userpassword: {MD5}xyz==

As far as I understand, harbor-core LDAP integration seems to only look at the user, in order to query the groups (memberof). There is no mechanism that queries the group to check if a user is member.

https://github.com/goharbor/harbor/blob/main/src/pkg/ldap/ldap.go#L174

I found an issue from 2019, which seems to be stale: #9328

There is also a PR that adresses the issue, but since it covered not all cased it was not merged: #13501

Other related issues / PRs I found:

As far as I understand, we would need an implementation that, if a group is defined in harbor, it checks the group if the user is member of it (e.g. check memberof, after that check the group).

1 similar comment
@chrifey
Copy link

chrifey commented Jun 7, 2022

Hi,

we are also facing this issue. I tried to summarize this a bit, since there are some issues / PRs already open.

As mentioned, the issue occurs when the ldap object looks like per RFC:

Group (contains two members):

dn: cn=projekt-power-dev,ou=groups,dc=example,dc=com
cn: projekt-power-dev
description:: UHJvamVrdCBEZXZlbG9wZXIgZsO8ciBkYXMgUHJvamVrdCBLw7xobHVuZw==
member: cn=Larry,ou=users,dc=example,dc=com
member: cn=Lenny,ou=users,dc=example,dc=com
objectclass: groupOfNames
objectclass: top
owner: cn=admin,dc=example,dc=com

User (no memberof overlay, so no reference to the groups from there):

dn: cn=Lenny,ou=users,dc=example,dc=com
cn: Lenny
displayname: Lenford Leonard
mail: Lenny@example.com
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: top
sn: Lenny
userpassword: {MD5}xyz==

As far as I understand, harbor-core LDAP integration seems to only look at the user, in order to query the groups (memberof). There is no mechanism that queries the group to check if a user is member.

https://github.com/goharbor/harbor/blob/main/src/pkg/ldap/ldap.go#L174

I found an issue from 2019, which seems to be stale: #9328

There is also a PR that adresses the issue, but since it covered not all cased it was not merged: #13501

Other related issues / PRs I found:

As far as I understand, we would need an implementation that, if a group is defined in harbor, it checks the group if the user is member of it (e.g. check memberof, after that check the group).

@github-actions
Copy link

github-actions bot commented Jul 8, 2022

This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days.

@github-actions github-actions bot added Stale and removed Stale labels Jul 8, 2022
@jwetzell
Copy link

+1 to adding the ability to use a member attribute of the group for when the users object does not have any sort of membership attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted The issues that is valid but needs help from community kind/requirement New feature or idea on top of harbor
Projects
None yet
Development

No branches or pull requests

4 participants