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

customAcls are not added #115

Closed
rhizoet opened this issue Jul 25, 2023 · 26 comments
Closed

customAcls are not added #115

rhizoet opened this issue Jul 25, 2023 · 26 comments
Labels
wontfix This will not be worked on

Comments

@rhizoet
Copy link

rhizoet commented Jul 25, 2023

Describe the bug
I've added customAcls for a read-only admin user. But it seems that the rules are not applied.

To Reproduce
Steps to reproduce the behavior:

  1. Add some customAcls
  2. Do a ldapsearchwith the user which should have the read-only admin rights
  3. Get
# extended LDIF
#
# LDAPv3
# base <dc=regio,dc=digital> with scope subtree
# filter: (objectclass=*)
# requesting: ALL
#

# search result
search: 2
result: 32 No such object

# numResponses: 1

Expected behavior
The customAcls should be updated with the values in the file.

Additional context
values.yaml:

global:
  ldapDomain: ldap.example.com
  adminPassword: password
  configPassword: password
service:
  type: LoadBalancer
customTLS:
  enabled: true
  secret: openldap-ldap
customAcls: |-
  dn: olcDatabase={2}mdb,cn=config
  changetype: modify
  replace: olcAccess
  olcAccess: {0}to *
    by dn.exact=gidNumber=0+uidNumber=1001,cn=peercred,cn=external,cn=auth manage
    by * break
  olcAccess: {1}to attrs=userPassword,shadowLastChange
    by self write
    by dn="cn=admin,dc=example,dc=com" write
    by anonymous auth by * none
  olcAccess: {2}to *
    by dn="cn=admin-read,dc=example,dc=com" read
    by dn="cn=admin,dc=example,dc=com" write
    by set="user/employeeType & [ldap_reader]" read
    by self read
    by * none
ltb-passwd:
  ingress:
    annotations:
      kubernetes.io/ingress.class: nginx
      cert-manager.io/cluster-issuer: letsencrypt-prod
    hosts:
    - "passwd.ldap.example.com"
    tls:
    - secretName: passwd-ldap
      hosts:
      - passwd.ldap.example.com
phpldapadmin:
  ingress:
    annotations:
      kubernetes.io/ingress.class: nginx
      cert-manager.io/cluster-issuer: letsencrypt-prod
    hosts:
    - "admin.ldap.example.com"
    tls:
    - secretName: admin-ldap
      hosts:
      - admin.ldap.example.com
@jp-gouin
Copy link
Owner

Hi @rhizoet

what the expected behavior of by set="user/employeeType & [ldap_reader]" read ?

@rhizoet
Copy link
Author

rhizoet commented Jul 27, 2023

Hi @jp-gouin ,

that was a test for "when a user has the employeeType set with LDAP_READER the user should read the whole LDAP"
But that also does not work.

@jp-gouin
Copy link
Owner

jp-gouin commented Jul 27, 2023

Ok did you follow the advance example ?

@jp-gouin
Copy link
Owner

jp-gouin commented Jul 27, 2023

I think your ldapDomain does not match your acl . You have ldap.example.com so all dn in the acl should be cn=admin,dc=ldap,dc=example,dc=com and same logic for admin-read

@rhizoet
Copy link
Author

rhizoet commented Jul 27, 2023

But the base-dn is dc=example,dc=com. I've only changed the domain later on. The base-dn is sticked to to dc=example,dc=com. The admin works for me. I can auth at the phpldapadmin and can sync with other apps. But I don't want to sync the whole ldap with the admin who can also write.

And yes, I've followed the advanced examples.

@pschichtel
Copy link
Contributor

I faced this same issue. I worked around it exporting my ldap contents, deleting the deployment including PVs, deploying again with the new ACLs and then importing my ldap contents.

It seems that ACLs changes are not being applied after the first start.

@jp-gouin
Copy link
Owner

The base image used is Bitnami openldap

Seems that indeed it loaded only on first boot. If you wish to be able to update this configuration, please raise an issue or PR on the container as handling the update at the container is best.

@pschichtel
Copy link
Contributor

I created bitnami/containers#44545 upstream

@stale
Copy link

stale bot commented Oct 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 12, 2023
@pschichtel
Copy link
Contributor

Is there even any changes needed here?

@stale stale bot removed the wontfix This will not be worked on label Oct 13, 2023
@SamuelLHuber
Copy link

Is there even any changes needed here?

from what I can tell this is an upstream thing, though the related issue has been automatically closed by bots upstream bitnami/containers#44545

@zerowebcorp
Copy link

Wondering if an InitContainer can help with this.

@pschichtel
Copy link
Contributor

I did some tests and came to the conclusion that I'll add functionality upstream to run script on every start. With that anyone can just add a small bash script to the container that does whatever they need.

Copy link

stale bot commented Mar 14, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Mar 14, 2024
@pschichtel
Copy link
Contributor

I still plan to fix this upstream eventually

@stale stale bot removed the wontfix This will not be worked on label Mar 14, 2024
Copy link

stale bot commented May 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label May 13, 2024
@pschichtel
Copy link
Contributor

This is so very annoying.

@stale stale bot removed the wontfix This will not be worked on label May 13, 2024
@davidfrickert
Copy link
Contributor

I'm also experiencing this issue, even on first start the ACLs are not added. Any ideas?

sudo LDAPTLS_REQCERT=hard LDAPTLS_CACERT=/etc/ssl/certs/TestLDAP_CA.pem ldapsearch -x -H ldaps://127.0.0.1.sslip.io:636 -b "cn=config" '(objectClass=olcDatabaseConfig)' -D "cn=admin,dc=asml,dc=com" -W olcAccess
Enter LDAP Password:
# extended LDIF
#
# LDAPv3
# base <cn=config> with scope subtree
# filter: (objectClass=olcDatabaseConfig)
# requesting: olcAccess
#

# search result
search: 2
result: 32 No such object

# numResponses: 1

@pschichtel
Copy link
Contributor

@davidfrickert push this: bitnami/containers#44545 (it's closed, but not solved).

@davidfrickert
Copy link
Contributor

maybe these are different issues. i just disabled replication and the customAcls are applied. but with replication they don't seem to work

@davidfrickert
Copy link
Contributor

davidfrickert commented Jun 19, 2024

It seems that when running openldap as cluster with this helm chart, as soon as openldap-1 pod comes up healthy, the acl is lost.
Don't know why, but sorta fixed by running kubectl exec -n keycloak-iam openldap-0 -- bash -c "/opt/bitnami/openldap/bin/ldapmodify -Y EXTERNAL -H ldapi:/// -f /opt/bitnami/openldap/etc/schema/acls.ldif" after cluster healthy...

Copy link

stale bot commented Aug 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 18, 2024
@pschichtel
Copy link
Contributor

Nope

@stale stale bot removed the wontfix This will not be worked on label Aug 18, 2024
Copy link

stale bot commented Oct 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 18, 2024
@pschichtel
Copy link
Contributor

.

Copy link

stale bot commented Dec 18, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 18, 2024
@stale stale bot closed this as completed Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants