检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
["Service"] excludedNamespaces: - "ingress-nginx-private" - "ingress-nginx-public" 符合策略实例的资源定义 Servie类型非LoadBalancer,符合策略实例。 apiVersion:
kinds: ["Pod"] parameters: cpu: "200m" memory: "1Gi" 符合策略实例的资源定义 CPU和内存的Request小于配置的最大值,符合策略实例。 apiVersion: v1 kind: Pod metadata:
k8scontainerlimits 基本信息 策略类型:合规 推荐级别:L1 生效资源类型:Pod 参数: cpu:字符串 memory:字符串 exemptImages:字符串数组 作用 限制容器必须设置CPU和内存Limit,并且小于设定的最大值。 策略实例示例 示例展示了
k8scontainerratios 基本信息 策略类型:合规 推荐级别:L1 生效资源类型:Pod 参数: ratio:字符串 cpuRatio:字符串 exemptImages:字符串数组 作用 限制容器的limit对request比例的最大值。 策略实例示例 限制容器的li
nginx 不符合策略实例的资源定义 示例中的container.seccomp.security.alpha.kubernetes.io/nginx注解的value没在设定的值列表中,不符合策略定义。 apiVersion: v1 kind: Pod metadata: name:
k8sallowedrepos 基本信息 策略类型:合规 推荐级别:L1 生效资源类型:Pod 参数: repos:字符串数组 作用 容器镜像必须以指定字符串列表中的字符串开头。 策略实例示例 以下策略实例定义容器镜像必须以“openpolicyagent/”开头。 apiVersion:
authorization.k8s.io"] kinds: ["RoleBinding"] parameters: allowedRoles: - cluster-role-1 符合策略实例的资源定义 ClusterRole关联到cluster-role-1
k8sdisallowedtags 基本信息 策略类型:合规 推荐级别:L1 生效资源类型:Pod 参数: tags:字符串数组 exemptImages:字符串数组 作用 约束容器镜像tag。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中表示不允许容器镜像tag为latest。
kind: K8sBlockNodePort metadata: name: block-node-port spec: match: kinds: - apiGroups: [""] kinds: ["Service"] 符合策略实例的资源定义
min: 整型 max: 整型 作用 约束PodSecurityPolicy中的runAsUser、runAsGroup、supplementalGroups和fsGroup字段。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中定义了对runA
约束Pod定义SELinux配置的允许列表。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中的allowedSELinuxOptions定义了参数的允许列表。 apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPSELinuxV2
k8spspreadonlyrootfilesystem 基本信息 策略类型:安全 推荐级别:L3 生效资源类型:Pod 参数: exemptImages:字符串数组 作用 约束PodSecurityPolicy中的“readOnlyRootFilesystem”字段。 策略实例示例
authorization.k8s.io"] kinds: ["ClusterRole"] 符合策略实例的资源定义 示例中ClusterRole的生效对象中没有endpoints,符合策略实例。 apiVersion: rbac.authorization.k8s.io/v1 kind:
k8spspprocmount 基本信息 策略类型:安全 推荐级别:L3 生效资源类型:Pod 参数: exemptImages:字符串数组 procMount:字符串 作用 约束PodSecurityPolicy中的“allowedProcMountTypes”字段。 策略实例示例
en-pod spec: match: kinds: - apiGroups: [""] kinds: ["Pod"] excludedNamespaces: ["kube-system"] 符合策略实例的资源定义 Pod的auto
k8spspallowprivilegeescalationcontainer 基本信息 策略类型:安全 推荐级别:L3 生效资源类型:Pod 参数: exemptImages:字符串数组 作用 约束PodSecurityPolicy中的“allowPrivilegeEscalation”字段为false。
k8sexternalips 基本信息 策略类型:合规 推荐级别:L1 生效资源类型:Service 参数: allowedIPs:字符串数组 作用 限制服务externalIP仅为允许的IP地址列表。 策略实例示例 服务的externalIP仅允许allowedIPs中定义的IP。
kinds: ["Pod"] parameters: allowedProfiles: - runtime/default 符合策略实例的资源定义 示例中apparmor的值在上述定义的允许范围内,符合策略实例。 apiVersion: v1 kind: Pod metadata:
th”字段的参数。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,parameters中的allowedHostPaths指定了字段的值。 apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPHostFilesystem
k8spspvolumetypes 基本信息 策略类型:安全 推荐级别:L3 生效资源类型:Pod 参数: volumes:数组 作用 约束PodSecurityPolicy中的“volumes”字段类型。 策略实例示例 以下策略实例展示了策略定义生效的资源类型,paramete