This is a simple skeleton for dehydrated
+ dehydrated-route53-hook-script
This repo uses these projects directly to:
- allow you to use the acme staging server to test your process
- allow you to register an acme account key
- generate SSL keys & CSRs for each line in
domains.txt
- fulfill acme
dns-01
challenges for each CSR usingcli53
- store the keys, CSRs, and signed certs in a configured directory (default
staged/
orcerts/
)
# full-clone the repository
git clone --recursive https://github.com/SnowblindSystems/dns-01-r53
cd dns-01-r53
# edit CONTACT_EMAIL in config.common
# ./d is a symlink to ./dehydrated/dehydrated (inside the git submodule)
# generate & register account key
./d -f config.STAGING --register --accept-terms
# config.PRODUCTION will need its own registration later
Taken almost directly from whereisaaron/dehydrated-route53-hook-script
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"route53:ListResourceRecordSets",
"route53:ChangeResourceRecordSets"
],
"Resource": "arn:aws:route53:::hostedzone/*"
},
{
"Effect": "Allow",
"Action": [
"route53:ListHostedZones",
"route53:ListHostedZonesByName",
"route53:ListResourceRecordSets"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"route53:GetChange"
],
"Resource": "arn:aws:route53:::change/*"
}
]
}
"Resource": [
"arn:aws:route53:::hostedzone/Z12345678901",
"arn:aws:route53:::hostedzone/Z12345678901"
]
export AWS_ACCESS_KEY_ID=AKIA1234567890124567
export AWS_SECRET_ACCESS_KEY=FakeFAKEfakeFAKEfakeFAKEfakeFAKEfakeFAKE
[default]
aws_access_key_id = AKIA1234567890124567
aws_secret_access_key = FakeFAKEfakeFAKEfakeFAKEfakeFAKEfakeFAKE
# edit domains.txt
# see https://github.com/lukas2511/dehydrated/blob/v0.5.0/docs/domains_txt.md
# install cli53 dependency
brew install cli53 # on macOS
# otherwise see https://github.com/barnybug/cli53
# generate keys + csrs, check cert expiry date, and run challenges
./d -f config.STAGING --cron
If that works; repeat using config.PRODUCTION
Taken from whereisaaron/dehydrated-route53-hook-script
The script will only renew certs if they are within RENEW_DAYS
days from expiry.
(default 30).
@daily path/to/repo/d --config path/to/repo/config.PRODUCTION --cron >/dev/null
- https://github.com/lukas2511/dehydrated
- https://github.com/whereisaaron/dehydrated-route53-hook-script
- Screenshots for AWS setup