'forwardfor' option in haproxy is not being set correctly

Bug #1777880 reported by Lars Kellogg-Stedman
4
Affects Status Importance Assigned to Milestone
tripleo
Incomplete
High
Unassigned

Bug Description

In puppet-tripleo, we attempt to set the 'forwardfor' option when $public_certificate is set and the service is using mode http (e.g., for almost everything) (manifests/haproxy/endpoint.pp):

    if $public_certificate {
      if $mode == 'http' {
        $tls_listen_options = {
          'rsprep' => '^Location:\ http://(.*) Location:\ https://\1',
          'redirect' => "scheme https code 301 if { hdr(host) -i ${public_virtual_ip} } !{ ssl_fc }",
          'option' => 'forwardfor',
        }

Unfortunately, we override the 'option' setting in almost all cases because when we use:

  $listen_options_real = merge($tls_listen_options, $listen_options, $custom_options)

Any value for 'option' in $tls_listen_options is replaced if $listen_options or $custom_options contains an 'option' key. Since we set $listen_options by default in haproxy.pp, this affects pretty much everything:

  $default_listen_options = {
    'option' => [ 'httpchk', 'httplog', ],
    'http-request' => [
      'set-header X-Forwarded-Proto https if { ssl_fc }',
      'set-header X-Forwarded-Proto http if !{ ssl_fc }'],
  }
  Tripleo::Haproxy::Endpoint {
    haproxy_listen_bind_param => $haproxy_listen_bind_param,
    member_options => $haproxy_member_options,
    public_certificate => $service_certificate,
    use_internal_certificates => $use_internal_certificates,
    internal_certificates_specs => $internal_certificates_specs,
    listen_options => $default_listen_options,
    manage_firewall => $manage_firewall,
  }

Tags: puppet
tags: added: puppet
Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

This also means that we're failing to set 'httplog' in most cases, since many (most?) of the services provide a custom 'option' setting.

Changed in tripleo:
status: New → Triaged
importance: Undecided → High
milestone: none → rocky-3
Changed in tripleo:
milestone: rocky-3 → rocky-rc1
Changed in tripleo:
milestone: rocky-rc1 → stein-1
Changed in tripleo:
milestone: stein-1 → stein-2
Changed in tripleo:
milestone: stein-2 → stein-3
Revision history for this message
Juan Antonio Osorio Robles (juan-osorio-robles) wrote :

Is this still an issue?

Changed in tripleo:
milestone: stein-3 → stein-rc1
Changed in tripleo:
milestone: stein-rc1 → train-1
Changed in tripleo:
milestone: train-1 → train-2
Changed in tripleo:
milestone: train-2 → train-3
Changed in tripleo:
milestone: train-3 → ussuri-1
Changed in tripleo:
milestone: ussuri-1 → ussuri-2
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-2 → ussuri-3
wes hayutin (weshayutin)
Changed in tripleo:
status: Triaged → Incomplete
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-3 → ussuri-rc3
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-rc3 → victoria-1
Changed in tripleo:
milestone: victoria-1 → victoria-3
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

We recently get a different bug report https://bugs.launchpad.net/tripleo/+bug/1968691 about the same issue and a fix is proposed. Because the fix is now associated with that new bug, I'll close this as duplicate of that new bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.