Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

charts: Update authz policy to be v1 compatible #273

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions charts/opa-kube-mgmt/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,18 @@ spec:
TOKEN=`cat /bootstrap/mgmt-token`
cat > /bootstrap/authz.rego <<EOF
package system.authz
default allow = false
import rego.v1
default allow := false
# Allow anonymous access to the default policy decision.
allow { input.path = [""]; input.method = "POST" }
allow { input.path = [""]; input.method = "GET" }
allow if { input.path = [""]; input.method == "POST" }
allow if { input.path = [""]; input.method == "GET" }
# This is only used for health check in liveness and readiness probe
allow { input.path = ["health"]; input.method = "GET" }
allow if { input.path = ["health"]; input.method == "GET" }
{{- if .Values.prometheus.enabled }}
# This allows metrics to be scraped by prometheus
allow { input.path = ["metrics"]; input.method = "GET" }
allow if { input.path = ["metrics"]; input.method == "GET" }
{{- end }}
allow { input.identity == "$TOKEN" }
allow if { input.identity == "$TOKEN" }
EOF
{{- end }}
{{- range $policyName, $policy := .Values.bootstrapPolicies }}
Expand Down
2 changes: 1 addition & 1 deletion charts/opa-kube-mgmt/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ hostNetwork:
# OPA docker image configuration.
image:
repository: openpolicyagent/opa
tag: 0.69.0
tag: 1.0.1
pullPolicy: IfNotPresent

# One or more secrets to be used when pulling images
Expand Down
Loading