From 8ce46e068c84c79ca496a9803760cd96f3d44f94 Mon Sep 17 00:00:00 2001 From: Pedro Dallegrave Date: Fri, 21 Jun 2019 12:53:13 +0200 Subject: [PATCH 1/2] fixes issue Netflix/security_monkey/issues/1209 --- security_monkey/watchers/acm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security_monkey/watchers/acm.py b/security_monkey/watchers/acm.py index e1c56d74f..bd139700d 100644 --- a/security_monkey/watchers/acm.py +++ b/security_monkey/watchers/acm.py @@ -97,6 +97,9 @@ def slurp(self): config.update({ 'IssuedAt': config.get('IssuedAt').astimezone(tzutc()).isoformat() }) if config.get('ImportedAt'): config.update({ 'ImportedAt': config.get('ImportedAt').astimezone(tzutc()).isoformat()}) + if config.get('RenewalSummary').get('UpdatedAt'): + config.get('RenewalSummary').update({'UpdatedAt': config.get('RenewalSummary').get( + 'UpdatedAt').astimezone(tzutc()).isoformat()}) item = ACMCertificate(region=region.name, account=account, name=cert.get('DomainName'), arn=cert.get('CertificateArn'), config=dict(config), source_watcher=self) From ccfba144bb26b3cd6db247a6732825ddd5593b21 Mon Sep 17 00:00:00 2001 From: Pedro Dallegrave Date: Wed, 26 Jun 2019 10:12:46 +0200 Subject: [PATCH 2/2] PR comments applied --- security_monkey/watchers/acm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/security_monkey/watchers/acm.py b/security_monkey/watchers/acm.py index bd139700d..e02894198 100644 --- a/security_monkey/watchers/acm.py +++ b/security_monkey/watchers/acm.py @@ -97,9 +97,9 @@ def slurp(self): config.update({ 'IssuedAt': config.get('IssuedAt').astimezone(tzutc()).isoformat() }) if config.get('ImportedAt'): config.update({ 'ImportedAt': config.get('ImportedAt').astimezone(tzutc()).isoformat()}) - if config.get('RenewalSummary').get('UpdatedAt'): - config.get('RenewalSummary').update({'UpdatedAt': config.get('RenewalSummary').get( - 'UpdatedAt').astimezone(tzutc()).isoformat()}) + if config.get('RenewalSummary', {}).get('UpdatedAt'): + config['RenewalSummary']['UpdatedAt'] = config['RenewalSummary']['UpdatedAt'].astimezone( + tzutc()).isoformat() item = ACMCertificate(region=region.name, account=account, name=cert.get('DomainName'), arn=cert.get('CertificateArn'), config=dict(config), source_watcher=self)