-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from utilitywarehouse/as-kyverno-canary
add kyverno canary policy and resource for alert
- Loading branch information
Showing
8 changed files
with
79 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kyverno-canary-resource |
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,24 @@ | ||
apiVersion: kyverno.io/v1 | ||
kind: ClusterPolicy | ||
metadata: | ||
name: canary-resources | ||
annotations: | ||
policies.kyverno.io/title: Canary rule to detect canary resources | ||
policies.kyverno.io/category: Canary | ||
policies.kyverno.io/description: >- | ||
This is the canary rule which detects canary resources in the cluster. | ||
This is to alert on stopped or missing background scan report alerts. | ||
spec: | ||
validationFailureAction: Audit | ||
background: true | ||
rules: | ||
- name: detect-canary-configmap | ||
match: | ||
resources: | ||
kinds: | ||
- ConfigMap | ||
names: | ||
- kyverno-canary-resource | ||
validate: | ||
message: "Found kyverno canary configMap in the cluster" | ||
deny: {} |
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,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- canary.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,24 @@ | ||
name: test-canary-rules | ||
policies: | ||
- ../canary.yaml | ||
resources: | ||
- test-canary.yaml | ||
variables: values.yaml | ||
results: | ||
- policy: canary-resources | ||
rule: detect-canary-configmap | ||
kind: ConfigMap | ||
resource: kyverno-canary-resource | ||
result: fail | ||
|
||
- policy: canary-resources | ||
rule: detect-canary-configmap | ||
kind: ConfigMap | ||
resource: argocd-cmd-params-cm | ||
result: skip | ||
|
||
- policy: canary-resources | ||
rule: detect-canary-configmap | ||
kind: ServiceAccount | ||
resource: kyverno-canary-resource | ||
result: skip |
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,16 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kyverno-canary-resource | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: argocd-cmd-params-cm | ||
data: | ||
application.namespaces: "*" | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kyverno-canary-resource |
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,4 @@ | ||
apiVersion: cli.kyverno.io/v1alpha1 | ||
kind: Values | ||
globalValues: | ||
request.operation: UPDATE |
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