Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to use OpenLDAP members groups

    Scheduled Pinned Locked Moved General pfSense Questions
    30 Posts 2 Posters 2.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Gerard64 @stephenw10
      last edited by Gerard64

      Sorry if i am a bit confusing in the above posts.
      I try to be more clear.
      English is not my main language so i do my best ๐Ÿ˜‰

      As you can see on the pictures i only have 2 OUs People and Groups.
      I created 2 normal and 1 admin users in ou=People.

      Then i created 3 groups in ou=Groups.

      My plan is to use those CN groups (in ou=groups) to authorize several services to the users by adding the users to one or more of those cn groups (cn=users & cn=vpnusers & cn=admins).

      As an example i added users to the cn=vpnusers so i could give them access to de pfSense OpenVPN server.
      And the admin user i added to the cn=admins group to give him/them admin access to pfSense.

      But those groups under ou=Groups ar not selectable / configurable in pfSense or not that i know off how to do that.

      Only ou=People,dc=domain,dc=org is successful authenticating in "Diagnostics / Authentication" and the OpenVPN server.
      It doesn't matter of i enable or disable the other containers (cn=users / cn=vpnusers) they don't work.
      I added different users to those cn groups to test them separately so i know for sure which one does or doesn't work and both don't work.

      Although the cn=users and cn=vpnusers is seen by pfSense as you can see in one of the images from earlier i can not do anything with them like configure OpenVPN server to use for example the cn=vpnusers to authenticate a member user of that group. Or i just don't know yet how to do that.

      Just like "Diagnostics / Authentication" also OpenVPN server works successfully with users in ou=People,dc=domain,dc=org.
      cn=users,ou=Groups,dc=domain,dc=org or cn=vpnusers,ou=Groups,dc=domain,dc=org does not work.

      Or wel maybe it does and i just don't know jet how to do it, how to configure it.
      That is what i hope to learn.

      G 1 Reply Last reply Reply Quote 0
      • G
        Gerard64 @Gerard64
        last edited by

        When i configure the LDAP server in pfSense with only the cn=vpnusers like in this image and i make one of the ou=People,dc=domain,dc=org users member of that group then auth test gives unsuccessful.

        dcd59640-eecb-4a0a-9327-db0043a23456-afbeelding.png

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          But that does work for the same group in ou=People?

          G 1 Reply Last reply Reply Quote 0
          • G
            Gerard64 @stephenw10
            last edited by Gerard64

            I don't have groups in ou=people only users.

            f936cc68-2c65-4684-96a1-4702798826b6-afbeelding.png

            The single only thing that works is ...

            8bf791fd-2087-4f54-b01a-46c92374b3d7-afbeelding.png

            But this way i cannot select different services per user, what i would like to be able to do.
            If i only need users to authenticate then i can do that with my radius server then i don't need a ldap server.
            I was hoping i could do more with a ldap server like authenticate against group members.

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Hmm, so what were you testing initially where the LDAP sever is returning groups for a user when it authenticates?

              G 1 Reply Last reply Reply Quote 0
              • G
                Gerard64 @stephenw10
                last edited by Gerard64

                If i have ou=People,dc=domain,dc=org configured then i can successfully authenticate users in ou=people with "Diagnostics > Authentication" and also the OpenVPN server.

                Untitled-2.png

                pfSense then also recognizes if the user is a member of one or more groups.

                af3caf0f-69b3-43d8-8c84-ac40653cf4da-afbeelding.png

                It would be great if i could use those memberships of, for example, cn=vpnusers to authorize access to the OpenVPN server.

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  I don't believe you can do that directly for OpenVPN as there's no specific privilege required to allow a login. There is for Captive Portal login and IPSec Xauth so you can use it there.

                  You would need to configure an LDAP server instance that queried on users in that group.

                  But I have no idea why that doesn't work for the ou=Groups when it appears everything else is the same. Something must not be the same.

                  G 1 Reply Last reply Reply Quote 1
                  • G
                    Gerard64 @stephenw10
                    last edited by

                    That is a pity.
                    Would be great if we could do things like that.
                    Thanks a lot for thinking along with me ๐Ÿ‘

                    1 Reply Last reply Reply Quote 0
                    • G
                      Gerard64
                      last edited by Gerard64

                      Oke i think i fixed it.

                      I don't know if this is what fixed it but i installed and configured the memberOf overlay module in OpenLDAP.
                      I am going to test with a backup vm of my OpenLDAP without the memberOf overlay to see if this module is really needed.

                      Anyhow with the settings i have now (see the image below) i can add and remove users from the cn=vpnusers group and authorize users with that.
                      I tested it with several different members in the cn=vpnusers group.

                      3aa2582a-95a0-40ba-bddf-5e1fb895ca42-afbeelding.png

                      1 Reply Last reply Reply Quote 1
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        Aha! Nice catch.

                        G 1 Reply Last reply Reply Quote 0
                        • G
                          Gerard64 @stephenw10
                          last edited by

                          Oke i tested it with a backuped VM of my OpenLDAP server and the memberOf overlay module is not needed it stil works without that module ๐Ÿ’ƒ๐Ÿฅณ

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.