| Audience: DocuShare administrators and security teams |
Overview
HTTP Strict Transport Security (HSTS) is a standard browser security setting. When your DocuShare site sends the HSTS header over HTTPS, the browser remembers that your site must be reached over HTTPS. On later visits it switches to HTTPS automatically, even if a user types http:// or follows an old link.
Security scanners often report a missing HSTS header. This article explains how to check whether your DocuShare site already sends the header and, if it does not, how to add it on IIS (Windows) or Apache (Linux).
| Action required: Check first whether your site already sends the header (see Check Whether HSTS Is Already On). If it does, no change is needed. Add the header only to a site that users already reach over HTTPS. |
Before You Begin
Users must already reach DocuShare over HTTPS with a valid certificate. Do not turn on HSTS for a site that users reach only over HTTP.
Users should reach DocuShare only through your HTTPS web address. HSTS does not protect connections made directly to DocuShare on port 8080. We recommend allowing port 8080 only from the IIS or Apache server.
If a load balancer or proxy handles HTTPS in front of DocuShare, add the header on that device instead. The steps depend on the product, but the header value in this article is the same.
When possible, make the change on a test server first.
Affected DocuShare Releases
| DocuShare release | Header added by DocuShare? | What to do |
| DocuShare 7.7 Patch 1 or later, Windows | Yes, for the IIS Default Web Site (C:\inetpub\wwwroot\web.config). | Check whether HSTS is already on. If DocuShare uses a different IIS site, follow Option A. |
| DocuShare 7.7 Patch 1 or later, Red Hat Linux | Yes, in /etc/httpd/conf/httpd.conf. | Check whether HSTS is already on. No change is needed if it is. |
| DocuShare 7.7 Patch 1 or later, Ubuntu Linux | No. | Follow Option B. |
| DocuShare 8.0 | No. | Follow Option A or Option B. |
| DocuShare 8.1 | No. | Follow Option A or Option B. |
Check Whether HSTS Is Already On
1. Run the command for your operating system. On Windows, use PowerShell and type curl.exe, not curl.
Windows: curl.exe -I https://<your DocuShare address>/ Linux: curl -I https://<your DocuShare address>/ |
2. Look for a line that starts with Strict-Transport-Security, for example Strict-Transport-Security: max-age=31536000.
3. You can also check in a browser: press F12, open the Network tab, reload the page, select the first request, and look under Response Headers.
4. If the header is present, HSTS is already on and no change is needed. If it is missing, continue with Option A or Option B.
The header may also appear when you request the site over plain HTTP. Browsers ignore it there, so this is harmless.
Recommended Header Value
Use the following value. It tells browsers to use HTTPS for your site for one year.
| Strict-Transport-Security: max-age=31536000 |
Option A: Windows with IIS
1. Find the IIS site that serves DocuShare. For the Default Web Site, the file is C:\inetpub\wwwroot\web.config.
2. Back up web.config.
3. Open web.config in a text editor run as administrator. If it already contains a Strict-Transport-Security entry, stop here and do not add a second one.
4. Inside <system.webServer>, add the following. If <httpProtocol> or <customHeaders> already exists, add only the <add ... /> line inside it.
<system.webServer> <httpProtocol> <customHeaders> <add name="Strict-Transport-Security" value="max-age=31536000" /> </customHeaders> </httpProtocol> </system.webServer> |
5. Save the file.
6. Repeat the check in Check Whether HSTS Is Already On. The header must now appear.
7. Confirm that users can still sign in to DocuShare through your normal web address.
Option B: Linux with Apache
1. Find and back up the Apache configuration for the DocuShare HTTPS site. On Red Hat Linux this is /etc/httpd/conf/httpd.conf or a file under /etc/httpd/conf.d/. On Ubuntu, Apache settings are under /etc/apache2/, and the HTTPS site is usually under /etc/apache2/sites-available/.
2. If the configuration already contains a Strict-Transport-Security line, stop here and do not add a second one.
3. Add the following to the DocuShare HTTPS site configuration:
<IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=31536000" </IfModule> |
4. Check the configuration with sudo apachectl configtest. Then reload Apache: on Red Hat Linux run sudo systemctl reload httpd, and on Ubuntu run sudo systemctl reload apache2.
5. Repeat the check in Check Whether HSTS Is Already On. The header must now appear.
6. Confirm that users can still sign in to DocuShare through your normal web address.
If You Need to Turn HSTS Off
Browsers remember the HSTS setting for the full max-age period, so deleting the header does not turn HSTS off for users who have already visited. Instead, change the value to max-age=0 and leave it in place so returning browsers pick up the change. You can remove the header afterwards.
| Important: Do not add includeSubDomains to the header unless every site under your domain supports HTTPS. Browsers would then refuse plain-HTTP connections to all of those sites for a year. |
How to Request Assistance
Contact Xerox DocuShare Support if you need help with this change. Provide the DocuShare release, operating system, web server (IIS, Apache, or a load balancer), any scanner evidence, and the output of the header check. Do not send passwords or certificate private keys.
Comments
0 comments
Article is closed for comments.