Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Need test for mandatory client cert auth from router for reencrypt case #504

@richm

Description

@richm

For the router reencrypt test, client certs/keys are allowed, but do not appear to be used.
https://github.com/openshift-qe/v3-testfiles/blob/master/routing/reencrypt/route_reencrypt-path.json#L14

This sets up the route with cert and key. However, the /etc/Caddyfile in the caddy-docker pod looks like this:

# cat /etc/Caddyfile 
:8443 {
 tls /srv/certs/example_wildcard_chain.pem /srv/certs/example_wildcard.key
 root /srv/publics
 browse /test
}
:8080 {
 root /srv/public
 browse /test
}

The Caddy documentation shows this:

https://caddyserver.com/docs/tls

Advanced users may open a settings block for more control, optionally specifying their own certificate and key:

tls [cert key] {
    protocols min max
    ciphers   ciphers...
    clients   [request|require|verify_if_given] clientcas...
    load      dir
    max_certs limit
    key_type  type
    dns       provider
}

I believe clients should be configured like this to require client certs:

   clients require /srv/certs/example_ca.pem

or wherever the example_ca cert is stored.

I think the lack of testing is masking a bug in the router code in openshift, which may have been fixed in 1.4. In 1.3 /var/lib/haproxy/conf/haproxy.config looks like this:

# Secure backend which requires re-encryption

backend be_secure_logging_route-reencrypt
  mode http
  option redispatch

  balance leastconn

  timeout check 5000ms
  http-request set-header X-Forwarded-Host %[req.hdr(host)]
  http-request set-header X-Forwarded-Port %[dst_port]
  http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
  http-request set-header X-Forwarded-Proto https if { ssl_fc }
  http-request set-header Forwarded for=%[src];host=%[req.hdr(host)];proto=%[req.hdr(X-Forwarded-Proto)]
  cookie 6c8e522e725165e51ee43f0d2843ad5d insert indirect nocache httponly secure

    server 60e1ea32b4066dfcf5a22142f3087dfa 10.1.0.6:8443 ssl check inter 5000ms verify required ca-file /var/lib/haproxy/router/cacerts/logging_route-reencrypt.pem cookie 60e1ea32b4066dfcf5a22142f3087dfa weight 100

Note the server line. I'm not sure which haproxy documentation is applicable to the haproxy version in OSE 3.3. But I did find this: https://www.haproxy.com/doc/aloha/7.0/haproxy/tls.html#configuring-haproxy-for-ssl-tls

crt <pem-file> :

    Designates the file containing a client certificate and its associated private key. HAProxy will use it if the server asks for a client certificate.

I do not see a "crt" directive in the "server" line above. So I don't know how openshift is supposed to use the cert and key specified in the reencrypt route configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions