-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
120c742
commit 6fd5b0c
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
16 changes: 11 additions & 5 deletions
16
policies/opsverse-corcentric-cd/policy-include/include.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
package example.include | ||
|
||
import rego.v1 | ||
|
||
default allow := false | ||
default minSecurityRatingAllowed := "1.0" | ||
default minReliabilityRatingAllowed := "1.0" | ||
default maxComplexityAllowed := "10" | ||
default maxNclocAllowed := "50" | ||
default maxNewViolationsAllowed := "10" | ||
|
||
allow if { | ||
allow if [{"allow": true, "why": "security_rating"}] { | ||
input.metricName == "security_rating" | ||
input.metricValue >= minSecurityRatingAllowed | ||
} { | ||
} | ||
|
||
allow if [{"allow": true, "why": "reliability_rating"}] { | ||
input.metricName == "reliability_rating" | ||
input.metricValue >= minReliabilityRatingAllowed | ||
} { | ||
} | ||
|
||
allow if [{"allow": true, "why": "complexity"}] { | ||
input.metricName == "complexity" | ||
input.metricValue <= maxComplexityAllowed | ||
} { | ||
} | ||
|
||
allow if [{"allow": true, "why": "ncloc"}] { | ||
input.metricName == "ncloc" | ||
input.metricValue <= maxNclocAllowed | ||
} |