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

harbor warns about not getting groups excluded by ldap group base dn #20038

Closed
opticabjohannsen opened this issue Feb 26, 2024 · 9 comments · Fixed by #21034
Closed

harbor warns about not getting groups excluded by ldap group base dn #20038

opticabjohannsen opened this issue Feb 26, 2024 · 9 comments · Fixed by #21034
Assignees

Comments

@opticabjohannsen
Copy link

opticabjohannsen commented Feb 26, 2024

Harbor version 2.9.2

We have a setup, where our OpenLDAP server provides configurations for multiple services (Bitbucket, Jenkins etc)
Further our groups are split into stages (dev, integration, prod)
Within those groups we have duplicate group names (e.g jenkins_user)

cn=bitbucket_user,ou=bitbucket,ou=ops,ou=groups,dc=company,dc=local
cn=bitbucket_admin,ou=bitbucket,ou=ops,ou=groups,dc=company,dc=local

Not all our users should have all groups.
I now have the problem, that i created 2 new groups for our harbor users

cn=harbor_user,ou=harbor,ou=ops,ou=groups,dc=company,dc=local
cn=harbor_admin,ou=harbor,ou=ops,ou=groups,dc=company,dc=local

So i set the LDAP Group Base DN value to ou=harbor,ou=ops,ou=groups,dc=company,dc=local
Everything works as expected. Users can login and are either user or admin depending on the group.
BUT:
on every login i get a message for EVERY single group that the user is a member of. Which in my users case are over 70

[WARNING] [/core/auth/ldap/ldap.go:127]: Can not get the ldap group name with DN cn=bitbucket_user,ou=bitbucket,ou=ops,ou=groups,dc=company,dc=local

[WARNING] [/core/auth/ldap/ldap.go:127]: Can not get the ldap group name with DN cn=bitbucket_admin,ou=bitbucket,ou=ops,ou=groups,dc=company,dc=local

Why is it even trying to read this group, the group base dn distinctly different.
i tried multiple version of using base dn and LDAP Group Filter.
The only solution i found was to allow all ldap groups below ou=groups,dc=company,dc=local, which then results in duplicate name warnings on every single login.
As said it doesn't break anything. It's just anoying spam about information, that i don't need.

is there a way to:

  • suppress this warning
  • configure something to resolve the WARNING
    below a screenshot of my (working) ldap config

Screenshot_20240226_150740

@opticabjohannsen opticabjohannsen changed the title harbor warns about not getting groups excluded by base dn harbor warns about not getting groups excluded by ldap group base dn Feb 26, 2024
@stonezdj stonezdj self-assigned this Feb 27, 2024
@stonezdj
Copy link
Contributor

stonezdj commented Mar 1, 2024

Could you please try this allow all ldap groups below ou=groups,dc=company,dc=local and change the LDAP group filter option to filter out the unused groups

@opticabjohannsen
Copy link
Author

I changed LDAP Group Base DN to
ou=groups,dc=company,dc=local
and LDAP Group filter to cn=harbor_user
I'm still getting messages for all other groups, that it could not read

@opticabjohannsen
Copy link
Author

just a bump. issue still exists (at least on my installation)

@ansromanov
Copy link

I experienced the same behavior with Harbor v2.9.4-a6d707df and FreeIPA.

My LDAP filtering is following:
image

But I have lot of warnings in logs (entries are changed because of the security reasons), when I tried to login with user who is part or cn=harbor_admins,cn=groups,cn=accounts,dc=company,dc=local group:

Can not get the ldap group name with DN cn=devops,cn=groups,cn=accounts,dc=company,dc=local
Can not get the ldap group name with DN cn=project1_admins,cn=groups,cn=accounts,dc=company,dc=local
Can not get the ldap group name with DN cn=project2_users,cn=groups,cn=accounts,dc=company,dc=local

Copy link

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 the Stale label Jun 25, 2024
@opticabjohannsen
Copy link
Author

As far as i can tel, the issue is still not solved

@github-actions github-actions bot removed the Stale label Jun 26, 2024
Copy link

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 the Stale label Aug 26, 2024
Copy link

This issue was closed because it has been stalled for 30 days with no activity. If this issue is still relevant, please re-open a new issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2024
@stonezdj stonezdj reopened this Oct 14, 2024
@stonezdj stonezdj removed the Stale label Oct 14, 2024
@stonezdj
Copy link
Contributor

The warning message should changed to debug level to avoid noise in the log.

stonezdj added a commit to stonezdj/harbor that referenced this issue Oct 14, 2024
…are many unused ldap groups for each user

  fixes goharbor#20038

Signed-off-by: stonezdj <[email protected]>
stonezdj added a commit that referenced this issue Oct 14, 2024
#21034)

Change the log level from warning to debug to avoid noise when there are many unused ldap groups for each user

  fixes #20038

Signed-off-by: stonezdj <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants