From 312e91e442d35727baad878d0724e28d5237f076 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Wed, 13 Oct 2021 13:54:47 -0400 Subject: [PATCH] Add support for dry runs so testing is easier Closes #19 Per https://docs.aws.amazon.com/lambda/latest/dg/python-logging.html log messages were also converted to print statements. Logging was not visible with the logging setup. --- function/function.zip | Bin 19017856 -> 19018019 bytes function/index.py | 45 ++++++++++++++++++++++++-------------- function/requirements.txt | 1 + 3 files changed, 29 insertions(+), 17 deletions(-) diff --git a/function/function.zip b/function/function.zip index 22f5df6f294bdff511ad2e5de70a9d1ef1106b48..2ac4b56cd88f3be8b2a01dde981f1d069f0c80eb 100644 GIT binary patch delta 29665 zcmZ8q1$Y%l7iDJ?Bp%`~jsy+v`Unyug2W*txCSpylCs6!wncKG6j~@+C@w*Y6fd4Y z1b2c%Lc)J$cOLTdeQ#&Zxp(g9j&DfIpI&aw?dj#x6iH!fD7K27Vy~1}927^zNpV(O6j#MfF(~eehvKPtDc*{Y;;U3pDk_zf%8H*-MX9P( zQ>rU9l$wgaQcJ0=)KTgx^_2Qb1ErzTNNKDzQJN~vl;%ncrKQqJX{{KQHcEifR%xfS zS2`$xN{|w)geaj(M1rIXTG>7sO1qLgSQMu}D8lz1gU>85m75|tiGl9H_S zRC+1Bl|D*erJvGY8K4YQ1}TG;AxereR2ilWS4Jo!l~KxQDVvoo%2s8Y@|Ut**`fTc z>{NCsyOll4US*%MUpb&0R1PVb%3a#gveTvu-F$lALp^=e93mo|M@b!}0mRH>E@rAn18Q%nhuKK~d70#VnIH+y(amT_p1$I4-RBrs|2z$Q~lU)B?-sE1w$PcZG^N;Sk z`=O}4$D!uu7LKXnz3{`cX}yQPdVcrrvuWOUqGxTfTyGT@RB_%DRjDRh<~O_lYhq}x zqgFk(7j}PK7_80;IHe4@HE?asihUNGZZc=~>^H;bpH8iGZcT+of660{?yQiw{oH_A z^8(EcCy$u$?b_hswb`ZeknJUpz-(Nlxp3~2E1{M3sl{yh93fA+cN$(@!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*CA--k;W`>2PB(Z_I<+tjx1;Puw&8KTysm;Q#;t diff --git a/function/index.py b/function/index.py index f3b13572..dbf11016 100644 --- a/function/index.py +++ b/function/index.py @@ -5,24 +5,26 @@ import datetime import os import subprocess -import logging def upload_to_s3(local_path, keyname): - logging.info('Uploading files to S3') + print('INFO: Uploading files to S3') s3 = boto3.resource('s3') data = open(local_path, 'rb') s3.Bucket(os.environ['CERTIFICATE_BUCKET']).put_object(Key=f"{os.environ['OBJECT_PREFIX']}{keyname}", Body=data) def read_and_delete_file(path, filename): - upload_to_s3(path, filename) + if not os.getenv("DRY_RUN", 'False').lower() in ["true", "1"]: + upload_to_s3(path, filename) - with open(path, 'r') as file: - contents = file.read() - os.remove(path) - return contents + with open(path, 'r') as file: + contents = file.read() + os.remove(path) + return contents + else: + print(f'WARN: Dry run was used so {filename} was not generated.') def provision_cert(email, domains): - certbot.main.main([ + cerbot_args = [ 'certonly', # Obtain a cert but don't install it '-n', # Run in non-interactive mode '--agree-tos', # Agree to the terms of service, @@ -34,7 +36,11 @@ def provision_cert(email, domains): '--work-dir', '/tmp/work-dir/', '--logs-dir', '/tmp/logs-dir/', '--preferred-chain', os.environ['PREFERRED_CHAIN'], - ]) + ] + if os.getenv("DRY_RUN", 'False').lower() in ["true", "1"]: + cerbot_args.append("--dry-run") + + certbot.main.main(cerbot_args) first_domain = domains.split(',')[0] path = '/tmp/config-dir/live/' + first_domain + '/' @@ -47,18 +53,18 @@ def provision_cert(email, domains): def should_provision(domains): existing_cert = find_existing_cert(domains) if existing_cert: - logging.info('Cert already exists. Checking date for reissue.') + print('INFO: Cert already exists. Checking date for reissue.') now = datetime.datetime.now(datetime.timezone.utc) not_after = existing_cert['Certificate']['NotAfter'] reissue = (not_after - now).days <= int(os.environ['REISSUE_DAYS']) if reissue: - logging.info(f'Cert will expire sometime in the next {os.environ["REISSUE_DAYS"]} days so will be reissued.') + print(f'INFO: Cert will expire sometime in the next {os.environ["REISSUE_DAYS"]} days so will be reissued.') return reissue else: - logging.info(f'Cert wont expire in next {os.environ["REISSUE_DAYS"]} days so will NOT be reissued.') + print(f'INFO: Cert wont expire in next {os.environ["REISSUE_DAYS"]} days so will NOT be reissued.') return reissue else: - logging.info('Cert not found in ACM. Will issue new cert.') + print('INFO: Cert not found in ACM. Will issue new cert.') return True def find_existing_cert(domains): @@ -78,7 +84,7 @@ def find_existing_cert(domains): return None def notify_via_sns(topic_arn, domains, certificate): - logging.info('Sending SNS notification') + print('INFO: Sending SNS notification') process = subprocess.Popen(['openssl', 'x509', '-noout', '-text'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, encoding='utf8') stdout, stderr = process.communicate(certificate) @@ -90,7 +96,7 @@ def notify_via_sns(topic_arn, domains, certificate): ) def upload_cert_to_acm(cert, domains): - logging.info('Importing cert to ACM') + print('INFO: Importing cert to ACM') existing_cert = find_existing_cert(domains) certificate_arn = existing_cert['Certificate']['CertificateArn'] if existing_cert else None @@ -115,5 +121,10 @@ def handler(event, context): domains = os.environ['LETSENCRYPT_DOMAINS'] if should_provision(domains): cert = provision_cert(os.environ['LETSENCRYPT_EMAIL'], domains) - upload_cert_to_acm(cert, domains) - notify_via_sns(os.environ['NOTIFICATION_SNS_ARN'], domains, cert['certificate']) + if not os.getenv("DRY_RUN", 'False').lower() in ["true", "1"]: + upload_cert_to_acm(cert, domains) + notify_via_sns(os.environ['NOTIFICATION_SNS_ARN'], domains, cert['certificate']) + else: + print('WARN: Dry run was used so ACM import and S3 upload arent tested.') + +handler('', '') diff --git a/function/requirements.txt b/function/requirements.txt index 1d92838f..0ba94f7c 100644 --- a/function/requirements.txt +++ b/function/requirements.txt @@ -1,2 +1,3 @@ +boto3 certbot certbot-dns-route53