Skip to content

Commit eb30c73

Browse files
charts: Update authz policy to be v1 compatible
Fixes: #272 Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
1 parent ae2e69d commit eb30c73

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

charts/opa-kube-mgmt/templates/deployment.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,18 @@ spec:
5858
TOKEN=`cat /bootstrap/mgmt-token`
5959
cat > /bootstrap/authz.rego <<EOF
6060
package system.authz
61-
default allow = false
61+
import rego.v1
62+
default allow := false
6263
# Allow anonymous access to the default policy decision.
63-
allow { input.path = [""]; input.method = "POST" }
64-
allow { input.path = [""]; input.method = "GET" }
64+
allow if { input.path = [""]; input.method == "POST" }
65+
allow if { input.path = [""]; input.method == "GET" }
6566
# This is only used for health check in liveness and readiness probe
66-
allow { input.path = ["health"]; input.method = "GET" }
67+
allow if { input.path = ["health"]; input.method == "GET" }
6768
{{- if .Values.prometheus.enabled }}
6869
# This allows metrics to be scraped by prometheus
69-
allow { input.path = ["metrics"]; input.method = "GET" }
70+
allow if { input.path = ["metrics"]; input.method == "GET" }
7071
{{- end }}
71-
allow { input.identity == "$TOKEN" }
72+
allow if { input.identity == "$TOKEN" }
7273
EOF
7374
{{- end }}
7475
{{- range $policyName, $policy := .Values.bootstrapPolicies }}

charts/opa-kube-mgmt/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ hostNetwork:
112112
# OPA docker image configuration.
113113
image:
114114
repository: openpolicyagent/opa
115-
tag: 0.69.0
115+
tag: 1.0.1
116116
pullPolicy: IfNotPresent
117117

118118
# One or more secrets to be used when pulling images

0 commit comments

Comments
 (0)