8.6. Securing OpenStack API Traffic with SSL

By means of the Compute API traffic type, Virtuozzo Infrastructure Platform exposes a public endpoint that listens to OpenStack API requests. By default, it points to the IP address of the management node (or to its virtual IP address if high availability is enabled).

Traffic to and from the endpoint can be secured with an SSL certificate. However, as domain names are not used by default, the certificate will need a subjectAltName field containing the aforementioned management node IP address. If it does not have such a field, you will need to modify the public endpoint to use a domain name that you have a certificate for.

To secure public OpenStack API traffic with SSL, do the following:

  1. Upload the certificate and then private key in the admin panel, on the SETTINGS > Management node > SSL ACCESS screen.

  2. Place the CA certificate file to operating system’s trusted bundle:

    # cp ca.pem /etc/pki/ca-trust/source/anchors/
    # update-ca-trust extract

    Alternatively, you can append the --os-cacert ca.pem option to each OpenStack client call.

  3. If your certificate does not have the subjectAltName field, modify all public endpoints to use the domain name for which you have the certificate for. This domain name must resolve to the management node IP address (or to its virtual IP address if high availability is enabled). For example:

    # openstack --insecure endpoint list | grep public
    | 44aa0f53a40e4e52b1c7eeeb20c7811e | <...> | |
    | 5a845b4b813047c292db73c42dad5efd | <...> |                    |
    | 0b906e518b1041c8b94af7f410403369 | <...> |                    |
    | d80af756adf1449f9237c3aeebc9206a | <...> |   |
    | d0e8c7da7d174e1f9aa4efbc6dff2113 | <...> |                 |
    | 0e6d3a39d6c44aa883984a35dde434bb | <...> |                    |
    | 7d901686bca549f9b294e572f046f634 | <...> |   |
    | 1b68ac7c3f7949fbaeef4a815fe6f3b1 | <...> |   |
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:8774/v2.1/%(tenant_id)s 44aa0f53a40e4e52b1c7eeeb20c7811e
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:8780 5a845b4b813047c292db73c42dad5efd
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:9696 0b906e518b1041c8b94af7f410403369
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:8004/v1/%(tenant_id)s d80af756adf1449f9237c3aeebc9206a
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:5000/v3 d0e8c7da7d174e1f9aa4efbc6dff2113
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:9292 0e6d3a39d6c44aa883984a35dde434bb
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:8776/v2/%(tenant_id)s 7d901686bca549f9b294e572f046f634
    # openstack --insecure endpoint set \
    --url https://<DNS_name>:8776/v3/%(tenant_id)s 1b68ac7c3f7949fbaeef4a815fe6f3b1
  4. In your OpenRC script, change OS_AUTH_URL to the same domain name and remove all parameters related to insecure access. For example:

    export OS_PROJECT_DOMAIN_NAME=Default
    export OS_USER_DOMAIN_NAME=Default
    export OS_PROJECT_NAME=admin
    export OS_USERNAME=admin
    export OS_AUTH_URL=https://<DOMAIN_NAME>:5000/v3

Now you can run OpenStack commands without the --insecure option.