-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4cb0e32
commit 16c79c8
Showing
12 changed files
with
97 additions
and
31 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
apps/kyverno/components/default-clusterpolicies/cp-istio-virtualservice-correct-domain.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,40 @@ | ||
--- | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: restrict-virtual-service-domain | ||
annotations: | ||
policies.kyverno.io/title: Restrict Virtual Service Host with Wildcards | ||
policies.kyverno.io/category: Istio | ||
policies.kyverno.io/severity: medium | ||
kyverno.io/kyverno-version: 1.8.4 | ||
policies.kyverno.io/minversion: 1.6.0 | ||
kyverno.io/kubernetes-version: "1.23" | ||
policies.kyverno.io/subject: VirtualService | ||
policies.kyverno.io/description: >- | ||
Virtual Services optionally accept a wildcard as an alternative | ||
to precise matching. In some cases, this may be too permissive as it | ||
would direct unintended traffic to the given resource. This | ||
policy enforces that any Virtual Service host does not contain a wildcard | ||
character and allows for more governance when a single mesh deployment | ||
model is used. | ||
spec: | ||
validationFailureAction: "enforce" | ||
background: true | ||
rules: | ||
- name: "block-virtual-service-wildcard" | ||
match: | ||
any: | ||
- resources: | ||
kinds: | ||
- "VirtualService" | ||
validate: | ||
message: "Only VirtualService objects for the correct domain are allowed." | ||
foreach: | ||
- list: "request.object.spec.hosts" | ||
deny: | ||
conditions: | ||
any: | ||
- key: "{{element}}" | ||
operator: NotEquals | ||
value: "*.ez.soeren.cloud" |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- repo.yaml | ||
- release.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,17 @@ | ||
apiVersion: "helm.toolkit.fluxcd.io/v2" | ||
kind: "HelmRelease" | ||
metadata: | ||
name: "kyverno" | ||
spec: | ||
releaseName: "kyverno" | ||
chart: | ||
spec: | ||
chart: "kyverno" | ||
version: "2.6.0" | ||
sourceRef: | ||
kind: "HelmRepository" | ||
name: "kyverno" | ||
interval: "1h" | ||
install: | ||
remediation: | ||
retries: 3 |
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: source.toolkit.fluxcd.io/v1 | ||
kind: HelmRepository | ||
metadata: | ||
name: kyverno | ||
spec: | ||
interval: 1h | ||
url: "https://kyverno.github.io/kyverno/" |
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,17 @@ | ||
--- | ||
apiVersion: "kustomize.config.k8s.io/v1beta1" | ||
kind: "Kustomization" | ||
namespace: "kyverno" | ||
resources: | ||
- "namespace.yaml" | ||
- "../../../apps/kyverno" | ||
components: | ||
- "../../../apps/kyverno/components/default-clusterpolicies" | ||
patches: | ||
- target: | ||
kind: ClusterPolicy | ||
name: restrict-virtual-service-domain | ||
patch: | | ||
- op: replace | ||
path: /spec/rules/0/validate/foreach/0/deny/conditions/any/0/value | ||
value: "*.pt.soeren.cloud" |
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,7 @@ | ||
--- | ||
kind: "Namespace" | ||
apiVersion: "v1" | ||
metadata: | ||
name: "kyverno" | ||
labels: | ||
name: "kyverno" |