-
Notifications
You must be signed in to change notification settings - Fork 80
Need test for mandatory client cert auth from router for reencrypt case #504
Description
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.