This repository provides a demo lab for pull provisioning of TLS certificates from the Venafi TLS Protect Cloud using the Venafi Ansible collection and nginx + php.
Ansible and the venafi.machine_identity collections have already been installed on this machine, as have some other tools if you wish to fiddle after completing the lab.
-
If you did not sign up for a Venafi Cloud trial tenant previously, do so at https://venafi.com/try-venafi/tls-protect/ as it will be needed for this lab
-
Sign up for a github free account to be able to run free codespaces here https://github.com/signup
-
Ensure you are signed into your github account.
Part 1: Control Plane Onetime setup
- Create your own private codespace from this repository by clicking Code dropdown button -> Codespaces -> Create Codespace on main. This will take 2-5 minutes to create.
- Log into your Venafi Cloud trial tenant while your codespace is creating.
- Modify the preexisting issuing template with the name
Default
to have Recommended Settings which include values for the below fields:- Organization (O)
- City (L)
- State (ST)
- Country (C)
- Click Save to save your changes to the issuing template.
- Create an application named
MIM Summit App
and assign it the Default issuing template - Creating Applications
Part 2: TLS Certificate Automation Setup
- Once your codespace is createcd, copy your TLSPC API key - Obtaining your API key
- In your browser tab for your codespace, open the
credential.yml
file for editing usingnano credentials.yml
in the terminal. - Change the value of the
token
field to your API key. Ensure that it is wrapped in single quotes.- Example:
token: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
- Example:
- Change the value of the
zone
field to'MIM Summit App\Default'
- Case sensitivity is important here, As are single quotes.
- If you named your TLSPC application something else, ensure the zone field fits this format:
<application name>\<issuing template API alias from application>
- Use
CTRL + x
to close the file and theny
to save your changes before fully closing. - Navigate to your browser tab that displays the codespace hosted webapp and look at the self-signed certificate that is bound to the site.
- This certificate is displayed in the site page itself using openssl output for ease of viewing.
Part 3: Replace the TLS Certificate with a certificate from an "approved" CA.
- Run the supplied ansible playbook with
ansible-playbook renew-certificate.yaml
to request a TLS certificate from your Venafi Control plane and apply it to the Codespace hosted website. - Refresh the codespace webapp browser tab to view the newly bound SSL certificate.
Use the command startservices
to start the essential services again for this lab after click ing restart codespace
in your browser tab.