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

Document validating intents using Kyverno #220

Merged
merged 2 commits into from
Apr 7, 2024
Merged
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
43 changes: 43 additions & 0 deletions docs/reference/validating-clientintents/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
sidebar_position: 9
title: Validating ClientIntents
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Otterize's `ClientIntent` CRDs can be validated using [Kyverno](https://kyverno.io/#td-block-1).
Kyverno is a policy engine designed for Kubernetes
Kyverno policies can validate, mutate, generate, and cleanup Kubernetes resources, and verify image signatures and artifacts to help secure the software supply chain.

To install and setup Kyverno, follow the instructions in the [Kyverno documentation](https://kyverno.io/docs/installation/).

The following are some example Kyverno policies that can be used to validate `ClientIntent` CRDs:
amitlicht marked this conversation as resolved.
Show resolved Hide resolved

* Validate that `ClientIntents` CRDs do not have any AWS `s3:DeleteAction` operations:
```yaml
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: validate-clientintents
spec:
validationFailureAction: Enforce
rules:
- name: deny-s3-deleteobject
match:
any:
- resources:
kinds:
- k8s.otterize.com/v1alpha3/ClientIntents
validate:
message: "s3:DeleteObject is not allowed"
foreach:
- list: request.object.spec.calls[]
foreach:
- list: "element.awsActions"
deny:
conditions:
all:
- key: "{{element}}"
operator: Equals
value: "s3:DeleteAction"
```
Loading