-
Notifications
You must be signed in to change notification settings - Fork 321
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
feat(rego): add query to check iam policy to invoke lambda #5542
feat(rego): add query to check iam policy to invoke lambda #5542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/metadata.json
Outdated
Show resolved
Hide resolved
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/test/postive.4.tf
Outdated
Show resolved
Hide resolved
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/test/postive.4.tf
Outdated
Show resolved
Hide resolved
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/query.rego
Outdated
Show resolved
Hide resolved
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/metadata.json
Outdated
Show resolved
Hide resolved
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/query.rego
Outdated
Show resolved
Hide resolved
Co-authored-by: Rafaela Soares <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, @jplanckeel!
We need to update the positive_expected_result.json:
...ies/terraform/aws/lambda_iam_invokefunction_misconfigured/test/positive_expected_result.json
Outdated
Show resolved
Hide resolved
Co-authored-by: Rafaela Soares <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
I will wait only for our security team to approve the severity and category.
assets/queries/terraform/aws/lambda_iam_invokefunction_misconfigured/metadata.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reviewing the proposed new rule and associated Severity, Category, and Description my only comment is regarding the query name, it should be "Lambda IAM InvokeFunction Misconfigured".
...ies/terraform/aws/lambda_iam_invokefunction_misconfigured/test/positive_expected_result.json
Outdated
Show resolved
Hide resolved
Co-authored-by: Rafaela Soares <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Thank you so much for contributing, @jplanckeel!
Proposed Changes
Since June 2022 IAM policy to invoke lambda need to defined two ressources :
I propose to create a good practice rule to indicate this
I submit this contribution under the Apache-2.0 license.