-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[THREESCALE-10156] Configure ssl_verify_client per product #1491
[THREESCALE-10156] Configure ssl_verify_client per product #1491
Conversation
28c345b
to
004af4f
Compare
…hain Adding support to request client certificate in `ssl_certificate` phase when `APICAST_HTTPS_VERIFY_CLIENT` is set to `off`
Initially the X509_STORE object was free in _gc metamethod. However the previously patch remove this and potentially cause memory leak.
For security reason, omit internal SSL verification error and return a generic error instead. The details are shown in the log
004af4f
to
e85a9ce
Compare
doc/parameters.md
Outdated
|
||
**Default:** `optional_no_ca` | ||
**Values:** | ||
- `off`: Don't request client certificates and don't do client certificate verification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `off`: Don't request client certificates and don't do client certificate verification. | |
- `off`: Do not request client certificates or perform client certificate verification. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting the removal of the contraction and use of "don't" twice in one line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
doc/parameters.md
Outdated
- `off`: Don't request client certificates and don't do client certificate verification. | ||
- `optional_no_ca`: Requests the client certificate, but does not fail the request when the client certificate is not signed by a trusted CA certificate. | ||
|
||
Enables verification of client certificates. The client certificates can be verified with TLS Client Certificate Validation policy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enables verification of client certificates. The client certificates can be verified with TLS Client Certificate Validation policy | |
Enables verification of client certificates. You can verify client certificates with TLS Client Certificate Validation policy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
doc/parameters.md
Outdated
- `off`: Don't request client certificates and don't do client certificate verification. | ||
- `optional_no_ca`: Requests the client certificate, but does not fail the request when the client certificate is not signed by a trusted CA certificate. | ||
|
||
Enables verification of client certificates. The client certificates can be verified with TLS Client Certificate Validation policy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enables verification of client certificates. The client certificates can be verified with TLS Client Certificate Validation policy | |
Enables verification of client certificates. The client certificates can be verified with TLS Client Certificate Validation policy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
For this policy to work, APIcast need to be setup to listen for TLS connection. | ||
|
||
By default, client certificates are requested during the TLS handshake, however, APIcast will not verify the certificate or terminate the request unless a TLS Validation Policy is in the chain. In most cases, the client not presenting a client certificate will not affect a service that does not have TLS Validation policy configured. The only exception is when the service is used by a browser or front-end application, which will cause the browser to always prompt the end user to select a client certificate to send if they have ANY client certificates configured when browsing the service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, client certificates are requested during the TLS handshake, however, APIcast will not verify the certificate or terminate the request unless a TLS Validation Policy is in the chain. In most cases, the client not presenting a client certificate will not affect a service that does not have TLS Validation policy configured. The only exception is when the service is used by a browser or front-end application, which will cause the browser to always prompt the end user to select a client certificate to send if they have ANY client certificates configured when browsing the service. | |
By default, during the TLS handshake, APIcast requests client certificates, but will not verify the certificate or terminate the request unless a TLS Validation Policy is in the chain. In most cases, the client not presenting a client certificate will not affect a service that does not have TLS Validation policy configured. The only exception is when a browser or front-end application uses the service. In this case, the browser will always prompt the user to choose a client certificate to send if they have any client certificates set up while accessing the service. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
By default, client certificates are requested during the TLS handshake, however, APIcast will not verify the certificate or terminate the request unless a TLS Validation Policy is in the chain. In most cases, the client not presenting a client certificate will not affect a service that does not have TLS Validation policy configured. The only exception is when the service is used by a browser or front-end application, which will cause the browser to always prompt the end user to select a client certificate to send if they have ANY client certificates configured when browsing the service. | ||
|
||
To work around this, the environment variable `APICAST_HTTPS_VERIFY_CLIENT` can be set to `off` to instruct APIcast to request a client certificate ONLY when the policy is in the chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To work around this, the environment variable `APICAST_HTTPS_VERIFY_CLIENT` can be set to `off` to instruct APIcast to request a client certificate ONLY when the policy is in the chain. | |
To work around this, set the environment variable `APICAST_HTTPS_VERIFY_CLIENT` to `off`. This instructs APIcast to request a client certificate only when the policy is in the chain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with those change :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verification steps working. Covered by tests.
LGTM
What
Fix: https://issues.redhat.com/browse/THREESCALE-10156
Technical notes
This PR add a new env var called
APICAST_HTTPS_VERIFY_CLIENT
to allow switching client verification mode. Due to there is no supported way to add client cert to the gateway, only two values are supportedoff
: will not request client certificateoptional_no_ca
(default): request client cert but will not validate it against the trust CAAPIcast will now also request client certificates if
APICAST_HTTPS_VERIFY_CLIENT
is set tooff
but only if Client Certificate Authentication policy is in chain.Verification steps
Check for this line in the curl log
Edit the
docker-compose.yaml
file as followNotice that
* TLSv1.3 (IN), TLS handshake, Request CERT (13):
is not in the log anymoreapicast-config.json
fileAPIcast will return 400 due to missing certificates but our goal here is just check whether APIcast will request the client certificate or not