Seite wählen

NETWAYS Blog

Weekly Snap: Apache 2 Authentication, Hardware Starter Kit, LConf 1.2 & NoMa 2.0.2 Released

14 – 18 November was packed with new hardware, a Polish IT conference, a guide for Apache 2 authentication, and two new releases – LConf 1.2 and NoMa 2.0.2 our notification management addon for Icinga and Nagios.
Much awaited, Tobias released LConf 1.2 our configuration interface for Icinga and Nagios. Alongside bug fixes, major changes include: a return to installation per makefile, much consolidation of code for plugins such as LConfExp.pl, an option to use either the old or new OpenLDAP configuration, inclusion of a new test kit for developers to try out new features, and most exciting of all – host and service escalations. Improvements to the LConf for Icinga Web module were also made, in user masks and menus and configurations. Download LConf 1.2 and the LConf-Icinga-Mod 1.2.1 at netways.org.
From Managed Services, Marcus showed how to set up different authentication methods on Apache 2 per source IP. Using the example of a company that uses LDAP for internal authentication and MOTP for external, he applied an iptables rule to redirect queries from the internal/external sources onto a two different ports. On each of these ports, he then set up a VHost to offer the different authentication methods. Even better, he recommended iptables-save, to enable settings to be retrieved with an init script making life easier after a reboot.
Bernd spoke at an IT conference  in Warsaw on “Monitoring with Icinga”. The event focused on reliability and monitoring so in addition, we joined forces with our OSMC partner Thomas Krenn, to present practical business applications of open source in various showcases live.
Last but not least, our new hardware guru Georg introduced the latest addition to our online store – monitoring and SMS alerts in an all-in-one starter kit. It combines a SecurityProbe 5E Standard that can monitor up to 8 locations (with expansion units and Cat5 connection), a temperature sensor with a 0.3m cable (can add up to 300m extension cable with Cat5 connector) and a Teltonika Modem USB/G10. The AKCP SecurityProbe 5E Standard SMS Starter Kit offers simple monitoring for remote locations and best of all comes at an 11% discount. More sensors can be found at our shop.

Apache 2: Authentifizierungsmethoden über Source-IP steuern

Mit den normalen Bordmitteln des Apache2 ist es aktuell nicht möglich, zwei verschiedene Authentifizierungsmethoden zu verwenden. Gebrauchen kann man das aber beispielsweise sehr gut, wenn man einen webbasierten Dienst hat, welchen man für das interne Firmennetzwerk gegen LDAP und von extern über MOTP authentifizieren lassen möchte. Vorteil ist dabei, dass die nach außen offene Seite nicht durch Bruteforce-Attacken „gehackt“ werden kann.
Um diese Unterscheidung der Netze zu realisieren, wird eine iptables-Regel eingerichtet, welche alle Anfragen einer bestimmten Quelle auf einen anderen Port umleitet. Zusätzlich muss noch ein VHost angelegt werden, welcher auf diesem Port lauscht und die gewünschte Authentifizierung anbietet.
Ein kleines Praxisbeispiel:
Ich möchte, dass alle Anfragen, welche von extern kommen, gegen MOTP authentifiziert werden. Dafür lege ich einen VHost an, der auf Port 80 lauscht und MOTP als Authentifizierung anbietet.
Mein internes Netz, welches durch NAT nur eine IP (1.2.3.4) nach außen besitzt, soll sich gegen LDAP authentifizieren. Dafür lege ich ebenfalls einen VHost an, der auf Port 81 lauscht.
Nun leite ich den Verkehr, der von meinem Router des internen Netzes (IP 1.2.3.4) kommt auf Port 81 um. Da ich nicht will, dass alle Anfragen umgeleitet werden, weil ich noch mehrere Seiten auf meinem Server betreibe, habe ich zusätzlich den „LDAP-VHost“ auf die IP 127.0.0.2 gebunden.
Jetzt richte ich meine iptables-Regel ein:

iptables -t nat -A PREROUTING -s 1.2.3.4 -d 127.0.0.2 \
                -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 81

Nun werden alle Anfragen wie gewünscht umgeleitet. Mit iptables-save kann ich mir die aktuellen Einstellungen ausgeben lassen und sie später per init-Skript wieder mit aufnehmen. Somit sind die Einstellungen auch „rebootfest“. Wichtig sei noch zu erwähnen, dass pro VHost eine eigene, externe IP benötigt wird.