Skip to content

Commit

Permalink
authorization policy added
Browse files Browse the repository at this point in the history
  • Loading branch information
Canpolat Oral committed Nov 10, 2024
1 parent f01fb8c commit 5eab2a4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/base/base-ms-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.1.2
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.2"
appVersion: "0.1.3"
18 changes: 18 additions & 0 deletions charts/base/base-ms-chart/templates/authorizationpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.authorizationPolicy.enabled }}
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: {{ include "ms.fullname" . }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "ms.name" . }}
action: ALLOW
rules:
{{- range .Values.authorizationPolicy.allowedSources }}
- from:
- source:
# namespaces: ["{{ .namespace }}"]
principals: ["cluster.local/ns/{{ .namespace }}/sa/{{ .serviceAccount }}"]
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/base/base-ms-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ destinationRule:
# interval: "1s"
# baseEjectionTime: "1m"


authorizationPolicy:
enabled: false

# allowedSources:
# - namespace: transfer
# serviceAccount: transfer-service-account
# - namespace: customer
# serviceAccount: payments-service-account

replicaCount: 1

image:
Expand Down

0 comments on commit 5eab2a4

Please sign in to comment.