Confluence Docs 2.10 : Adding SSL for Secure Logins and Page Security
This page last changed on Aug 11, 2008 by rhartono.
This document describes how to configure Confluence to use a HTTPS encrypted secure socket layer for user logins and page data. Unencrypted confidential data within Confluence may be intercepted by an attacker. To secure user logins, you can enable access via HTTPS (HTTP over SSL), and require its use for pages where passwords are sent. In some cases where issue data is sensitive, all pages can be set to be accessed over HTTPS. Enabling SSL access is different for each application server, but specifying which pages to require protection for is generic. This document is specific to Tomcat, the default application server shipped with Confluence. Adding Secure User LoginsAdding HTTPS requires a valid SSL certificate. If you have a Certificate prepared, skip to the 'Modify the <INSTALL>/conf/server.xml File' section. Creating A New SSL CertificateOn Windows, perform the following at the command prompt:
"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
Or on other platforms, perform the following at the command prompt: $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA Some questions will be asked, including a password for the certificate (the default is 'changeit'). Please note down what you choose, as it will be used in the next step. Modify the <INSTALL>/conf/server.xml FileIn the confluence directory, open the conf/server.xml file and insert one of the following just after the closing </Engine> tag:
Verify Certificate in Correct LocationBy default, Tomcat will look for the certificates in the file C:\Documents and Settings\\#CURRENT_USER#\.keystore on Windows or ~/.keystore on Unix. If your Certificate is not in this location, you will need to update your <INSTALL>/conf/server.xml file as outlined below, so that Tomcat can find it. Advanced users who require an official CA-issued key pair for their Certificate can find instructions in the Tomcat documentation.
Testing SSLRestart Tomcat and access your instance on https://<MY_BASE_URL>:8443/. For more detailed information on setting up SSL with Tomcat (including additional configuration options), have a look at Tomcat 4 SSL Howto or Tomcat 5.5 SSL Howto. Although HTTPS is now activated and available, the old HTTP URLs (http://localhost:8080) are still available. In most situations one wants these URLs to continue working, but for some to redirect to their HTTPS equivalent.
If security is a concern, we recommend using SSL encryption site wide, for the reasons listed here: CONF-4116. To do this: Edit the confluence/WEB-INF/web.xml file and add the following declaration to the end, before the </web-app> tag: <security-constraint> <web-resource-collection> <web-resource-name>Restricted URLs</web-resource-name> <url-pattern>*.action</url-pattern> <url-pattern>/display/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> Once this change is made, restart Confluence and access http://localhost:8080. You should be redirected to https://localhost:8443/login.action. IE and HTTPS for the whole site with a '/' as the url-patternIf you have enabled SSL for the whole site and are accessing Confluence using Internet Explorer, you will not be able to download attachments. <url-pattern>/</url-pattern> This is because IE will not download attachments into its Temporary Internet Files folder when in SSL mode. Securing the site using the *.action url pattern like the above should be fine.
|
![]() |
Document generated by Confluence on Dec 03, 2008 15:04 |