Skip to content

Commit

Permalink
Update the policy
Browse files Browse the repository at this point in the history
  • Loading branch information
aravind-opsverse authored Feb 22, 2024
1 parent 120c742 commit 6fd5b0c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions policies/opsverse-corcentric-cd/policy-include/include.rego
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
}

0 comments on commit 6fd5b0c

Please sign in to comment.