Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added auth policy for app-validator, app-event-service and source ada…
…pter (#7349) * Added auth policy for validator and source adapter Added http-usermetric for HTTPSourceAdapter policy * Removed policy * Removing host header for all requests to event-service * Fine tuned RBAC * Retaining policy for non strict mode * Refactored as per review comments * Parameterized serviceaccount for core-console-backend-service * Fixed auth policy * Changed delete to req.del * Fixed validator tests * Update components/application-operator/README.md Co-Authored-By: Barbara Szwarc <barbara.m.szwarc@gmail.com> * Fixes related to PR comments * Fixes related to rebase issues * Fixed readme Co-authored-by: Barbara Szwarc <barbara.m.szwarc@gmail.com>
- Loading branch information
Showing
16 changed files
with
232 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
components/application-operator/charts/application/templates/authorization-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{{- if eq .Values.global.strictMode "enabled" }} | ||
--- | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
name: {{ .Release.Name }}-connectivity-validator | ||
labels: | ||
app: {{ .Release.Name }}-connectivity-validator | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-connectivity-validator | ||
rules: | ||
- from: | ||
- source: | ||
principals: | ||
- cluster.local/ns/istio-system/sa/istio-ingressgateway-service-account | ||
to: | ||
- operation: | ||
methods: | ||
- POST | ||
paths: | ||
- /{{ .Release.Name }}/v1/events | ||
- /{{ .Release.Name }}/v2/events | ||
- /{{ .Release.Name }}/events | ||
- operation: | ||
methods: | ||
- GET | ||
- PUT | ||
- POST | ||
- DELETE | ||
paths: | ||
- /{{ .Release.Name }}/v1/metadata* | ||
- from: | ||
- source: | ||
principals: | ||
- cluster.local/ns/kyma-system/sa/{{ .Values.authorizationPolicy.serviceAccount.consoleBackendService }} | ||
to: | ||
- operation: | ||
methods: | ||
- GET | ||
paths: | ||
- /v1/health | ||
--- | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
name: {{ .Release.Name }}-event-service | ||
labels: | ||
app: {{ .Release.Name }}-event-service | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-event-service | ||
rules: | ||
- from: | ||
- source: | ||
principals: | ||
- cluster.local/ns/kyma-integration/sa/{{ .Release.Name }}-connectivity-validator | ||
- cluster.local/ns/kyma-integration/sa/{{ .Release.Name }}-event-service-acceptance | ||
to: | ||
- operation: | ||
methods: | ||
- POST | ||
paths: | ||
- /{{ .Release.Name }}/v1/events | ||
- /{{ .Release.Name }}/v2/events | ||
- operation: | ||
methods: | ||
- GET | ||
paths: | ||
- /{{ .Release.Name }}/v1/events/subscribed | ||
- /v1/health | ||
- from: | ||
- source: | ||
principals: | ||
- cluster.local/ns/kyma-system/sa/{{ .Values.authorizationPolicy.serviceAccount.consoleBackendService }} | ||
to: | ||
- operation: | ||
methods: | ||
- GET | ||
paths: | ||
- /v1/health | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-event-service | ||
--- | ||
apiVersion: security.istio.io/v1beta1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
labels: | ||
app: {{ .Release.Name }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
name: {{ .Release.Name }}-http-source | ||
namespace: kyma-integration | ||
spec: | ||
rules: | ||
- from: | ||
- source: | ||
principals: | ||
- cluster.local/ns/knative-serving/sa/controller | ||
to: | ||
- operation: | ||
methods: | ||
- POST | ||
- GET | ||
paths: | ||
- /* | ||
- to: | ||
- operation: | ||
methods: | ||
- GET | ||
paths: | ||
- /metrics | ||
selector: | ||
matchLabels: | ||
serving.knative.dev/service: {{ .Release.Name }} | ||
{{- end }} |
10 changes: 0 additions & 10 deletions
10
components/application-operator/charts/application/templates/policy.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
components/application-operator/charts/application/templates/service-account.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: {{ .Release.Name }}-connectivity-validator | ||
labels: | ||
app: {{ .Release.Name }}-connectivity-validator | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.