Solution skill
Checkov attribute reference
Complete solution
depending on what you want to achieve you can use .*.
Checkov attribute reference
TL;DR
In the process, I am also writing my own policies. I would like to write a policy that checks the content inside "managedruleset". I know how to reference the attributes from the terraform-file correctly, but not how to do it in this particular case.
Use this when you run into the situation in the title.
When not to use this skill: unrelated tasks. It covers only the procedure above.
Compatibility
The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.
Details
In the process, I am also writing my own policies. I would like to write a policy that checks the content inside "managedruleset". I know how to reference the attributes from the terraform-file correctly, but not how to do it in this particular case. I define the custom policies via a yaml-file and orient myself on the documentation of checkov. Terraform-file: tf-file ``` resource "azurermwebapplicationfirewallpolicy" "wafnetwork" { name = "waf-${var.tagproject}-network-${var.tagenvironment}" resourcegroup_name = azurer
Evidence
Source: Stack Overflow #70879881 (accepted answer, 3 votes, 1 answers): I am currently learning policy-as-code with the help of Checkov. In the process, I am also writing my own policies. I would like to write a policy that checks the content inside "managedruleset". I know how to reference the attributes from the terraform-file correctly, but not how to do it in this particular case. I define the custom policies via a yaml-file and orient myself on the documentation of checkov. Terraform-file: tf-file ``` resource "azurermwebapplicationfirewallpolicy" "wafnetwork" { name = "waf-${var.tagproject}-network-${var.tagenvironment}" resourcegroup_name = azurer
Verified resolution: [gruebel (accepted answer)]: depending on what you want to achieve you can use .. to reference all the managedruleset blocks, like that ``` - condtype: "attribute" resourcetypes: - "azurermwebapplicationfirewallpolicy" attribute: "managedrules.managedrule_set..type" operator: "contains" value: "OWASP" ```
Source URL: https://stackoverflow.com/questions/70879881
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_OfD1QB1AmUpwC8jTyClw3g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Checkov attribute reference <span>— Vectle</span></a>