Skip to main content

CDmon DNS Authenticator plugin for Certbot

Project description

Certbot DNS CDmon Plugin Python 3.6+ Certbot ≥1.1.0 License: MIT

Table of Contents

  1. Overview
  2. Requirements
  3. Installation
  4. Configuration
  5. Usage
  6. Troubleshooting
  7. Development
  8. Contributing
  9. License

Overview

DNS authentication plugin for Certbot that uses the CDmon API to handle dns-01 challenges, specifically designed for wildcard certificate management.

Key features:

  • Automated TXT record management via CDmon API (api-domains.cdmon.services)
  • Support for multiple domain validation
  • Integration with Certbot's renewal workflow
  • Default TTL of 60 seconds for DNS records
  • Default propagation delay of 90 seconds

Requirements

Core Dependencies

  • Certbot: ≥1.1.0 (verified with 3.3.0+)
  • Python: 3.6+
  • Requests: Required for API communication
  • OS: Linux (Debian/Ubuntu/CentOS), macOS 10.15+
  • See requirements.txt for full package dependencies

Service Requirements

  • CDmon account with API access
  • API key with DNS record management permissions

Installation

Package Installation

pip install certbot-dns-cdmon

From Source

git clone https://github.com/rascazzione/certbot-dns-cdmon.git
cd certbot-dns-cdmon
pip install -e .

Security Note: For production deployments:

  • Use environment variables for credential management
  • Implement secret vault integration
  • Rotate API keys regularly

Configuration

1. API Key Setup

  1. Log in to your CDmon control panel
  2. Navigate to API/Developer settings
  3. Generate API key with DNS record management permissions

2. Credential Management

Create credentials file in one of these locations:

  • System-wide: /etc/letsencrypt/cdmon-credentials.ini
  • User-specific: $HOME/.config/certbot/cdmon-credentials.ini

Example configuration:

# CDmon API credentials
dns_cdmon_api_key = your_api_key_here
dns_cdmon_domain = your_domain_here

Security best practices:

chmod 600 /path/to/credentials.ini

Usage

Basic Certificate Request

certbot certonly \\
  --authenticator dns-cdmon \\
  --dns-cdmon-credentials /path/to/credentials.ini \\
  --dns-cdmon-propagation-seconds 180 \\
  -d example.com \\
  -d *.example.com

Virtual Environment Setup

# Using venv
python -m venv venv
source venv/bin/activate
pip install -e .

# Using Conda
conda create -n certbot-env python=3.8
conda activate certbot-env
pip install -e .

Non-root User Setup

certbot certonly \\
  --authenticator dns-cdmon \\
  --dns-cdmon-credentials ~/certbot/credentials.ini \\
  --dns-cdmon-propagation-seconds 90 \\
  -d example.com \\
  -d *.example.com \\
  --config-dir ~/certbot/config \\
  --work-dir ~/certbot/work \\
  --logs-dir ~/certbot/logs

Automatic Renewal

Certbot will remember the plugin used. The renewal will be automatic without needing to reconfigure the plugin.


Troubleshooting

Common Issues

1. Permission Errors

  • Solution A: Use sudo with full path to certbot:
    sudo /path/to/certbot certonly [options...]
    
  • Solution B: Specify writable directories:
    certbot certonly \\
      --config-dir ~/certbot/config \\
      --work-dir ~/certbot/work \\
      --logs-dir ~/certbot/logs
    

2. API Authentication Errors

  • Verify API key has DNS management permissions
  • Check credentials file format:
    dns_cdmon_api_key = your_api_key
    dns_cdmon_domain = yourdomain.com
    

3. Propagation Issues

  • Increase propagation seconds (default: 90)
  • Verify DNS propagation using tools like WhatsMyDNS

4. API Response Codes

  • 200: Success
  • 401: Invalid API key
  • 404: Domain not found
  • 500: Server error

Development

Authentication Flow

graph TD
    A[Certbot DNS Challenge] --> B[CDmon Plugin]
    B --> C{API Credentials}
    C -->|Valid| D[Create/Update TXT Record]
    C -->|Invalid| E[Error: Authentication Failed]
    D --> F[Wait Propagation]
    F --> G[Verify DNS]
    G -->|Success| H[Cleanup TXT Record]
    G -->|Failure| I[Error: Verification Failed]

Setup

git clone https://github.com/rascazzione/certbot-dns-cdmon.git
cd certbot-dns-cdmon
python -m venv venv
source venv/bin/activate
pip install -e .

Testing

python -m unittest discover

License

This project is licensed under the MIT License - see the LICENSE file for details.


Contributing

Contributions are welcome. Please open an issue or pull request on GitHub.

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_cdmon-0.3.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

certbot_dns_cdmon-0.3.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file certbot_dns_cdmon-0.3.2.tar.gz.

File metadata

  • Download URL: certbot_dns_cdmon-0.3.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for certbot_dns_cdmon-0.3.2.tar.gz
Algorithm Hash digest
SHA256 1e79b92a76164bd6b9d6a865ad0e717fd39613ebf93a9cee24e91ad84779a7f5
MD5 cc6359a56e8431b0df9b0f4a5c4830a8
BLAKE2b-256 49f5a547db1a27bf2a632738cc16d0e61cbaaa65123103de5d5250ffa27e6ccb

See more details on using hashes here.

File details

Details for the file certbot_dns_cdmon-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for certbot_dns_cdmon-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1485c697f91f660354f9dbc914774e2f1057d7bac1b9478d23f531e5b999a2
MD5 9645e1a64f245859432c205f0475c516
BLAKE2b-256 e286d55f54f40eeeda036d840eae2b4a58619d34e7e766680bbfb9a61beb80f8

See more details on using hashes here.

Supported by

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