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
- A user should be able to create/update/delete SSL certs for his account.
- Certificates can be searched by using either the certificate ID or the account ID.
- Attach/Remove a certificate from a loadbalancers which support SSL offload feature.
- Add support for Netscaler to use this feature.
References
Document History
Version |
Author |
Date |
Changes |
V1.0 |
Syed Ahmed |
07-Oct-2013 |
Initial Draft |
Functional requirements & non-requirements
- Introduce a new entity SSLCerts linked to a user account
- Users should be able to Add/Delete/List certificates linked to their account
- Admin should be able to list all the certificates for all accounts
- When creating a loadbalancer if the public port is 443 and the private port is 80, then
- If the loadbalancer device supports SSL offloading,
- The loadbalncer created should be of type SSL.
- Should allow attach/remove of a SSL certificate to it.
- If the loadbalancer device does not support ssl offload,
- The loadbalancer type will be TCP.
- Trying to attach a certificate to it should generate an error
- Users should be able to attach/remove their certificates to their loadbalancers.
- Deleting a SSL certificate should also remove it from all the loadbalancers it is attached to.
- If a user account gets deleted, the associated Certificates should also be deleted.
- If a loadbalancer gets deleted, the associated binding should also be deleted.
- The private key and password for the key should be stored encrypted
Architecture and Design description
Assumtions
- The SSL certificates should include the chain trust with them. They are added to the device as-is
- For the netscaler loadbalancer, we assume that the port 22 is open and there is space in /nsconfig as we scp the certificate to the device
Design
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:
- cert : Required : The public certificate, should also include the trust chain if required
- key : Required : The private key for the certificate, if the key is encrypted, password should be provided
- password: Optional : The password for the private key
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 |
None |
Null |
account_id |
bigint(20) |
No |
None |
Null |
cert |
varchar(255) |
Yes |
None |
Null |
key |
varchar(255) |
Yes |
None |
Null |
password |
varchar(255) |
Yes |
None |
Null |
deleteSSLCert
Deletes an existing SSL cert from cloudstack.
Request parameters:
- id : Required : The id of the certificate
updateSSLCert
updates an existing certificate-key pair
Request parameters:
- id : Required: The id of the certificate
- cert : Optional : The public certificate, should also include the trust chain if required
- key : Optional : The private key for the certificate, if the key is encrypted, password should be provided
- password: Optional : The password for the private key
listSSLCerts
lists the certificates for an Id or an account
Request parameters:
- id : Optional : The id of the certificate
- accountid : Optional : The account id for which the certs are to be listed
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:
- certificateid: Optional : The id of the certificate to assign to this rule.
New tables:
load_balancer_cert_map(id, load_balancer_id, cert_id, revoke, state)
removeFromLoadBalancerRule
Request parameter to be added:
- certificateid: Optional : The id of the certificate to remove from this rule.
UI flow
Right now, this feature will only be available via the API. UI support is not yet scoped.
IP Clearance
No external dependecies are being added for this feature. All code will be developed within Cloudstack’s scope.