-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6822 from Tohar-orca/lambda-invokefunction-fp
fix(query): lambda_iam_invokefunction_misconfigured
- Loading branch information
Showing
7 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
assets/queries/terraform/aws/api_gateway_with_cloudwatch_logging_disabled/test/negative2.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module "env" { | ||
source = "./env" | ||
} | ||
|
||
resource "aws_api_gateway_rest_api" "example" { | ||
# ... other configuration ... | ||
} | ||
|
||
resource "aws_api_gateway_stage" "example" { | ||
depends_on = [aws_cloudwatch_log_group.example] | ||
|
||
stage_name = module.env.vars.stage_name | ||
# ... other configuration ... | ||
} | ||
|
||
resource "aws_cloudwatch_log_group" "example" { | ||
name = "API-Gateway-Execution-Logs_${aws_api_gateway_rest_api.example.id}/${module.env.vars.stage_name}" | ||
retention_in_days = 7 | ||
# ... potentially other configuration ... | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/test/negative3.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
resource "aws_lambda_function" "negative3" { | ||
function_name = "negative3" | ||
role = "negative3_role" | ||
} | ||
|
||
resource "aws_iam_policy" "negative3policy" { | ||
name = "negative3policy" | ||
path = "/" | ||
description = "negative3 Policy" | ||
|
||
# Terraform's "jsonencode" function converts a | ||
# Terraform expression result to valid JSON syntax. | ||
policy = jsonencode({ | ||
Version = "2012-10-17" | ||
Statement = [ | ||
{ | ||
Action = [ | ||
"s3:*", | ||
] | ||
Effect = "Allow" | ||
Resource = [ | ||
aws_lambda_function.negative3.arn, | ||
"${aws_lambda_function.negative3.arn}:*" | ||
] | ||
}, | ||
] | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters