Automation¶
TrustView allows you to automate deployment of SSL/TLS and other certificates on servers and other devices such as load balancers and firewalls. Automation is supported using several different approaches:
Automation tasks
ACME clients
Native Citrix ADC integration
Native Azure integration
ACME (Automatic Certificate Management Environment) is a protocol for automated certificate management. This includes issuance, renewal and deployment of certificates. TrustView offers an ACME server and, therefore, allows any ACME client to issue and renew certificates using TrustView.
Note
Note that using TrustView for automation requires installation of the TrustView Automation module.
Automation using ACME clients¶
To get an overview over the most common ACME clients available, check here: ACME clients overview.
Setting up an automated certificate issuance and renewal process using an ACME client and TrustView requires the following steps:
Installing an ACME client on a server (e.g. win-acme or Certbot)
Initial execution of the ACME client with TrustView configured as the ACME server
Approval of the ACME client as an automation agent in TrustView
Configuring the ACME client to run at regular intervals (only necessary in certain cases)
Important
Note that to issue Let’s Encrypt certificates, you need to configure the DNS integration from TrustView for full automation. See DNS integration. To issue Entrust, DigiCert or GeoTrust certificates (external certificates) the domain(s) must be prevalidated for the OV and EV type. For DV, the DNS integration must be configured since it needs to be validated on an per domain basis.
In the following guide and examples, we show, step-by-step, the required tasks for setting up a certificate for automated renewal and deployment:
Important
If you have already purchased a certificate through TrustView and wish to reuse it for an automation agent, you must ensure that the common name (CN) and SANs for the automation agent, match the already issued certificate exactly, for TrustView to be able to reissue it. If it does not match, it will count as a new certificate, that the automation agent will attempt to issue.
Hostnames and IPs used during automation¶
There may be cases where your network is closed, and you only want to open for the necessary inbound and outbound connections. The following is needed to perform automation with TrustView:
Inbound and outbound HTTPS connection -
port 443
Connect outbound to
view.trustskills.com
-port 443
Connect outbound to
api.trustskills.com
-port 443
This also applies for automation with Citrix ADC.
win-acme and Certbot logs¶
For win-acme, the logs can be located by default here:
C:\ProgramData\win-acme
It is also possible, to set up custom logging for win-acme, see win-acme custom logging.
For Certbot, the logs can be located by default here:
1 /var/log/letsencrypt/
Customize the ACME URL directory path¶
Important
This will only work from v5.26.163
of TrustView and onwards.
It is possible to customize the directory path for the ACME URL, when using TrustView as an ACME server.
This can be done by adding the following line to the TrustView.groovy
file.
acmeContextPrefix = "https://acme.example.org"
Or
acmeContextPrefix = "http://acme.example.org"
After the line has been added or adjusted as needed, save the file and restart the TrustView service, for it to take effect.
Automation examples¶
Change the renewal interval for win-acme¶
Go to the settings.json
file and look for the following settings:
RenewalDays
[Default: 55]
- The number of days to renew a certificate after.StartBoundary
[Default: "09:00:00"]
- Configures start time for the scheduled task.RandomDelay
[Default: "04:00:00"]
- Configures random time to wait for starting the scheduled task. This spreads the load on the servers and thus prevents users from gettingTooManyRequests
errors.
Automate activation of agent connections¶
Instead of manually activating agent connections from ACME clients, it is possible to automate the activation process using activation templates.
If a new ACME client matches an active activation template, the ACME client will automatically be activated using the information defined for the activation template.
The list of activation templates in available from the New agents
page.
Adding a new activation template¶
Click
Agents
Click
Activation templates
Click
Add
Fill out the fields
Name the template
Choose to enable the template
List the subnets that matching ACME clients are allowed from, e.g.
192.168.0.0/24,10.0.0.0/8
Enter a regular expression that must match all the DNS hostnames requested by the ACME client, e.g.
.*\.trustskills.com
Select the issuer and additional information related to the selected issuer if required
Click
Create
Troubleshooting¶
Unable to bind win-acme to IIS website using specific hostnames¶
If you get this error, use the parameters below instead, but first go to your IIS Manager under sites and leave the field Hostname
empty.
Tip
You can find the {{iis-site-id}}
in the IIS manager on the Windows server.
1.\wacs --baseuri "{{acme-directory-url}}" --target iis --siteid 1 --validationmode http-01 --webroot "C:\temp" --store certificatestore --installation iis --source manual --host {{Hostname}} --installationsiteid 1
Automation agent activation¶
After the initial execution of the ACME client, TrustView has registered that a new Automation agent has connected. To allow the Automation agent to issue certificates, you need to activate the Automation agent. This requires a few simple steps:
Click
New agents
in theAutomation agents
section in the left menu, to list all automation agents pending activation.Click on the automation agent you want to activate to view details of the automation agent.
Select the certificate issuer, type and additional details depending on the certificate type on the details page.
Click
Update
to save all your changes (must be done before activating the agent).Click
Activate
to activate the agent and get it to run its automation cycle.
Deleting certificates in Certbot¶
There are two methods for deleting certificates issued with Certbot. These examples are for a Linux-based environment.
Automatic method¶
Use this command to list all Certbot certificates:
sudo certbot certificates
Then use this command to specify which certificate to delete:
sudo certbot delete --cert-name example.trustskills.com
Manual method¶
To delete them manually, go into each of the following folders:
1/etc/letsencrypt/archive
2/etc/letsencrypt/live
3/etc/letsencrypt/renewal
Once inside each folder, delete all the certificates that need to be deleted.
sudo rm cert.pem
The manual method will give more control over which file to delete, but may be more tedious than the automatic method.
Changing the TLS version¶
If using the Windows Connector for automation, you may run into an error asking you to set your current TLS version to a specific minimum version. Setting the TLS version is not recommended by Microsoft: Microsoft best practices for TLS, but can be done if needed.
If you want to change it to TLS version 1.2, it can be done by adding this to the Windows Connector script, downloaded from TrustView:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
It needs to be added to line ~ 16
of the trustviewcon.ps1
script, before the functions begin.
If you want to specify TLS version 1.3 use Tls13
.