Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Fix storage of ACM certificates #1210

Merged
merged 2 commits into from
Jun 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions security_monkey/watchers/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update to:

if config.get('RenewalSummary', {}).get('UpdatedAt'):
    config['RenewalSummary']['UpdatedAt'] = config['RenewalSummary']['UpdatedAt'].astimezone(tzutc()).isoformat()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes applied.

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)
Expand Down