manintheit.org
check-certificate.sh

Photo by Thalia Ruiz on Unsplash

check-certificate.sh is a shell script which can be used to notify group of people over Slack before TLS certificates expire. Script can check tls certificates in two sources. tls:// and vault://

VAULT_ADDR, VAULT_TOKEN and SLACK_WEBHOOK must be set before execute it.

tls://manintheit.org:443[2m]                        # maintheit.org threshold is 2 months
tls://another.manintheit.org:443[30d]               # another.maintheit.org --> threshold is 30 days.
vault://secret/data/certs/dragon/tls.crt            # tls certificate in hashicorp vault no threshold specified, default threshold value will be considered, which is 30 days.

You can find check-certificate.sh in my GH repo.

$ ./check-certificate.sh check.txt

You can find how-to in the repo.