방문자 IP 주소를 기반으로 인증을 요구하거나 우회하도록 Joomla를 어떻게 설정합니까?

방문자 IP 주소를 기반으로 인증을 요구하거나 우회하도록 Joomla를 어떻게 설정합니까?

방문자 IP 주소를 기반으로 인증을 요구하거나 우회하도록 Joomla를 어떻게 설정합니까?

방문자가 특정 IP 주소나 서브넷에서 방문하지 않는 한 로그인을 요구하는 Joomla 웹사이트를 설정하고 싶습니다.

또한 로그인을 LDAP 기반으로 하고 싶습니다.

저는 로컬 네트워크에서 Joomla 사이트를 호스팅하고 포트 전달을 사용하여 라우터를 통해 사이트를 노출할 것입니다.

답변1

방문자가 특정 IP 주소나 서브넷에서 방문하지 않는 한 로그인을 요구하는 Joomla 웹사이트를 설정하고 싶습니다.

아래와 같이 Joomla용 가상 호스트를 생성합니다.

<VirtualHost *:80>
    ServerName  joomla.yourdomain.com
    ServerAdmin ...
    DocumentRoot /var/www/html/joomla
    ErrorLog logs/joomla.error_log

    <Directory "/var/www/html/joomla">
        Options ...
        Order allow,deny
        Allow from 192.168.1.0/24
        Satisfy Any
    </Directory>
</VirtualHost>

또한 로그인을 LDAP 기반으로 하고 싶습니다.

당신은 그것을 사용하여 그것을 할 수 있습니다mod_authz_ldap, 이 같은:

LoadModule authz_ldap_module modules/mod_authz_ldap.so

<IfModule mod_authz_ldap.c>

   <Location /var/www/html/joomla>
       AuthBasicProvider ldap
       AuthzLDAPAuthoritative Off
       AuthLDAPURL ldap://IP:3268/dc=domain,dc=com?sAMAccountName
       AuthLDAPBindDN cn=binduser,dc=domain,dc=com
       AuthLDAPBindPassword secret
       AuthType Basic
       AuthName "Authorization required"
       require valid-user
       AuthzLDAPLogLevel debug
   </Location>

</IfModule>

LDAP(MS-AD)를 사용하는 HTTPS 인증이 옵션인가요?

예.

답변2

이것이 당신이 추구하는 것인지 확실하지 않지만 ..

또 다른 옵션은 IP를 통한 액세스를 허용하도록 .htaccess 파일을 변경하는 것입니다.

<Limit GET>
    Order Deny,Allow
    Deny from all
    Allow from 100.100.100.100
</Limit>

선택 사항: 여러 주소를 쉼표로 구분하여 추가할 수 있습니다.

100.100.100.101, 100.100.100.102 

답변3

살펴볼 Apache 문서는 다음과 같습니다.액세스 제어('호스트별' 섹션), 인증, 권한 부여 및 액세스 제어('satisfy' 지시문),mod_auth_basic, 그리고mod_authnz_ldap. 원하는 작업을 수행하기 위한 샘플 구성은 다음과 같습니다.

AuthType Basic
AuthBasicProvider ldap
AuthName "Joomla"
# change the ldap attributes to what matches your environment
AuthLDAPBindDN "uid=example,ou=example,dc=example,dc=com"
AuthLDAPBindPassword example
AuthLDAPURL "ldap://example.com:port/basedn?attribute?scope?filter"
Order allow,deny
# change the ip to match your network that should not have to authenticate
Allow from 10.0.0.0/24
Satisfy any

답변4

nginx를 프록시 프런트엔드로 설정해야 합니다. Nginx는 다음 구성 지시문을 사용하여 이를 수행할 수 있습니다.

auth_basic      "Restricted";
auth_basic_user_file  htpasswd;
satisfy any;
allow 10.0.0.0/24;
allow 10.1.0.0/24;
allow 10.2.1.1;
deny all;

이렇게 하면 명시적으로 나열된 IP에 대한 인증을 우회 allow하고 다른 모든 IP에 대한 인증 팝업 대화 상자를 표시할 수 있습니다.

관련 정보