Sign inSign up

dariko/httpd-rproxy-ldap

By dariko

Updated almost 8 years ago

Apache httpd reverse proxy with LDAP authentication

Image
1

10K+

dariko/httpd-rproxy-ldap repository overview

httpd-ldap-rproxy

Apache reverse proxy (mod_proxy) with Basic authentication via LDAP (mod_authnz_ldap)

Running
docker build -t httpd-ldap-rproxy
docker run -p 443:443 -e LDAP_URI="ldap://ldap.example.com/dc=example,dc=com?uid?sub?(objectClass=*)" \
           -e PROXY_URI="http://www.example.com" -e SERVERNAME="ldap-protected.www.example.com" \
           -e HTTPS_PEM_CERT="$(cat $TLS_CERTIFICATE)" -e  HTTPS_PEM_KEY="$(cat $TLS_CERTIFICATE_KEY)" \
           httpd-ldap-rproxy
Environment variables
VariableMandatoryDefaultDescription
LISTEN_PORTyes80Specifies the port the apache server will listen to.
PROXY_URIyesSpecifies the parameter for apache's ProxyPass and ProxyPassReverse directives.
SERVERNAMEnolocalhost.localdomainSpecifies the parameter for apache's ServerName directive. Must match HTTPS_PEM_CERT cn
BASIC_AUTH_STRINGnoLDAP AuthenticationSpecifies the parameter for apache's AuthName directive.
HTTPS_CERT_PEMnoApache's SSL/TLS PEM certificate text. If given needs HTTPS_KEY_PEM to be set too. If not given SSL will be disabled.
HTTPS_KEY_PEMnoApache's SSL/TLS PEM certificate key text."
NO_VERIFY_SERVER_CERTnoIf set skips server certificate verification.
DHPARAM_PEMyesApache's SSL/TLS PEM DHParameter."
CUSTOM_APACHE_CONFIGnoSpecifies custom parameters to be appended to the apache virtualhost configuration.
LDAP_URIyesSpecifies the URI of the LDAP server, as documented here.
LDAP_BIND_DNnoSpecifies the DN used for search, as documented here. Not allowed if LDAP_BIND_USER_PATTERN is set.
LDAP_BIND_PASSWORDnoSpecifies the Password used for bind of the LDAP server, as documented here.
LDAPS_CACERT_PEMnoLDAP CA Certificate.
LDAP_BIND_USER_PATTERNnoSpecifies the parameter for apache's AuthLDAPInitialBindPattern. Also sets AuthLDAPInitialBindAsUser, AuthLDAPSearchAsUser and AuthLDAPCompareAsUser to "on"
SOCACHE_TIMEOUTnoIf set enables authn_socache_module with the specified value as parameter to the AuthnCacheTimeout directive.
PROXY_URIyesSpecifies the parameter for apache's ProxyPass and ProxyPassReverse directives.
REQUIRE_CONDnoRequire valid-userApache Require directives, will be enclosed in a .
LOGLEVELnowarnSpecifies the parameter for apache's LogLevel.
DISPLAY_CONFIGnoIf set display the templated configuration before starting apache
ENABLE_WEBSOCKETnoyesIf set to yes enables mod_proxy_wstunnel
ENABLE_XFF_LOGnoyesIf set to yes log X-forward-for instead of client-IP
PEM Certificates/keys

The variables requiring PEM certificates/keys must contain the certificate text including the newlines.

If invoking docker via command line:

-e LDAPS_CACERT_PEM="-----BEGIN CERTIFICATE-----\n...\n..."
-e LDAPS_CACERT_PEM="$(cat $TLS_CERTIFICATE_FILE)"

If using docker-compose, in the docker-compose.yml file:

environment:
  LDAPS_CACERT_PEM: |
    -----BEGIN CERTIFICATE-----
    ...
    ...
    -----END CERTIFICATE-----

Tag summary

Content type

Image

Digest

Size

67.3 MB

Last updated

almost 8 years ago

docker pull dariko/httpd-rproxy-ldap