Skip to content

Commit

Permalink
Lambda functions should operate in more than one availability zone fa…
Browse files Browse the repository at this point in the history
…lse positives. Fixes #609 (#610)

* Lambda functions should operate in more than one availability zone false positives. Fixes #609
  • Loading branch information
rajlearner17 authored Apr 18, 2023
1 parent e090c83 commit 964aa59
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions conformance_pack/lambda.sp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,15 @@ 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'
when vpc_id is null or vpc_id = '' then 'alarm'
else 'ok'
end status,
case
when vpc_id is null then title || ' is not in VPC.'
when vpc_id is null or vpc_id = '' 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 @@ -320,7 +318,7 @@ query "lambda_function_multiple_az_configured" {
select
arn as resource,
case
when vpc_id is null then 'skip'
when vpc_id is null or vpc_id = '' then 'skip'
else case
when
(
Expand All @@ -336,7 +334,7 @@ query "lambda_function_multiple_az_configured" {
end
end as status,
case
when vpc_id is null then title || ' is not in VPC.'
when vpc_id is null or 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

0 comments on commit 964aa59

Please sign in to comment.