Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
Dependency Management Data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
tanna.dev
Dependency Management Data
Commits
e5605f42
Commit
e5605f42
authored
1 year ago
by
Jamie Tanna
Browse files
Options
Downloads
Patches
Plain Diff
Improve "starting point" for OPA policies
parent
d3089583
No related branches found
No related tags found
1 merge request
!165
Allow `WARN` level for Policy Violations
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/content/cookbooks/custom-advisories-opa.md
+12
-3
12 additions, 3 deletions
public/content/cookbooks/custom-advisories-opa.md
with
12 additions
and
3 deletions
public/content/cookbooks/custom-advisories-opa.md
+
12
−
3
View file @
e5605f42
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment