verbose partial rule output #216
-
I would like to get verbose partial rule output. Namely, I would like to define two or more variables that will act as checks for certain error conditions in my policy. I would like these variables to have default values such that I know where things went wrong in my policy. If they the policy goes correctly, I would like them to update as well. For example, I have the following input approximately taken from an aws page (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#aws-resource-ec2-subnet--examples)
Here is my example policy. I'm simply checking if the resource is an aws subnet and then if the MapPublicIpOnLaunch is set to false. For the record, I was experimenting heavily with these composite keys and variable assignments so I understand they're likely not correct.
When I run
How come I'm still seeing the default values for those two variables? Should they not have updated when the policy passed? Conversely, when I run the above command with the "MapPublicIpOnLaunch" field set to "true", I get this output: How come the default values in the key did not appear? How am I supposed to get default values back for partial rules? Is it then possible to update these default values upon rule success? Any help is appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @stevend-15 There are couple things that would help here.
I've shown this as an example here: https://play.openpolicyagent.org/p/IPLoeC7Awy What would be more common, is to set a policy that compiles a list of
|
Beta Was this translation helpful? Give feedback.
Hi @stevend-15
There are couple things that would help here.
default
keyword: Default KeywordI've shown this as an example here: https://play.openpolicyagent.org/p/IPLoeC7Awy
What would be more common, is to set a policy that compiles a list of
deny
messages, each one checking one specific piece of the input.