Skip to content
Snippets Groups Projects
Commit e5605f42 authored by Jamie Tanna's avatar Jamie Tanna
Browse files

Improve "starting point" for OPA policies

parent d3089583
No related branches found
No related tags found
1 merge request!165Allow `WARN` level for Policy Violations
...@@ -28,12 +28,21 @@ With that in mind, the following is a good starting point for fresh policies: ...@@ -28,12 +28,21 @@ With that in mind, the following is a good starting point for fresh policies:
```rego ```rego
package policy package policy
default deny := false import future.keywords.contains
import future.keywords.if
default msg := ""
# can be any value that matches one of the valid `advisory_type`s in https://dmd.tanna.dev/schema/#internaladvisorydbschemasql # can be any value that matches one of the valid `advisory_type`s in https://dmd.tanna.dev/schema/#internaladvisorydbschemasql
default advisory_type := "POLICY" default advisory_type := "POLICY"
deny contains msg if {
false
msg := "This will deny the dependency"
}
warn contains msg if {
false
msg := "This will warn about the usage of the dependency"
}
``` ```
### Flagging a violation ### Flagging a violation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment