Skip to main content

SafeDNS Authenticator plugin for Certbot

Project description

SafeDNS Authenticator plugin for Certbot

Quickstart

docker run -it -v $(pwd)/safedns.ini:/safedns.ini -v $(pwd):/etc/certbot ukfast/certbot-dns-safedns:latest 

Setup

apt install certbot python3-pip
pip3 install certbot-dns-safedns

Execution

certbot certonly --authenticator certbot-dns-safedns:dns_safedns

Warning: certbot might tell you that it doesn't have permissions to write to its log file. However, if you run certbot as sudo, you won't have access to the safedns plugin if you didn't install the plugin as sudo.

This will result in the following error from certbot:

Could not choose appropriate plugin: The requested dns_safedns plugin does not appear to be installed

To get around this just do:

sudo pip3 install certbot-dns-safedns
sudo certbot certonly --authenticator certbot-dns-safedns:dns_safedns

If you get any python cryptography errors, such as:

ContextualVersionConflict: ...

just make sure to upgrade your pyopenssl.

sudo pip install --upgrade pyopenssl

Credentials and Config Options

Use of this plugin requires a configuration file containing SafeDNS API credentials, obtained from your MyUKFast account page. See also the SafeDNS API documentation.

An example credentials.ini file:

certbot_dns_safedns:dns_safedns_auth_token = 0123456789abcdef0123456789abcdef01234567
certbot_dns_safedns:dns_safedns_propagation_seconds = 20

The path to this file can be provided interactively or using the --certbot-dns-safedns:dns_safedns-credentials command-line argument. Certbot records the path to this file for use during renewal, but does not store the file's contents.

CAUTION: You should protect these API credentials as you would the password to your MyUKFast account. Users who can read this file can use these credentials to issue arbitrary API calls on your behalf. Users who can cause Certbot to run using these credentials can complete a dns-01 challenge to acquire new certificates or revoke existing certificates for associated domains, even if those domains aren't being managed by this server.

Certbot will emit a warning if it detects that the credentials file can be accessed by other users on your system. The warning reads "Unsafe permissions on credentials configuration file", followed by the path to the credentials file. This warning will be emitted each time Certbot uses the credentials file, including for renewal, and cannot be silenced except by addressing the issue (e.g., by using a command like chmod 600 to restrict access to the file).

Examples

To acquire a single certificate for both example.com and *.example.com, waiting 900 seconds for DNS propagation:

certbot certonly \
  --authenticator certbot-dns-safedns:dns_safedns \
  --certbot-dns-safedns:dns_safedns-credentials ~/.secrets/certbot/safedns.ini \
  --certbot-dns-safedns:dns_safedns-propagation-seconds 900 \
  --server https://acme-v02.api.letsencrypt.org/directory \
  -d 'example.com' \
  -d '*.example.com'

Build

The package for the safedns plugin is hosted on pypi here: https://pypi.org/project/certbot-dns-safedns/

To build and upload the package from source, first ensure you've increased the version number in setup.py.

Delete the build dist and .egg-info dirs if they are present from a previous build.

Then run:

python3 setup.py sdist bdist_wheel

Deployment

python3 -m twine upload dist/*

Warning: Use the username: __token__, along with the token registered on pypi.

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-dns-safedns-0.1.9.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

certbot_dns_safedns-0.1.9.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file certbot-dns-safedns-0.1.9.1.tar.gz.

File metadata

  • Download URL: certbot-dns-safedns-0.1.9.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for certbot-dns-safedns-0.1.9.1.tar.gz
Algorithm Hash digest
SHA256 6538fc3d1b1be4065bc61654cf803109f2e8f6e03f93373355e3743d7e692433
MD5 cc437ca2ecee8079e19809a2c3c452ea
BLAKE2b-256 71602496b1682ada3b81dc19db5fcb4a0a819f854c58b1a6b968e5dbb14b0506

See more details on using hashes here.

File details

Details for the file certbot_dns_safedns-0.1.9.1-py3-none-any.whl.

File metadata

  • Download URL: certbot_dns_safedns-0.1.9.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for certbot_dns_safedns-0.1.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a9b8847c9f8a49fe315d1edc5bc89cf18a215cd7d0877c3e11d59d33d87338
MD5 60836c952372aa5d981ecfb1073b5495
BLAKE2b-256 f3e1a6a8d6dcde261871285e5030db43e7fa6f91f84522cd3cd2f1a3a1385157

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