You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repo contains the company policy that has been codified into [kyverno](https://kyverno.io/) and [checkov](https://www.checkov.io/) policies.
4
+
5
+
## Usage
6
+
7
+
See [app1](https://github.com/example-policy-org/app1),
8
+
[app2](https://github.com/example-policy-org/app2) and
9
+
[app3](https://github.com/example-policy-org/app3) for kubernetes implementations; and [infra1](https://github.com/example-policy-org/infra1),
10
+
[infra2](https://github.com/example-policy-org/infra2) and
11
+
[infra3](https://github.com/example-policy-org/infra3) for terraform implementations.
12
+
13
+
## Development
14
+
15
+
### Kubernetes policies
16
+
17
+
These are kept in [kubernetes/kyverno](./kubernetes/kyverno) and can be added to by creating a new directory, and referencing this in the [kustomization.yaml](./kubernetes/kyverno/kustomization.yaml). It is important that test cases are created and a test.yaml accompanies the policy.yaml following the [documentation of developing kyverno policy](https://kyverno.io/docs/kyverno-cli/#test).
18
+
19
+
If you want to inherit an external policy for example from the kyverno policy library you can add the reference in the [kustomization.yaml](./kubernetes/kyverno/kustomization.yaml). If doing this, it is important for the stability of the policy to reference an immutable reference such as a git-sha to ensure that the implementations of policy checking based on this repo are deterministic and repeatable.
20
+
21
+
Testing can be accomplished with:
22
+
```bash
23
+
$ kyverno test.
24
+
```
25
+
26
+
### Terraform IaaC policies
27
+
28
+
Similar to the [Kubernetes policies](#kubernetes-policies) these are in [infra/checkov](./infra/checkov/) and can be added to by creating a new directory. [checkov](https://checkov.io) doesn't yet have a formalised testing pattern for policy. So a [BATS](https://github.com/bats-core/bats-core) testing framework has been implemented. Policy can be written either as [python](https://www.checkov.io/3.Custom%20Policies/Python%20Custom%20Policies.html) or [yaml](https://www.checkov.io/3.Custom%20Policies/YAML%20Custom%20Policies.html).
29
+
30
+
If you want to inherit an external policy for example one of the checks built in to checkov you can add to the checks in the [checkov config](./infra/checkov/config.yaml).
31
+
32
+
If doing this, it is important for the stability of the policy to reference specific checks and an immutable reference where available such as a git-sha to ensure that the implementations of policy checking based on this repo are deterministic and repeatable.
33
+
34
+
Testing can be accomplished with:
35
+
```bash
36
+
$ bats infra/checkov/test.bats
37
+
```
38
+
39
+
40
+
---
41
+
42
+
See the [What is Policy As [versioned] Code? blog post](https://www.appvia.io/blog/policy-as-versioned-code) and the github [organisation's .github repo](https://github.com/example-policy-org/.github) to better understand how the repositories connect together.
0 commit comments