Project

General

Profile

Feature #22165

Allow custom configuration for HSTS settings

Added by Tomer Brisker 11 months ago. Updated 5 months ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Settings
Target version:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1486297

Description of problem:
Foreman/Satellite currently unconditionally sets the HSTS header to "Strict-Transport-Security: max-age=631152000; includeSubdomains", see https://github.com/theforeman/foreman/blob/develop/config/initializers/secure_headers.rb

While generally a good idea, HSTS has the issue that browsers will refuse to talk unencrypted to the Satellite at all after seeing the HSTS header once.

However, we want /pub/ and /pulp/repos/…/custom/ to be available via HTTP too.
This is not a problem for yum/dnf/wget/curl, as those neither implement nor ever see the HSTS header from Foreman, but regular users quite often want to browse the repos with their browsers and that is not possible with HSTS on (as /pulp/repos/ requires a client cert from the Katello CA when accessed via HTTPS).

As HSTS works based on domains/hostnames, you cannot exclude /pub/ and /pulp/repos/ from it.

The best solution that comes into my mind would be allowing to disable and/or change the HSTS settings, so that the users at least can decide if they want HSTS or not (but still leave it on by default).

Version-Release number of selected component (if applicable):
6.2.11

How reproducible:
100%

Steps to Reproduce:
1. curl -I https://sat.example.com

Actual results:
Strict-Transport-Security: max-age=631152000; includeSubdomains

Expected results:
Depending on the settings

Additional info:
The error you see in Firefox is:
An error occurred during a connection to sat.example.com. SSL peer was unable to negotiate an acceptable set of security parameters. Error code: SSL_ERROR_HANDSHAKE_FAILURE_ALERT

The error you see in Chrome is:
This site can’t provide a secure connection sat.example.com didn’t accept your login certificate, or one may not have been provided.
Try contacting the system admin.
ERR_BAD_SSL_CLIENT_AUTH_CERT

Associated revisions

Revision dbdac61f (diff)
Added by Tomer Brisker 11 months ago

Fixes #22165 - Allow disabling HSTS header

If a user browses to the Foreman server using HTTPS, HSTS headers will
prevent the browser from connecting to the server again using HTTP. This
adds a setting that allows disabling this header for users requiring
browser access to the server.

Revision 3abb8b1d (diff)
Added by Tomer Brisker 11 months ago

Refs #22165 - Add installer support for disabling hsts

History

#1 Updated by The Foreman Bot 11 months ago

  • Assignee set to Tomer Brisker
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5154 added

#2 Updated by The Foreman Bot 11 months ago

  • Pull request https://github.com/theforeman/puppet-foreman/pull/614 added

#3 Updated by Marek Hulán 11 months ago

  • Legacy Backlogs Release (now unused) set to 330

#4 Updated by Anonymous 11 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF