You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've just started using Terrascan and new to Rego so this is likely user error. Any help is really appreciated.
So, I've started using Terrascan and want to incorporate it into our IAC pipelines. Most of the policies built in are fine, but we want to add a few more. So I've created one test policy to try and understand how it works.
The policy checks out in the Rego playground, but when we scan, pointing to this new policy, it doesn't seem to generate a violation, where it should.
What I Did
Here's a copy of my .rego policy, which is effectively a copy of one of the other policies already included in the storage_account directory. This is to check for any 'min_tls_version' settings that aren't TLS 1.2. :
The returned function name from the rego should match the name specified in the json.
I see the name in the rego is storageAccountTLS and name specified in the json is storageAccountTLSVersion.
Can try making those same and see if that helps.
The returned function name from the rego should match the name specified in the json.
I see the name in the rego is storageAccountTLS and name specified in the json is storageAccountTLSVersion.
Can try making those same and see if that helps.
Awesome! That's done the trick.. I'm kicking myself now that it's something so obvious... Thanks for pointing that out though. Big help.. :-)
Description
Hi, I've just started using Terrascan and new to Rego so this is likely user error. Any help is really appreciated.
So, I've started using Terrascan and want to incorporate it into our IAC pipelines. Most of the policies built in are fine, but we want to add a few more. So I've created one test policy to try and understand how it works.
The policy checks out in the Rego playground, but when we scan, pointing to this new policy, it doesn't seem to generate a violation, where it should.
What I Did
Here's a copy of my .rego policy, which is effectively a copy of one of the other policies already included in the storage_account directory. This is to check for any 'min_tls_version' settings that aren't TLS 1.2. :
When I run this in the playground, I get the returned value as expected when TLS version does not match TLS1_2.
So, when I run a scan I point the local directory that contains my policy file (and json) using this command:
terrascan scan -p \tfdev\terrascan\terrascan-master\pkg\policies\opa\rego\azure\terraform-azurerm_storage_account
I would expect to get a violated policy as my config is set to use TLS1_0. however, I get this.
This is my json file too:
I must be going wrong somewhere, so any help appreciated.
The text was updated successfully, but these errors were encountered: