certbot-bigip
Requirements
see certbot rquirements: https://certbot.eff.org/docs/install.html#system-requirements
- F5
- The LetsEncrypt Chain needs to be at /Common/chain_Letsencrypt and in every other partition that uses this plugin. ( f.e.: /Partition/chain_Letsencrypt) At the moment, the plugin checks if a corresponding certificate/chain is located in the same partition/folder as the clientssl profile that uses it.
- clientssl profile needs to be attached to the virtual server manually(DOMAIN_clientssl). At the moment, the plugin only updates the client profile but does not attach it to the virtual server.
- F5 SW version 14.x and higher
Install
pip install certbot-bigip
by installing the plugin you will also install all missing dependencies including certbot.
Supported Features
- verifies the domain via HTTP01 (challenge verification implemented through an iRule)
- Partitions and iApps
- Standalone and HA setups (Active/Standby, Active/Active)
- Creates the clientssl profile and attaches the certificate, key and chain
- Does not modify the clientssl profile if it already exists
- Supports APM enabled virtual servers
Usage
Parameters:
--bigip-list CSV list of BIG-IP system hostnames or addresses, all have to be in the same cluster
--bigip-username BIG-IP username (common to all listed BIG-IP systems)
--bigip-password BIG-IP password (common to all listed BIG-IP systems)
--bigip-partition BIG-IP partition (common to all listed BIG-IP systems)
--bigip-clientssl-parent Client SSL parent profile to inherit default values from
--bigip-vs-list CSV list of BIG-IP virtual server names, optionally including partition
--bigip-device-group Device Group to syncronise configuration
--bigip-iapp BIG-IP iApp (common to all listed BIG-IP systems)
--bigip-apm Is the VS APM enabled or not
Example:
certbot --non-interactive --expand --email 'admin@example.com' --agree-tos \
-a bigip -i bigip \
-d 'example.com' \
--bigip-list 'example-f5.local,example-f5-ha.local' \
--bigip-username 'user' \
--bigip-password 'secret' \
--bigip-partition 'internal' \
--bigip-clientssl-parent '/Common/parent_clientssl' \
--bigip-vs-list '/internal/example.com.app/example.com_vs' \
--bigip-device-group 'fail-sync' \
--bigip-iapp '/internal/example.com.app/example.com'
If the installation of a certificate during a certbot renew command somehow fails, certbot will not try to install the new certificate on a later run.
You can implement a check if the local certificate matches the remote certificate and if not issue a certbot install --cert-name example.com command.
certbot renew
if ! /usr/local/bin/cert-test.sh --quiet example.com
then
echo $(date)
echo "installing example.com"
certbot install --cert-name'example.com'
fi
Alternatevly you can split the commands and not use the renew functionality like this:
certbot certonly --non-interactive --expand --email 'admin@example.com' --agree-tos \
-a bigip -i bigip \
-d 'example.com' \
--bigip-list 'example-f5.local,example-f5-ha.local' \
--bigip-username 'user' \
--bigip-password 'secret' \
--bigip-partition 'internal' \
--bigip-clientssl-parent '/Common/parent_clientssl' \
--bigip-vs-list '/internal/example.com.app/example.com_vs' \
--bigip-device-group 'fail-sync' \
--bigip-iapp '/internal/example.com.app/example.com_vs'
if ! /usr/local/bin/cert-test.sh --quiet example.com
then
echo $(date)
echo "installing example.com"
certbot --non-interactive --expand --email 'admin@example.com' --agree-tos \
-a bigip -i bigip \
-d 'example.com' \
--bigip-list 'example-f5.local,example-f5-ha.local' \
--bigip-username 'user' \
--bigip-password 'secret' \
--bigip-partition 'internal' \
--bigip-clientssl-parent '/Common/parent_clientssl' \
--bigip-vs-list '/internal/example.com.app/example.com_vs' \
--bigip-device-group 'fail-sync' \
--bigip-iapp '/internal/example.com.app/example.com_vs'
else
echo $(date)
echo "not installing example.com"
fi
The first call only validates and renews the certificate through certonly parameter and the cert-test.sh compares the local certificate to the certificate delivered by the F5. If these don't match the second certbot call will skip the validation (as the certificate got already renewed) and install the certificate onto the F5.
Testing
⚠️ Currently only integration tests are supported. Therefore a bigip is needed. To run integrations tests with other plugins for example the bluecat plugin you also need a bluecat in place.
Prerequisites
- Connection to the bigip under test from the machine running the tests
- clientssl profile needs to be attached to the virtual server manually(DOMAIN_clientssl). At the moment, the plugin only updates the client profile but does not attach it to the virtual server.
- Configure the tests using the following environment variables:
| ENV | default | Example |
|---|---|---|
| BIGIP_EMAIL | test@test.test | |
| BIGIP_USERNAME | user | |
| BIGIP_PASSWORD | secret | |
| BIGIP_LIST | example-f5.local,example-f5-ha.local | |
| BIGIP_PARTITION | internal | |
| BIGIP_CLIENTSSL_PARENT | /Common/parent_clientssl | |
| BIGIP_VS_LIST | /internal/example.com.app/example.com_vs | |
| BIGIP_DEVICE_GROUP | fail-sync | fail-sync |
| BIGIP_IAPP | /internal/example.com.app/example.com | |
| BIGIP_CUSTOM_PARTITION | Common | Common |
| BIGIP_CUSTOM_VS_LIST | /Common/example.com.app/example1.com_vs, /Common/example.com.app/example2.com_vs |
running the tests
python setup.py test
Contributing
If you find errors please open a new issue.
Open a pull request if you have made changes you want to add. we will take a look at it and try our best to merge it. Your help is very welcomed.
Metadata
Release files for certbot-bigip 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| certbot-bigip-1.2.1.tar.gz | 18.5 kB | Without provenance | Details for certbot-bigip-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| certbot_bigip-1.2.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for certbot_bigip-1.2.1-py2.py3-none-any.whl |
Total release size: 36.9 kB
Release files / certbot-bigip-1.2.1.tar.gz
| Download URL | certbot-bigip-1.2.1.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
066dd37e718a672097d54f65f9736255e9512da9c9a3f4f7e7c0596772149453
|
|
BLAKE2b-256 checksum How to use checksums |
e7a6a86f3ed8813ad31ab660860b74fb913b72729f0701ff2b1d1332d5143feb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / certbot_bigip-1.2.1-py2.py3-none-any.whl
| Download URL | certbot_bigip-1.2.1-py2.py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
51d373607ad9772229f6e9ff6aefe564b641dda6fd9d7480a172d7ffb4fcdc5a
|
|
BLAKE2b-256 checksum How to use checksums |
d60e7b3e03225a4df4f73bb0dea811e6092741d0db88376d640f95c7347367a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for certbot-bigip 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.