Overview
Using a reverse proxy infront of PhenixID Identity Manager (IM), PhenixID Password Self Service (PPSS) or PhenixID Certificate Service (CS) make sure there are no direct access to the servers. All client communication goes through the ReverseProxy.
This document is our, PhenixID, best practice to using Reverse Proxy.
For our products based on PhenixID Platform Service we recommend using HTTP instead.
Link to document – PSD1075
Technical Overview
Apache terminates the SSL session and then forwards all traffic to the PhenixID service.
The PhenixID service holds all program logic except for the SSL negotiation.
It is recommended that Apache and PhenixID services are installed on separate hardware but they may also be installed on the same physical server.
Appropriate firewall openings made (for example below):
Internet -> Apache HTTP server, TCP port 443 (HTTPS)
Apache HTTP server -> PhenixID IM/PPS/CS, TCP port 8009 (AJP)
Linux or Windows
This document consist of to main section.
- Configure on Linux
- Configure on Windows
Prerequisite for using AJP is that the applications run on Apache Tomcat.
1. Configure on Linux
Apache modules
Mod_jk is the module responsible for forwarding traffic using AJP from Apache to the PhenixID service.
First install mod_jk, for example:
sudo apt-get install libapache2-mod-jk
If the module does not get enabled when doing install, enable mod_jk (for example):
a2enmod jk
Apache configuration
Create a new text file (if not created through install) in /etc/apache2/mods-available, named jk.conf.
Add the following contents:
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/jk.log
JkLogLevel info
JkExtractSSL On
JkMount /selfservice* selfservice
Add the following contents, where <back-end-ip> is the IP address to the PhenixID server:
worker.list=selfservice
worker.selfservice.port=8009
worker.selfservice.host=192.168.0.19
worker.selfservice.type=ajp13
Add the following lines within the virtual host directive:
JkMount /selfservice* selfservice
Tomcat configuration
In the Tomcat file structure in the file conf/server.xml verify that the AJP connector is enabled.
Should look something like this:
<!– Define an AJP 1.3 Connector on port 8009 –>
<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ />
The Tomcat service needs to be restarted after the changes.
*************** END of section “Configure on Linux” ***************
2. Configure on Windows
Server version used for this instruction was Windows Server 2016.
Download and install Apache HTTP server on Windows
******************** Important! ********************
There are several sites where you can download an installer for Apache HTTP server, www.apachelounge.com is one of them and well known. After you have downloaded and before you attempt to install, you should make sure that the installer is is intact and has not been tampered with. Use the PGP Signature and/or the SHA Checksums to verify the integrity. PhenixID is not accountable for the content or availability of these websites or sources where you can download Apache software. PhenixID gives no guarantee, nor does it accept any responsibility for the content, data, advices, announcements, software, products or other material on these websites or sources.
*****************************************************
- Download the latest stable version of Apache HTTP server for Windows.
For this document we used version 2.4.25- Go to https://www.apachelounge.com/download/
- Download Apache HTTP server for Windows
- Download Microsoft prerequisite for above Apache HTTP server version
- Download “Microsoft Visual C++ 2015 Redistributable Update 3”
- https://www.microsoft.com/en-us/download/confirmation.aspx?id=53840
- Install Apache HTTP server and Microsoft prereq on Windows
- Install “Microsoft Visual C++ 2015 Redistributable Update 3”
- Run vc_redist.x64.exe
- Run through and complete installation wizard
- Unzip httpd-2.4.25-win64-VC14.zip
- Open the folder and copy the folder /Apache24 to c:/ (or other preferred drive)
- C:\Apache24
- Install “Microsoft Visual C++ 2015 Redistributable Update 3”
- Install Apache HTTP Server as a service
- Open Command Prompt
- Type “cd Apache24/bin” and press Enter
- Type “httpd.exe -k install” and press Enter
- Verify that Apache HTTP Server was installed succesfully
- Open Services (services.msc)
- Look for service named Apache2.4
- Start service
Configure server.xml to disable http on IM/PPSS/CS
Disable http port on IM/PPSS or CS server
- Open server.xml (\tomcat8-im\conf)
- Find following line and disable defautl port of IM/PPSS or CS. In this case the port was 8090. Use <!– –> to disable port.
<!– <Connector port=”8090″ protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ />
–> - Save and restart service
- Verify that port is not active any more.
Verify that AJP port is enabled
- Open server.xml (\tomcat8-im\conf)
- Verify following line is not disabled
<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ /> - Save and restart service if needed
Download and add appropriate Tomcat connector
- Download corresponding Tomcat connector from https://www.apachelounge.com/download/
- For this configuration we download mod_jk-1.2.42-win64-VC14.zip
- Unzip and copy mod_jk.so to drive:\..\Apache2.2\modules
Load appropriate modules in httpd.conf
- Open httpd.conf
- C:\Apache24\conf
- Add following module by
LoadModule jk_module modules/mod_jk.so - Enable following modules by removing the #
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so - Save file httpd.conf
- Restart Apache HTTP server and verify
Disable port 80 on Apache HTTP server
For security reasons you might like to disable http or port 80 or maybe you disable this access is configured in your firewall.
To disable port 80 on Apache HTTP server:
- Open file httpd.conf
- Find “Listen 80”
- Remove line or add a # in start of line
# Listen 80 - Save file httpd.conf
- Restart Apache HTTP server and verify
Add SSL certificate to your installation
Please visit PSD1078
Include httpd-ssl.conf in httpd.conf
- Open file httpd.conf
- Locate following lines and make sure include line is NOT disable.
Correct configuration should look like follows:
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf - Save file httpd.conf
- Restart Apache HTTP server and verify
Include jk.conf in httpd-ssl.conf
- Open file extra/httpd-ssl.conf
- Locate following lines and make sure include line is NOT disable.
Correct configuration should look like follows:
Include conf/jk.conf - Save file httpd-ssl.conf
- Restart Apache HTTP server and verify
Include parameter to httpd-ssl.conf
- Open file extra/httpd-ssl.conf
- Locate following lines in file: <VirtualHost _default_:443>
- Below that line add following line:
JkMountCopy On - Save file httpd-ssl.conf
- Restart Apache HTTP server and verify
Create files workers.properties and jk.conf
Create and configure workers.properties (this example shows how to enable IM)
- Create file “workers.properties” and save it to /Apache24/conf/
- Add the following lines:
# Worker for IdentityManager.
worker.list=IdentityManager
worker.IdentityManager.port=8009
worker.IdentityManager.host=127.0.0.1
worker.IdentityManager.type=ajp13 - Above example, IM is on same server as Apache HTTP Server
- Create file “jk.conf” and save it to /Apache24/conf/
- Open jk.conf and add the following lines:
JkWorkersFile conf/workers.properties
JkLogFile logs/jk.log
JkLogLevel info
JkExtractSSL On
JkMount /phenixid* IdentityManager
- Above example, IM is on same server as Apache HTTP Server
- Save both files and restart the Apache HTTP Server
Verify configuration
Open a browser and go to your FQDN and verify your configuration
e.g. https://server_name.phenixid.local/phenixid/
Misc
Ghostcat fix
Apache Tomcat has officially released versions 9.0.31, 8.5.51, and 7.0.100 to fix this vulnerability.
By exploiting of the Ghostcat vulnerability, an attacker will be able to read the contents of configuration files and source code files of all webapps deployed on Tomcat.
Configuration of server.xml
Add the secret parameter
- Open server.xml (drive:\…\PhenixID\IM\server\conf)
- Find the line <!– <Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ secret=”changePasswordreadPSD1097″/> –>
By default AJP is disabled. To enable AJP, remove <!– in front and –> at the end. - Result should look like:
<Connector port=”8009″ protocol=”AJP/1.3″ redirectPort=”8443″ secret=”changePasswordreadPSD1097″/>
Configuration of workers.properties.minimal
Add the worker.ajp13w.secret parameter
- Open workers.properties.minimal (drive:\…TomcatConnectorIIS\conf)
- Add worker.ajp13w.secret=changePasswordreadPSD1097 to a password of your choice.
- Restart the IIS service
DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.
PhenixID - support.phenixid.se