Skip to content

Commit

Permalink
Revert "Update the policy"
Browse files Browse the repository at this point in the history
This reverts commit 6fd5b0c.
  • Loading branch information
aravindnswamy committed Feb 22, 2024
1 parent 6fd5b0c commit f19e2e1
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions policies/opsverse-corcentric-cd/policy-include/include.rego
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
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": true, "why": "security_rating"}] {
allow if {
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 f19e2e1

Please sign in to comment.