Bug Reference

CLOUDSTACK-4821

Introduction

SSL Offloading feature allows loadbalancers to handle encryption/decryption of HTTP(s) traffic giving plaintext HTTP to the backend servers freeing them from the resource intensive task of handling encryption/decryption. Major loadblancers like the Netscaler and F5 have this functionality. This document is a functional sepc for adding certificate mangaement and implementing SSL offload capability for cloudstack provisioned loadbalancers.

Goals

  1. A user should be able to create/update/delete SSL certs for his account.
  2. Certificates can be searched by using either the certificate ID or the account ID.
  3. Attach/Remove a certificate from a loadbalancers which support SSL offload feature.
  4. Add support for Netscaler to use this feature.

References

Document History

Version

Author

Date

Changes

V1.0

Syed Ahmed

07-Oct-2013

Initial Draft

V1.1

Syed Ahmed

08-Oct-2013

Changing name & updating uploadSSLCert to include certificate chain

Functional requirements & non-requirements

  1. Introduce a new entity SSLCerts linked to a user account
  2. Users should be able to Add/Delete/List certificates linked to their account
  3. Admin should be able to list all the certificates for all accounts
  4. When creating a loadbalancer if the public port is 443 and the private port is 80, then
  5. Users should be able to attach/remove their certificates to their loadbalancers.
  6. Deleting a SSL certificate should also remove it from all the loadbalancers it is attached to. throw an error stating that it is already in use
  7. If a user account gets deleted, the associated Certificates should also be deleted.
  8. If a loadbalancer gets deleted, the associated binding should also be deleted.
  9. The private key and password for the key should be stored encrypted

Architecture and Design description

Assumtions

Design

General Flow for assign/remove SSL certificate to a load balancer
New classes and fields

The loadbalancign rule will have a new subclass for SSL certs

// rule for SSL certificates
public class LoadBalancingRule {
 ....

  public static class LbSslCert()
  {
    String cert;
    String key;
    String password;
    boolean _revoke;

    public LbSslCert(cert,key,password) {}

  }

  public void setSslCerts(List<SslCert> certs){}
  public void getSslCerts(List<SslCert> certs){}
...
}

The transfer object should also be able to pass SSL certs

// TO for SSL certificates
public class LoadBalancerTO {
 ....
  public SslCertsTO[] sslCerts;

  public static class SslCertTO()
  {
    String cert;
    String key;
    String password;
    boolean _revoke;

    public LbSslCert(cert,key,password) {}

  }

...
}

New tables

ssl_certs(id, uuid, account_id, cert, key, password)

Field name

Type

Allow nulls

Key

Default value

id

bigint(20) unsigned

No

Primary

Null

uuid

varchar(40)

Yes

Unique

Null

account_id

bigint(20)

No

Mul

Null

cert

varchar(255)

No

None

Null

chain

varchar(255)

Yes

None

Null

key

varchar(255)

No

None

Null

password

varchar(255)

Yes

None

Null

created

datatime

Yes

None

Null

revoke

tinyint(1)

No

None

0

load_balancer_cert_map(id, load_balancer_id, cert_id, revoke, state)

Field name

Type

Allow nulls

Key

Default value

id

bigint(20) unsigned

No

Primary

Null

load_balancer_id

bigint(20)

No

Mul

Null

cert_id

bigint(20)

No

Mul

Null

revoke

tinyint(1)

No

None

0

New Webservice APIs for Certificate Management

This section lists the new webservice APIs for Certificate management. They are derived from their AWS Equivalant ( UploadServerCertificate, ListServerCertificates, GetServerCertificate, DeleteServerCertificate )

uploadSSLCert

Uploads a new SSL certificate-key pair

Request parameters:

Response parameters:

deleteSSLCert

Deletes an existing SSL cert from cloudstack.

Request parameters:

Response parameters:

updateSSLCert

updates an existing certificate-key pair

Request parameters:

Response parameters:

listSSLCerts

lists the certificates for an Id or an account

Request parameters:

Response parameters:

The response is a list of following

New parameters to loadbalancing APIs

For associating the certificates to loadbalancing rules, we need to add the certificate id parameter to following loadbalancer apis.

assignToLoadBalancerRule

Request parameter to be added:

removeFromLoadBalancerRule

Request parameter to be added:

UI flow

The certificates can be accessed as a tab on the Accounts page.

Add Certificate

List Certificates

Certificate details

IP Clearance

No external dependecies are being added for this feature. All code will be developed within Cloudstack’s scope.