Outlook WebAccess soll als Webmailer für einen Exchange-Server über das Internet zugreifbar sein. Da mir bei dem Gedanken an einen weltweit zugreifbaren, ungeschützten M$-IIS nicht wohl war musste eine sichere Lösung her. Was liegt näher, als aus bewährten Open-Source Tools wie Apache einen Proxy für OWA zu bauen?
Der Apache erfüllt hier 2 Funktionen:
-
Authentifizierung der Benutzer gegen ADS. Nur die berechtigten Nutzer, die sich erfolgreich authentifiziert haben, werden zum OWA-Proxy durchgelassen.
-
Der eigentliche OWA-Proxy wird als reverse proxy per mod_proxy realisiert.
Details: #
-
Der Benutzername für die mod_ldap Authentifizierung ist die primäre Email-Adresse. Damit diese auch für OWA als Anmeldename genutzt werden kann muss das Benutzerkonto in der ADS entsprechend konfiguriert werden.
-
Der Benutzer muss in der Gruppe OWA Mitglied sein.
Grenzen: #
-
Die LDAP-Abfrage erfolgt im Klartext. Dies ist keinesfalls für einen Produktiveinsatz in einer DMZ tauglich. Ich empfehle für die LDAP-Verbindung einen kryptographisch gesicherten Tunnel durch die DMZ einzusetzen (-> SSL eventuell auch per SSH-Tunneling)
-
Das Passwort darf keine Umlaute enthalten! Hier ist noch nicht klar ob das Problem vom Apache oder vom OWA selbst verursacht wird.
mod_proxy.conf: #
Wichtig: ProxyRequests muss auf off gesetzt sein, sonst stellt man einen offenen forward proxy bereit, der aus dem Internet missbraucht werden kann!
<IfModule mod_proxy.c> #turning ProxyRequests on and allowing proxying from all may allow #spammers to use your proxy to send email. ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow #Deny from all Allow from all </Proxy> ProxyVia full ProxyPreserveHost On</IfModule>der eigentliche apache vhost: #
NameVirtualHost *:443<VirtualHost *:443> SSLEngine On SSLCipherSuite HIGH:MEDIUM SSLCertificateFile /etc/apache2/ssl/mail.myfirma.de.crt SSLCertificateKeyFile /etc/apache2/ssl/mail.myfirma.de.key SSLProxyEngine on ErrorLog /var/log/apache2/owa_error TransferLog /var/log/apache2/owa_acces_log LogLevel info RequestHeader set Front-End-Https "On" RewriteMap percentsubject int:escape <Directory "/var/www/ssl"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> <Location "/"> AuthType Basic AuthName "OWA Authentifizierung" Require valid-user AuthLDAPAuthoritative On AuthLDAPEnabled On AuthLDAPBindDN myldapuser AuthLDAPBindPassword myldappassword #der User muss in in der OWA-Gruppe sein AuthLDAPURL ldap://myhost.de:3268/DC=demo,dc=myfirma,dc=de?mail?sub?(memberOf=cn=OWA,OU=OWA-Gruppen,OU=gruppen,OU=demo,DC=myfirma,DC=de) Allow from all </Location> <Location "/exchange"> SSLRequireSSL ProxyPass http://myowa-host:8888/exchange </Location> <Location "/exchweb"> ProxyPass http://myowa-host:8888/exchweb SSLRequireSSL </Location> <Location "/public"> ProxyPass http://myowa-host:8888/public SSLRequireSSL </Location> <Location /rpc> ProxyPass http://myowa-host:8888/rpc SSLRequireSSL </Location> <IfModule peruser.c> ServerEnvironment apache apache MinSpareProcessors 4 MaxProcessors 20 </IfModule> <IfModule itk.c> AssignUserID apache apache MaxClientsVHost 50 </IfModule></VirtualHost>