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

Lambda functions should operate in more than one availability zone false positives. Fixes #609 #610

Merged
merged 3 commits into from
Apr 18, 2023
Merged
Changes from 2 commits
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
8 changes: 4 additions & 4 deletions conformance_pack/lambda.sp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ query "lambda_function_dead_letter_queue_configured" {
query "lambda_function_in_vpc" {
sql = <<-EOQ
select

arn as resource,
case
when vpc_id is null then 'alarm'
Expand All @@ -139,7 +138,6 @@ query "lambda_function_in_vpc" {
when vpc_id is null then title || ' is not in VPC.'
else title || ' is in VPC ' || vpc_id || '.'
end reason

${local.tag_dimensions_sql}
${local.common_dimensions_sql}
from
Expand Down Expand Up @@ -254,13 +252,13 @@ query "lambda_function_cloudtrail_logging_enabled" {
case
when (l.arn = c.lambda_arn)
or (r.lambda_arn = 'arn:aws:lambda' and r.cloudtrail_region = l.region )
or a.cloudtrail_region = l.region then 'ok'
or a.cloudtrail_region = l.region then 'ok'
else 'alarm'
end as status,
case
when (l.arn = c.lambda_arn)
or (r.lambda_arn = 'arn:aws:s3' and r.cloudtrail_region = l.region )
or a.cloudtrail_region = l.region then l.name || ' logging enabled.'
or a.cloudtrail_region = l.region then l.name || ' logging enabled.'
else l.name || ' logging not enabled.'
end as reason
${local.tag_dimensions_sql}
Expand Down Expand Up @@ -321,6 +319,7 @@ query "lambda_function_multiple_az_configured" {
arn as resource,
case
when vpc_id is null then 'skip'
when vpc_id = '' then 'skip'
else case
when
(
Expand All @@ -337,6 +336,7 @@ query "lambda_function_multiple_az_configured" {
end as status,
case
when vpc_id is null then title || ' is not in VPC.'
when vpc_id = '' then title || ' is not in VPC.'
else title || ' has ' || jsonb_array_length(vpc_subnet_ids) || ' availability zone(s).'
end as reason
${local.tag_dimensions_sql}
Expand Down