Questo contenuto non è disponibile nella lingua selezionata.
8.2.4. Authenticating Using Mutual SSL
REMOTE_USER
to the broker.
Procedure 8.4. To Modify the Broker Proxy Configuration for Mutual SSL Authentication:
/etc/httpd/conf.d/000002_openshift_origin_broker_proxy.conf
file.
- Edit the
/etc/httpd/conf.d/000002_openshift_origin_broker_proxy.conf
file on the broker host and add the following lines in the<VirtualHost *:443>
block directly after theSSLProxyEngine
directive, removing any otherSSLCertificateFile
,SSLCertificateKeyFile
, andSSLCACertificateFile
directives that may have previously been set:Copy to Clipboard Copied! Toggle word wrap Toggle overflow These directives serve the following functions for the SSL virtual host:- The
SSLCertificateFile
,SSLCertificateKeyFile
, andSSLCACertificateFile
directives are critical, because they set the paths to the certificates. - The
SSLVerifyClient
directive set tooptional
is also critical as it accommodates certain broker API calls that do not require authentication. - The
SSLVerifyDepth
directive can be changed based on the number of certificate authorities used to create the certificates. - The
RequestHeader
directive set to the above options allows a mostly standard broker proxy to turn the CN from the client certificate subject into anX_REMOTE_USER
header that is trusted by the back-end broker. Importantly, ensure that the traffic between the SSL termination proxy and the broker application is trusted.
- Restart the broker proxy:
service httpd restart
# service httpd restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 8.5. To Modify the Broker Application Configuration for Mutual SSL Authentication:
- Edit the
/var/www/openshift/broker/httpd/conf.d/openshift-origin-auth-remote-user.conf
file on the broker host to be exactly as shown:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the following in the
/etc/openshift/plugins.d/openshift-origin-auth-remote-user.conf
file:TRUSTED_HEADER="HTTP_X_REMOTE_USER"
TRUSTED_HEADER="HTTP_X_REMOTE_USER"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the broker service for the changes to take effect:
service openshift-broker restart
# service openshift-broker restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 8.6. To Modify the Management Console Configuration for Mutual SSL Authentication:
- Edit the
/var/www/openshift/console/httpd/conf.d/openshift-origin-auth-remote-user.conf
file on the broker host and add the following:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the following in the
/etc/openshift/console.conf
file:REMOTE_USER_HEADER=HTTP_X_REMOTE_USER
REMOTE_USER_HEADER=HTTP_X_REMOTE_USER
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the Management Console service for the changes to take effect:
service openshift-console restart
# service openshift-console restart
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 8.7. To Test the Mutual SSL Configuration:
- Run the following command and ensure it returns successfully:
curl -k https://broker.example.com/broker/rest/api
# curl -k https://broker.example.com/broker/rest/api
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the following command and ensure it returns with a
403 Forbidden
status code:curl -k https://broker.example.com/broker/rest/user
# curl -k https://broker.example.com/broker/rest/user
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the following commands and ensure they return successfully:
curl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/api curl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/user
# curl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/apicurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/apicurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/apicurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/apicurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/apicurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/apicurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/api # curl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/usercurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/usercurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/usercurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/usercurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/usercurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/usercurl --cert path/to/certificate/file --key path/to/certificate/keyfile --cacert path/to/SSLCA/certificate/file https://broker.example.com/broker/rest/user
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the above commands may need to be altered with the--key
option if your key and certificate are not located in the same PEM file. This option is used to specify the key location if it differs from your certificate file.