Skip to content

Cannot get custom checks for Terraform config to work (misconfiguration, rego) #6453

Closed Answered by ricardo-kh
ricardo-kh asked this question in Q&A
Discussion options

You must be logged in to vote

I think I found out what is happening for my example. Why the JSON didn't contain expected data.

In my example main.tf I used resource "google_service_account".
But I think that this kind of resource is not recognized. That's at least my impression after browsing this code: https://github.com/aquasecurity/trivy-iac/tree/main/internal/adapters/terraform/google.

After adding something like resource "google_project_iam_member" to the main.tf I do see that the JSON includes GCP specific information.

Sharing my test setup for completeness:

deny.rego:

# METADATA
# title: "Trying to see what the input is"
# description: "Printing the complete input"
# custom:
#   id: foo
#   severity: HIGH
package 

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@ricardo-kh
Comment options

Comment options

You must be logged in to vote
1 reply
@ricardo-kh
Comment options

Answer selected by ricardo-kh
Comment options

You must be logged in to vote
2 replies
@simar7
Comment options

@ricardo-kh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
triage/support Indicates an issue that is a support question.
2 participants