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
{{ message }}
This repository was archived by the owner on Jun 26, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_access_to_cluster_resources/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ category: Control Plane Isolation
5
5
description: Tenants should not be able to view, edit, create, or delete cluster (non-namespaced) resources such Node, ClusterRole, ClusterRoleBinding, etc.
6
6
remediation:
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
rationale: Access controls should be configured for tenants so that a tenant cannot list, create, modify or delete cluster resources
9
10
audit: |
10
11
Run the following commands to retrieve the list of non-namespaced resources
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_add_capabilities/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a pod or container that adds new `capabilities` in its `securityContext`.
28
28
29
29
Define a `PodSecurityPolicy` with `allowedCapabilities` and map the policy to each tenant namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce new capabilities cannot be added. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_add_capabilities/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -6,4 +6,5 @@ description: Linux
6
6
remediation: Define a `PodSecurityPolicy` with `allowedCapabilities` and map the policy to each tenant namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce new capabilities cannot be added. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
rationale: Linux allows defining fine-grained permissions using capabilities. With Kubernetes, it is possible to add capabilities for pods that escalate the level of kernel access and allow other potentially dangerous behaviors.
8
8
profileLevel: 1
9
+
namespaceRequired: 1
9
10
audit: Create a pod or container that adds new `capabilities` in its `securityContext`. The pod creation must fail.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_multitenant_resources/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ category: Tenant Isolation
5
5
description: Each tenant namespace may contain resources setup by the cluster administrator for multi-tenancy, such as role bindings, and network policies. Tenants should not be allowed to modify the namespaced resources created by the cluster administrator for multi-tenancy. However, for some resources such as network policies, tenants can configure additional instances of the resource for their workloads.
6
6
remediation:
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
rationale: Tenants can escalate priviliges and impact other tenants if they are able to delete or modify required multi-tenancy resources such as namespace resource quotas or default network policy.
9
10
audit: |
10
11
The resources managed by the cluster administrator and that cannot be modified by tenant administrator can be identified by a label configured in the benchmarks configuration YAML file. If no label is provided, then this test looks for any existing network policy and role binding (resource quotas are handled by a separate test) and tries to modify and delete them. Run the following commands to retrieve the list of resources managed by the cluster administrator
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_ns_quota/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ category: Tenant Isolation
5
5
description: Tenants should not be able to modify the resource quotas defined in their namespaces
6
6
remediation:
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
rationale: Resource quotas must be configured for isolation and fairness between tenants. Tenants should not be able to modify existing resource quotas as they may exhaust cluster resources and impact other tenants.
9
10
audit: |
10
11
Run the following commands to check for permissions to manage quotas in the tenant namespace:
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_privilege_escalation/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a pod or container that sets `allowPrivilegeEscalation` to `true` in its
28
28
29
29
Define a `PodSecurityPolicy` with `allowPrivilegeEscalation` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to prevent privilege escalation. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_privilege_escalation/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,6 @@ category: Control Plane Isolation
5
5
description: The `securityContext.allowPrivilegeEscalation` setting allows a process to gain more privileges from its parent process. Processes in tenant containers should not be allowed to gain additional priviliges.
6
6
remediation: Define a `PodSecurityPolicy` with `allowPrivilegeEscalation` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to prevent privilege escalation. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
audit: Create a pod or container that sets `allowPrivilegeEscalation` to `true` in its `securityContext`. The pod creation must fail.
9
10
rationale: The `securityContext.allowPrivilegeEscalation` setting allows a process to gain more privileges from its parent process. Processes in tenant containers should not be allowed to gain additional priviliges.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_privileged_containers/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a pod or container that sets `privileged` to `true` in its `securityConte
28
28
29
29
Define a `PodSecurityPolicy` with `privileged` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to prevent tenants from running privileged containers. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_privileged_containers/config.yaml
+2-1
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,6 @@ category: Control Plane Isolation
5
5
rationale: By default a container is not allowed to access any devices on the host, but a “privileged” container can access all devices on the host. A process within a privileged container can also get unrestricted host access. Hence, tenants should not be allowed to run privileged containers.
6
6
remediation: Define a `PodSecurityPolicy` with `privileged` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to prevent tenants from running privileged containers. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
profileLevel: 1
8
-
description: Linux
8
+
description: Linux
9
+
namespaceRequired: 1
9
10
audit: Create a pod or container that sets `privileged` to `true` in its `securityContext`. The pod creation must fail.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_ipc/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a pod or container that sets new `hostIPC` to `true`. The pod creation mu
28
28
29
29
Define a `PodSecurityPolicy` with `hostIPC` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce that `hostPID` cannot be set to `true`. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_ipc/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,6 @@ category: Host Isolation
5
5
description: Tenants should not be allowed to share the host's inter-process communication (IPC) namespace.
6
6
remediation: Define a `PodSecurityPolicy` with `hostIPC` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce that `hostPID` cannot be set to `true`. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
audit: Create a pod or container that sets new `hostIPC` to `true`. The pod creation must fail.
9
10
rationale: The `hostIPC` setting allows pods to share the host's inter-process communication (IPC) namespace allowing potential access to host processes or processes belonging to other tenants.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_networking_and_ports/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ category: Host Isolation
5
5
description: Tenants should not be allowed to use host networking and host ports for their workloads.
6
6
remediation:
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
rationale: Using `hostPort` and `hostNetwork` allows tenants workloads to share the host networking stack allowing potential snooping of network traffic across application pods
9
10
audit: |
10
11
Create a pod defining a container using a host port. The pod creation must fail.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_path/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a pod defining a volume of type hostpath. The pod creation must fail.
28
28
29
29
Define a `PodSecurityPolicy` that restricts hostPath volumes and map the policy to each tenant namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce that a `hostPath` volume cannot be used. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_path/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,6 @@ category: Host Protection
5
5
description: Tenants should not be able to mount host volumes and directories
6
6
remediation: Define a `PodSecurityPolicy` that restricts hostPath volumes and map the policy to each tenant namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce that a `hostPath` volume cannot be used. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
rationale: The use of host volumes and directories can be used to access shared data or escalate priviliges and also creates a tight coupling between a tenant workload and a host.
9
10
audit: Create a pod defining a volume of type hostpath. The pod creation must fail.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_pid/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a pod or container that sets new `hostPID` to `true`. The pod creation mu
28
28
29
29
Define a `PodSecurityPolicy` with `hostPID` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce that `hostPID` cannot be set to `true`. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_host_pid/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,6 @@ category: Host Isolation
5
5
description: Tenants should not be allowed to share the host process ID (PID) namespace.
6
6
remediation: Define a `PodSecurityPolicy` with `hostPID` set to `false` and map the policy to each tenant's namespace, or use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to enforce that `hostPID` cannot be set to `true`. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
audit: Create a pod or container that sets new `hostPID` to `true`. The pod creation must fail.
9
10
rationale: The `hostPID` setting allows pods to share the host process ID namespace allowing potential privilege escalation. Tenant pods should not be allowed to share the host PID namespace.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_nodeport_services/README.md
+5
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,8 @@ Create a deployment and an associated service exposing a NodePort. The service c
28
28
29
29
Use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to block NodePort Services. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/block_use_of_nodeport_services/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,5 +5,6 @@ category: Host Isolation
5
5
description: Tenants should not be able to create services of type NodePort.
6
6
remediation: Use a policy engine such as [OPA/Gatekeeper](https://github.com/open-policy-agent/gatekeeper) or [Kyverno](https://kyverno.io) to block NodePort Services. You can use the policies present [here](https://github.com/kubernetes-sigs/multi-tenancy/tree/master/benchmarks/kubectl-mtb/test/policies).
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
audit: Create a deployment and an associated service exposing a NodePort. The service creation must fail.
9
10
rationale: NodePorts configure host ports that cannot be secured using Kubernetes network policies and require upstream firewalls. Also, multiple tenants cannot use the same host port numbers.
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/configure_ns_object_quota/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ category: Fairness
5
5
description: Namespace resource quotas should be used to allocate, track and limit the number of objects, of a particular type, that can be created within a namespace.
6
6
remediation: Create ResourceQuota object, you can use the configuration file present in `quotas` directory, example `kubectl apply -f test/quotas/ns_quota.yaml`
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
Rationale: Resource quotas must be configured for each tenant namespace, to guarantee fair number of objects across tenants.
9
10
Audit: |
10
11
Run the following command to show configured quotas. Make sure that a quota is configured for API objects(PersistentVolumeClaim, LoadBalancer, NodePort ,Pods etc).
Copy file name to clipboardExpand all lines: benchmarks/kubectl-mtb/test/benchmarks/configure_ns_quotas/config.yaml
+1
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ category: Fairness
5
5
description: Namespace resource quotas should be used to allocate, track, and limit a tenant's use of shared resources.
6
6
remediation: Create ResourceQuota object, you can use the configuration file present in `quotas` directory, example `kubectl apply -f test/quotas/ns_quota.yaml`
7
7
profileLevel: 1
8
+
namespaceRequired: 1
8
9
audit: |
9
10
Run the following command to show configured quotas. Make sure that a quota is configured for CPU, memory, and storage resources.
0 commit comments