Coder Social home page Coder Social logo

viveckh / certifixed Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 10 KB

SSL Certification Renewal Suite. Automated bot to finish domain verification challenges with Godaddy, renew SSL certificates with letsencrypt, convert certificates to pfx, and replace the expired version in Azure Vault.

Python 52.64% Shell 47.36%
dns-challenge azure-vault letsencrypt-utils ssl-certificate-manager godaddy-api certificate-management

certifixed's Introduction

Certifixed: SSL Certification Renewal Suite.

CERTIFIXED - SSL Certification Renewal Suite.

Automated bot that finishes domain verification challenges with Godaddy, renews SSL certificates with letsencrypt, converts certificates to pfx, and replaces the expired version in Azure Vault.

Technologies: Python, Shell Scripting, Godaddy API, Azure API
Author: (EJ) Vivek Pandey

Author's Website | Author's Github |


Coded it one weekend to simplify my own life,

Definitely feel free to drop in issues or PR if interested in pushing this project further.


Quickstart

Setup virtual env & depedencies

> virtualenv -p python3 venv
> source venv/bin/activate
> pip3 install -r requirements.txt

Credentials file

Create an .env file in the project folder with the following structure and input values.

[GODADDY]
API_KEY=xxxxxxx
API_SECRET=xxxxxxx

[AZURE]
CERT_VAULT_URL=https://xxxxxxx.vault.azure.net/
CLIENT_ID=xxxxxxx
TENANT_ID=xxxxxxx
SECRET=xxxxxxx

[CERTS]
SECTIONS=ADMIN_SERVER_CERT,SHOP_SERVER_CERT

[ADMIN_SERVER_CERT]
NAME=xxxxxxx
LOCAL_PFX_PATH=/xxxxxxx/admin-server.veniqa.com/certificate.pfx
PASSWORD=xxxxxxx

[SHOP_SERVER_CERT]
NAME=xxxxxxx
LOCAL_PFX_PATH=/xxxxxxx/shop-server.veniqa.com/certificate.pfx
PASSWORD=xxxxxxx

Note

  • Anything from the CERTS section and below can be entered later before running the cert processor.
  • [ADMIN_SERVER_CERT] is an example of a section that is needed per certificate you want renewed. You can name such a section anything as long as you fulfill the following conditions:
    • It has all the key-value pairs as shown in the example
    • The custom section's name is included in the [CERTS] section's SECTIONS entry

Make shell scripts executables

> chmod +x kickoff.sh
> chmod +x dns_challenge_hook.sh
> chmod +x cert_processor.sh

Kickoff the certificate renewal process

Command: ./kickoff.sh

Run Cert Processor

Once the renewed certificates have been generated,

  • Update the paths and passwords in the cert_processor.sh to point to the folder of your choice
  • Run ./cert_processor.sh

Point your app to use the cert in Azure vault

The automated process ends with renewing the certificate and updating in the Azure Vault

You will then have to log in and point your app to use the updated certificate stored in your Azure vault. I couldn't find an API to facilitate this part. If you find a way, feel free to drop an issue with the resource.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.