Skip to main content

F5 BIG-IP plugin for Certbot

Project description

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.

Install

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:
  --certbot-bigip:bigip-list                CSV list of BIG-IP system  hostnames or addresses, all have to be in the same cluster
  --certbot-bigip:bigip-username            BIG-IP username (common to all listed BIG-IP systems)
  --certbot-bigip:bigip-password            BIG-IP password (common to all listed BIG-IP systems)
  --certbot-bigip:bigip-partition           BIG-IP partition (common to all listed BIG-IP systems)
  --certbot-bigip:bigip-clientssl-parent    Client SSL parent profile to inherit default values from
  --certbot-bigip:bigip-vs-list             CSV list of BIG-IP virtual server names, optionally including partition
  --certbot-bigip:bigip-device-group        Device Group to syncronise configuration
  --certbot-bigip:bigip-iapp                BIG-IP iApp (common to all listed BIG-IP systems)
  --certbot-bigip:bigip-apm                 Is the VS APM enabled or not

Example:

certbot --non-interactive --expand --email 'admin@example.com' --agree-tos \
  -a certbot-bigip:bigip -i certbot-bigip:bigip \
  -d 'example.com' \
  --certbot-bigip:bigip-list 'example-f5.local,example-f5-ha.local' \
  --certbot-bigip:bigip-username 'user' \
  --certbot-bigip:bigip-password 'secret' \
  --certbot-bigip:bigip-partition 'internal' \
  --certbot-bigip:bigip-clientssl-parent '/Common/parent_clientssl' \
  --certbot-bigip:bigip-vs-list '/internal/example.com.app/example.com_vs' \
  --certbot-bigip:bigip-device-group 'fail-sync' \
  --certbot-bigip:bigip-iapp '/internal/example.com.app/example.com'

This plugin currently does not support the certbot renew function, it will only do the challenge and renew the certificate but it will not uploade the certificate to the F5 as the renew does not call the deploy function. To overcome this you can use it like this:

certbot certonly --non-interactive --expand --email 'admin@example.com' --agree-tos \
  -a certbot-bigip:bigip -i certbot-bigip:bigip \
  -d 'example.com' \
  --certbot-bigip:bigip-list 'example-f5.local,example-f5-ha.local' \
  --certbot-bigip:bigip-username 'user' \
  --certbot-bigip:bigip-password 'secret' \
  --certbot-bigip:bigip-partition 'internal' \
  --certbot-bigip:bigip-clientssl-parent '/Common/parent_clientssl' \
  --certbot-bigip:bigip-vs-list '/internal/example.com.app/example.com_vs' \
  --certbot-bigip:bigip-device-group 'fail-sync' \
  --certbot-bigip: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 certbot-bigip:bigip -i certbot-bigip:bigip \
    -d 'example.com' \
    --certbot-bigip:bigip-list 'example-f5.local,example-f5-ha.local' \
    --certbot-bigip:bigip-username 'user' \
    --certbot-bigip:bigip-password 'secret' \
    --certbot-bigip:bigip-partition 'internal' \
    --certbot-bigip:bigip-clientssl-parent '/Common/parent_clientssl' \
    --certbot-bigip:bigip-vs-list '/internal/example.com.app/example.com_vs' \
    --certbot-bigip:bigip-device-group 'fail-sync' \
    --certbot-bigip:bigip-iapp '/internal/example.com.app/example.com_vs'
else
  echo $(date)
  echo "not installing greensight.on.at"
fi

The first call only validates and renews the certificate through certonly 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

:warning: 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

  1. Connection to the bigip under test from the machine running the tests
  2. 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.
  3. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

certbot-bigip-1.1.1.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

certbot_bigip-1.1.1-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file certbot-bigip-1.1.1.tar.gz.

File metadata

  • Download URL: certbot-bigip-1.1.1.tar.gz
  • Upload date:
  • Size: 18.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for certbot-bigip-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0d68de47fe4424fcaf5256195fa3ae87268daa6035306e90da6e687e29b1a513
MD5 69ebb455c428aee9a212999a6b8edf30
BLAKE2b-256 187e3628ae35f7b78e377eb36a1102905cd663826a94e541c6722ad9758e7749

See more details on using hashes here.

File details

Details for the file certbot_bigip-1.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: certbot_bigip-1.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for certbot_bigip-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fb0c176161e7a39d56d6db6db314000c4d063e23cdb2fd8ef9e240ae34a9f285
MD5 74da1b1c4624c8bc3e35338b0d608a86
BLAKE2b-256 36c3b70363a63fa351d0100345d26bbfea107fd5d06a9dd9c202c4aaa92ccd3e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page