1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/samples
2020-06-26 18:28:52 -07:00
..
best_practices fixes #928 (#957) 2020-06-26 18:28:52 -07:00
more update documentation 2019-12-10 09:51:15 -08:00
AddDefaultNetworkPolicy.md 593 feature (#594) 2020-01-07 15:13:57 -08:00
AddNamespaceQuotas.md 593 feature (#594) 2020-01-07 15:13:57 -08:00
AddSafeToEvict.md update documentation 2019-12-10 09:51:15 -08:00
CheckUserGroup.md update documentation 2019-12-10 09:51:15 -08:00
DisallowBindMounts.md Merge pull request #584 from nirmata/371_omitempty 2020-01-02 11:17:31 -08:00
DisallowDefaultNamespace.md update doc 2020-03-04 17:40:33 -08:00
DisallowDockerSockMount.md update documentation 2019-12-10 09:51:15 -08:00
DisallowHelmTiller.md update api in samples/ 2019-11-13 13:56:20 -08:00
DisallowHostNetworkPort.md update documentation 2019-12-10 09:51:15 -08:00
DisallowHostPIDIPC.md update api in samples/ 2019-11-13 13:56:20 -08:00
DisallowLatestTag.md update documentation 2019-12-10 09:51:15 -08:00
DisallowNewCapabilities.md fixes #928 (#957) 2020-06-26 18:28:52 -07:00
DisallowPrivilegedContainers.md update markdown 2019-12-30 16:45:22 -08:00
DisallowRootUser.md update markdown 2019-12-30 16:45:22 -08:00
DisallowSysctls.md update api in samples/ 2019-11-13 13:56:20 -08:00
README.md update documentation 2019-12-10 09:51:15 -08:00
RequirePodProbes.md update api in samples/ 2019-11-13 13:56:20 -08:00
RequirePodRequestsLimits.md remove cpu limit in BP require_pod_requests_limits.yaml (#807) 2020-04-13 09:29:11 -07:00
RequireReadOnlyRootFS.md update api in samples/ 2019-11-13 13:56:20 -08:00
RestrictAutomountSAToken.md update documentation 2019-12-10 09:51:15 -08:00
RestrictImageRegistries.md update api in samples/ 2019-11-13 13:56:20 -08:00
RestrictIngressClasses.md update api in samples/ 2019-11-13 13:56:20 -08:00
RestrictNodePort.md update documentation 2019-12-10 09:51:15 -08:00

Sample Policies

Sample policies are designed to be applied to your Kubernetes clusters with minimal changes.

The policies are mostly validation rules in audit mode i.e. your existing workloads will not be impacted, but will be audited for policy complaince.

Best Practice Policies

These policies are highly recommended.

  1. Disallow root user
  2. Disallow privileged containers
  3. Disallow new capabilities
  4. Disallow kernel parameter changes
  5. Disallow use of bind mounts (hostPath volumes)
  6. Disallow docker socket bind mount
  7. Disallow hostNetwork and hostPort
  8. Disallow hostPID and hostIPC
  9. Disallow use of default namespace
  10. Disallow latest image tag
  11. Disallow Helm Tiller
  12. Require read-only root filesystem
  13. Require pod resource requests and limits
  14. Require pod livenessProbe and readinessProbe
  15. Add default network policy
  16. Add namespace quotas
  17. Add safe-to-evict for pods with emptyDir and hostPath volumes

Additional Policies

These policies provide additional best practices and are worthy of close consideration. These policies may require specific changes for your workloads and environments.

  1. Restrict image registries
  2. Restrict NodePort services
  3. Restrict auto-mount of service account credentials
  4. Restrict ingress classes
  5. Restrict User Group

Applying the sample policies

To apply these policies to your cluster, install Kyverno and import the policies as follows:

Install Kyverno

kubectl create -f https://github.com/nirmata/kyverno/raw/master/definitions/install.yaml

(installation docs)

Apply Kyverno Policies

To start applying policies to your cluster, first clone the repo:

git clone https://github.com/nirmata/kyverno.git
cd kyverno

Import best_practices from here:

kubectl create -f samples/best_practices

Import addition policies from here:

kubectl create -f samples/more/