Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudformation): fix lc ebs encryption #3598

Merged
merged 5 commits into from
Oct 2, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ def scan_resource_conf(self, conf):
:param conf: aws_launch_configuration configuration
:return: <CheckResult>
"""
if 'Properties' in conf.keys() and conf['Properties'].get('BlockDeviceMappings'):
for block_device_mapping in conf['Properties']['BlockDeviceMappings']:
if not isinstance(block_device_mapping, dict):
return CheckResult.UNKNOWN
if block_device_mapping.get('Ebs'):
if not block_device_mapping['Ebs'].get('Encrypted'):
return CheckResult.FAILED
block_device_mappings = conf.get('Properties', {}).get('BlockDeviceMappings')
if block_device_mappings is None:
return CheckResult.UNKNOWN
if not isinstance(block_device_mappings, list):
return CheckResult.UNKNOWN
for block_device_mapping in block_device_mappings:
if not isinstance(block_device_mapping, dict):
return CheckResult.UNKNOWN
if block_device_mapping.get('Ebs'):
if not block_device_mapping['Ebs'].get('Encrypted'):
return CheckResult.FAILED

return CheckResult.PASSED

Expand Down