Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kubewarden/go-wasi-context-aware-test-policy
A test context-aware policy written using Go Wasi
https://github.com/kubewarden/go-wasi-context-aware-test-policy
hacktoberfest kubernetes kubernetes-security kubewarden-policy policy-as-code webassembly
Last synced: 3 months ago
JSON representation
A test context-aware policy written using Go Wasi
- Host: GitHub
- URL: https://github.com/kubewarden/go-wasi-context-aware-test-policy
- Owner: kubewarden
- License: apache-2.0
- Created: 2024-01-12T11:23:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-07T17:23:30.000Z (3 months ago)
- Last Synced: 2024-08-07T23:33:34.281Z (3 months ago)
- Topics: hacktoberfest, kubernetes, kubernetes-security, kubewarden-policy, policy-as-code, webassembly
- Language: Go
- Homepage: https://kubewarden.io
- Size: 88.9 KB
- Stars: 1
- Watchers: 9
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Kubewarden Policy Repository](https://github.com/kubewarden/community/blob/main/badges/kubewarden-policies.svg)](https://github.com/kubewarden/community/blob/main/REPOSITORIES.md#policy-scope)
[![Stable](https://img.shields.io/badge/status-stable-brightgreen?style=for-the-badge)](https://github.com/kubewarden/community/blob/main/REPOSITORIES.md#stable)> **WARNING:** this is not the recommended way to write Kubewarden
> policies using Go. Please read [this](https://docs.kubewarden.io/writing-policies/wasi)
> section of the Kubewarden documentation for more information.This is the template of a plain WASI policy written using Go. The policy is
then compiled with the official Go compiler.
Moreover, this is a context aware policy. Meaning, it makes queries against the Kubernetes API server.This is a port of [this Rust policy](https://github.com/kubewarden/context-aware-test-policy).
## Description
This is a test policy used in the policy-evaluator integration tests.
Every time a deployment with the label `app.kubernetes.io/component: "api"` is created or updated it checks the following:- The Deployment must have a `customer-id` label set.
- The value of the `customer-id` label of the deployment must match the value of the `customer-id` namespace where the deployment has been created.
- A deployment with the label `app.kubernetes.io/component: database` must exist in the deployment namespace.
- A deployment with the label `app.kubernetes.io/component: frontend` must exist in the deployment namespace.
- A service named `api-auth-service` with the label `app.kubernetes.io/part-of: api` must exist in the deployment namespace.## Settings
This policy has no configurable settings.