LINUX.ORG.RU
ФорумAdmin

Аутентификация Apache через LDAP в домене FreeIPA

 , ,


0

3

Коллеги, не склчалось кому делать аутентификацию для Apache в домене FreeIPA с доступом только для членов группы?

Просто проверить наличие пользователя в домене через krb5 или gssapi отлично работает. Но надо пускать только членов определённой группы. Вот тут затык. Понятно, что делать надо через LDAP, но на сайте разрабов FreeIPA статья по этому поводу ещё в зачаточном состоянии, а при настройке аналогично с AD работать не хочет.

Конфиг сейчас такой:

<VirtualHost *:8080>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory /var/www/html/>
        AuthType GSSAPI
        AuthName "test"
        #GssapiBasicAuth On
        GssapiCredStore keytab:/etc/apache2/http.keytab
        GssapiDelegCcacheUnique On
        GssapiAllowedMech krb5
        GssapiLocalName On
        GssapiDelegCcacheDir /tmp
        GssapiDelegCcacheUnique On
        AuthLDAPGroupAttribute member
        AuthLDAPURL "ldap://server.dom.lan:389/dc=dom,dc=lan?userPrincipalName"
        AuthLDAPBindDN "uid=ldap_reader,cn=users,cn=accounts,dc=dom,dc=lan"
        AuthLDAPBindPassword SecretPass
        AuthLDAPGroupAttributeIsDN on
        Require ldap-group "CN=apache,CN=groups,CN=accounts,DC=dom,DC=lan"
   </Directory>
</VirtualHost>


Последнее исправление: mar1ner (всего исправлений: 1)
Ответ на: комментарий от aol

Бро, ты не поверишь. Но ни хрена в Астре это не из коробки. У них есть ман как пускать пользователя ФриИПЫ на сайт. Но там пускает всех пользователей домена. А как пускать пользователя ФриИПЫ на сайт по принадлежности к определённой группе у них нет. Только для виндового домена. И в закрытой части их сайта тоже этого нет.

mar1ner
() автор топика
Ответ на: комментарий от einhander

У тебя же полный путь до группы. Но не уверен, что в этом проблема.

Поменял. Толку ни какого Меня вот это смущает, DN какого пользователя он найти не может?

[Mon Apr 07 10:26:00.478821 2025] [authnz_ldap:debug] [pid 80490] mod_authnz_ldap.c(892): [client 172.16.99.73:57052] AH01711: auth_ldap authorise: User DN not found, User not found
[Mon Apr 07 10:26:00.478889 2025] [authz_core:debug] [pid 80490] mod_authz_core.c(818): [client 172.16.99.73:57052] AH01626: authorization result of Require ldap-group "CN=apache": denied

У меня впечателение, что ему на авторизацию передётся пользователь как в керберосе user@DOMAIN, а что с такой конструкцией делать мод апача не знает.

mar1ner
() автор топика

Уверен, что AuthLDAPGroupAttributeIsDN должна быть включена?

When set on, this directive says to use the distinguished name of the client username when checking for group membership. Otherwise, the username will be used. For example, assume that the client sent the username bjenson, which corresponds to the LDAP DN cn=Babs Jenson, o=Example. If this directive is set, mod_authnz_ldap will check if the group has cn=Babs Jenson, o=Example as a member. If this directive is not set, then mod_authnz_ldap will check if the group has bjenson as a member.

anonymous
()
Ответ на: комментарий от anonymous

Как вариант поиграться с AuthLDAPGroupAttribute.

This directive specifies which LDAP attributes are used to check for user members within groups. Multiple attributes can be used by specifying this directive multiple times. If not specified, then mod_authnz_ldap uses the member and uniqueMember attributes.

anonymous
()