-
Notifications
You must be signed in to change notification settings - Fork 52
/
sysctls.yaml
45 lines (45 loc) · 2.29 KB
/
sysctls.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright 2024 Google LLC
#
# This is “Software” that is licensed under the “General Software” section of
# the Service Specific Terms (https://cloud.google.com/terms/service-terms) for
# usage in accordance with the following “Scope of Use”: This file may only be
# used on an Anthos cluster, including any associated ci/cd use. “Anthos
# cluster” is defined as “A Cluster (of any kind) registered to a fleet project
# where the Anthos API is enabled”.
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sPSPForbiddenSysctls
metadata:
name: nist-sp-800-190-sysctls
labels:
policycontroller.gke.io/bundleName: nist-sp-800-190
annotations:
policycontroller.gke.io/bundleVersion: "202403.0"
policycontroller.gke.io/constraintData: |-
"{
bundleName: 'nist-sp-800-190',
bundleDisplayName: 'NIST SP 800-190',
bundleLink: 'https://cloud.google.com/anthos-config-management/docs/how-to/using-nist-sp-800-190',
bundleVersion: '202403.0',
bundleDescription: 'Use the NIST SP 800-190 policy bundle with Policy Controller to evaluate the compliance of your cluster resources against some aspects of the NIST SP 800-190 Appendix B controls.',
controlNumbers: '[CM-3,CM-7]',
severity: 'UNSPECIFIED',
description: 'Sysctls can disable security mechanisms or affect all containers on a host, and are restricted except for an allowed "safe" subset. A sysctl is safe if it is namespaced in the container or the Pod, and it is isolated from other Pods or processes on the same Node. https://kubernetes.io/docs/concepts/security/pod-security-standards/#baseline',
remediation: 'Containers can set only sysctls listed in the `allowedSysctls` field. Drop any unlisted sysctls from your containers: https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/',
minimumTemplateLibraryVersion: '1.14.1',
constraintHash: '26ed42ef11d98ca6e7cdfc3604f884510242d70039b1e71a66b3ec55f7fc44c6'
}"
spec:
enforcementAction: dryrun
match:
kinds:
- apiGroups:
- ""
kinds:
- Pod
parameters:
allowedSysctls:
- kernel.shm_rmid_forced
- net.ipv4.ip_local_port_range
- net.ipv4.ip_unprivileged_port_start
- net.ipv4.tcp_syncookies
- net.ipv4.ping_group_range