Running conftest verify resulted in a pass even though the rule should have failed at db.storage_encrypted != true
. What am I missing here?
# deny.rego
deny_unencrypted[msg] {
db := input.resource.aws_db_instance[x]
db.storage_encrypted != true # should fail here
msg = sprintf("RDS `%v` has unencrypted storage", [x])
}
# deny_test.rego
test_unencrypted {
cfg := parse_config("hcl2", `
resource "aws_db_instance" "default" {
storage_encrypted = true
}
`)
deny_unencrypted with input as cfg
}