public class OpenPolicyInfo extends AbstractModel
header, skipSign| Constructor and Description | 
|---|
| OpenPolicyInfo() | 
| OpenPolicyInfo(OpenPolicyInfo source)NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
       and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getConstraintYamlExample()Get 策略的实例的yaml示例base64编码 | 
| String | getEnabledStatus()Get 策略开关状态:open打开,close关闭 | 
| String | getEnforcementAction()Get 策略运行模式:dryrun空跑不生效,deny拦截生效 | 
| Long | getEventNums()Get 关联的事件数量(最近7d) | 
| String | getKind()Get 策略模板类型,支持的类型如下:
优选策略:
blocknamespacedeletion:存在pod的命名空间不允许删除
blockcrddeletion:存在cr的crd不允许删除
blockmountablevolumetype:禁止挂载指定的volume类型
disallowalwayspullimage:禁止镜像拉取策略使用Always
tkeallowedrepos:容器镜像来源限制
blockunknowndaemonset:禁止未知的DaemonSet部署
blockpvdeletion:PV处于绑定状态则不允许删除
corednsprotect:CoreDNS组件删除保护
blockschedulablenodedelete:非封锁状态的Node不允许删除
resourcesdeletionprotection:资源删除保护
tkeenirequest:弹性网卡资源配置限制
blockworkloadcrossversionupgrade:工作负载镜像版本升级策略管控
blockserviceaccountgranthighprivilegepermission:ServiceAccount权限管控
blockclusteripserviceexist:不允许Service为ClusterIP类型
blockinternetaccess:禁止公网访问
assign:禁止访问Metadata Server
blockhostnetworkpod:禁止创建HostNetwork类型Pod
可选策略:
blockvolumemountpath:禁止容器挂载指定的目录
k8sallowedrepos:容器镜像必须以指定字符串列表中的字符串开头
k8sblockendpointeditdefaultrole:禁止默认ClusterRole修改Endpoints
k8sblockloadbalancer:不允许Service为LoadBalancer类型
k8sblocknodeport:不允许Service为NodePort类型
k8sblockwildcardingress:禁止ingress配置空白或通配符类型的hostname
k8scontainerlimits:限制容器必须设置CPU和内存Limit
k8scontainerratios:限制CPU和内存的Request与Limit的最大比率
k8scontainerrequests:限制CPU和内存的Request必须设置且小于配置的最大值
k8srequiredresources:必须配置内存的Limit,CPU和内存的Request
k8sdisallowanonymous:不允许将白名单以外的ClusterRole和Role关联到system:anonymous User和system:unauthenticated Group
k8sdisallowedtags:约束容器镜像tag
k8sexternalips:限制服务externalIP仅为允许的IP地址列表
k8simagedigests:容器镜像必须包含digest
noupdateserviceaccount:拒绝白名单外的资源更新ServiceAccount
k8sreplicalimits:要求具有spec.replicas字段的对象(Deployments、ReplicaSets等)在定义的范围内
k8srequiredannotations:要求资源包含指定的annotations,其值与提供的正则表达式匹配
k8srequiredlabels:要求资源包含指定的标签,其值与提供的正则表达式匹配
k8srequiredprobes:要求Pod具有Readiness或Liveness Probe
k8spspautomountserviceaccounttokenpod:约束容器不能设置automountServiceAccountToken为true
k8spspallowprivilegeescalationcontainer:约束PodSecurityPolicy中的allowPrivilegeEscalation字段为false
k8spspapparmor:约束AppArmor字段列表
k8spspcapabilities:限制PodSecurityPolicy中的allowedCapabilities和requiredDropCapabilities字段
k8spspflexvolumes:约束PodSecurityPolicy中的allowedFlexVolumes字段类型
k8spspforbiddensysctls:约束PodSecurityPolicy中的sysctls字段不能使用的name
k8spspfsgroup:控制PodSecurityPolicy中的fsGroup字段在限制范围内
k8spsphostfilesystem:约束PodSecurityPolicy中的hostPath字段的参数
k8spsphostnamespace:限制PodSecurityPolicy中的hostPID和hostIPC字段
k8spsphostnetworkingports:约束PodSecurityPolicy中的hostNetwork和hostPorts字段
k8spspprivilegedcontainer:禁止PodSecurityPolicy中的privileged字段为true
k8spspprocmount:约束PodSecurityPolicy中的allowedProcMountTypes字段
k8spspreadonlyrootfilesystem:约束PodSecurityPolicy中的readOnlyRootFilesystem字段
k8spspseccomp:约束PodSecurityPolicy上的seccomp.security.alpha.kubernetes.io/allowedProfileNames注解
k8spspselinuxv2:约束Pod定义SELinux配置的允许列表
k8spspallowedusers:约束PodSecurityPolicy中的runAsUser、runAsGroup、supplementalGroups和fsGroup字段
k8spspvolumetypes:约束PodSecurityPolicy中的volumes字段类型 | 
| String | getName()Get 策略英文名称 | 
| OpenConstraintInfo[] | getOpenConstraintInfoList()Get 策略关联的实例列表
注意:此字段可能返回 null,表示取不到有效值。 | 
| String | getPolicyCategory()Get 策略分类:cluster集群策略、node节点策略、namespace命名空间策略、configuration配置相关策略、compute计算资源策略、storage存储资源策略、network网络资源策略 | 
| String | getPolicyDesc()Get 策略描述 | 
| String | getPolicyName()Get 策略中文名称 | 
| void | setConstraintYamlExample(String ConstraintYamlExample)Set 策略的实例的yaml示例base64编码 | 
| void | setEnabledStatus(String EnabledStatus)Set 策略开关状态:open打开,close关闭 | 
| void | setEnforcementAction(String EnforcementAction)Set 策略运行模式:dryrun空跑不生效,deny拦截生效 | 
| void | setEventNums(Long EventNums)Set 关联的事件数量(最近7d) | 
| void | setKind(String Kind)Set 策略模板类型,支持的类型如下:
优选策略:
blocknamespacedeletion:存在pod的命名空间不允许删除
blockcrddeletion:存在cr的crd不允许删除
blockmountablevolumetype:禁止挂载指定的volume类型
disallowalwayspullimage:禁止镜像拉取策略使用Always
tkeallowedrepos:容器镜像来源限制
blockunknowndaemonset:禁止未知的DaemonSet部署
blockpvdeletion:PV处于绑定状态则不允许删除
corednsprotect:CoreDNS组件删除保护
blockschedulablenodedelete:非封锁状态的Node不允许删除
resourcesdeletionprotection:资源删除保护
tkeenirequest:弹性网卡资源配置限制
blockworkloadcrossversionupgrade:工作负载镜像版本升级策略管控
blockserviceaccountgranthighprivilegepermission:ServiceAccount权限管控
blockclusteripserviceexist:不允许Service为ClusterIP类型
blockinternetaccess:禁止公网访问
assign:禁止访问Metadata Server
blockhostnetworkpod:禁止创建HostNetwork类型Pod
可选策略:
blockvolumemountpath:禁止容器挂载指定的目录
k8sallowedrepos:容器镜像必须以指定字符串列表中的字符串开头
k8sblockendpointeditdefaultrole:禁止默认ClusterRole修改Endpoints
k8sblockloadbalancer:不允许Service为LoadBalancer类型
k8sblocknodeport:不允许Service为NodePort类型
k8sblockwildcardingress:禁止ingress配置空白或通配符类型的hostname
k8scontainerlimits:限制容器必须设置CPU和内存Limit
k8scontainerratios:限制CPU和内存的Request与Limit的最大比率
k8scontainerrequests:限制CPU和内存的Request必须设置且小于配置的最大值
k8srequiredresources:必须配置内存的Limit,CPU和内存的Request
k8sdisallowanonymous:不允许将白名单以外的ClusterRole和Role关联到system:anonymous User和system:unauthenticated Group
k8sdisallowedtags:约束容器镜像tag
k8sexternalips:限制服务externalIP仅为允许的IP地址列表
k8simagedigests:容器镜像必须包含digest
noupdateserviceaccount:拒绝白名单外的资源更新ServiceAccount
k8sreplicalimits:要求具有spec.replicas字段的对象(Deployments、ReplicaSets等)在定义的范围内
k8srequiredannotations:要求资源包含指定的annotations,其值与提供的正则表达式匹配
k8srequiredlabels:要求资源包含指定的标签,其值与提供的正则表达式匹配
k8srequiredprobes:要求Pod具有Readiness或Liveness Probe
k8spspautomountserviceaccounttokenpod:约束容器不能设置automountServiceAccountToken为true
k8spspallowprivilegeescalationcontainer:约束PodSecurityPolicy中的allowPrivilegeEscalation字段为false
k8spspapparmor:约束AppArmor字段列表
k8spspcapabilities:限制PodSecurityPolicy中的allowedCapabilities和requiredDropCapabilities字段
k8spspflexvolumes:约束PodSecurityPolicy中的allowedFlexVolumes字段类型
k8spspforbiddensysctls:约束PodSecurityPolicy中的sysctls字段不能使用的name
k8spspfsgroup:控制PodSecurityPolicy中的fsGroup字段在限制范围内
k8spsphostfilesystem:约束PodSecurityPolicy中的hostPath字段的参数
k8spsphostnamespace:限制PodSecurityPolicy中的hostPID和hostIPC字段
k8spsphostnetworkingports:约束PodSecurityPolicy中的hostNetwork和hostPorts字段
k8spspprivilegedcontainer:禁止PodSecurityPolicy中的privileged字段为true
k8spspprocmount:约束PodSecurityPolicy中的allowedProcMountTypes字段
k8spspreadonlyrootfilesystem:约束PodSecurityPolicy中的readOnlyRootFilesystem字段
k8spspseccomp:约束PodSecurityPolicy上的seccomp.security.alpha.kubernetes.io/allowedProfileNames注解
k8spspselinuxv2:约束Pod定义SELinux配置的允许列表
k8spspallowedusers:约束PodSecurityPolicy中的runAsUser、runAsGroup、supplementalGroups和fsGroup字段
k8spspvolumetypes:约束PodSecurityPolicy中的volumes字段类型 | 
| void | setName(String Name)Set 策略英文名称 | 
| void | setOpenConstraintInfoList(OpenConstraintInfo[] OpenConstraintInfoList)Set 策略关联的实例列表
注意:此字段可能返回 null,表示取不到有效值。 | 
| void | setPolicyCategory(String PolicyCategory)Set 策略分类:cluster集群策略、node节点策略、namespace命名空间策略、configuration配置相关策略、compute计算资源策略、storage存储资源策略、network网络资源策略 | 
| void | setPolicyDesc(String PolicyDesc)Set 策略描述 | 
| void | setPolicyName(String PolicyName)Set 策略中文名称 | 
| void | toMap(HashMap<String,String> map,
     String prefix)Internal implementation, normal users should not use it. | 
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, isStream, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonStringpublic OpenPolicyInfo()
public OpenPolicyInfo(OpenPolicyInfo source)
public String getPolicyCategory()
public void setPolicyCategory(String PolicyCategory)
PolicyCategory - 策略分类:cluster集群策略、node节点策略、namespace命名空间策略、configuration配置相关策略、compute计算资源策略、storage存储资源策略、network网络资源策略public String getPolicyName()
public void setPolicyName(String PolicyName)
PolicyName - 策略中文名称public String getPolicyDesc()
public void setPolicyDesc(String PolicyDesc)
PolicyDesc - 策略描述public String getEnforcementAction()
public void setEnforcementAction(String EnforcementAction)
EnforcementAction - 策略运行模式:dryrun空跑不生效,deny拦截生效public Long getEventNums()
public void setEventNums(Long EventNums)
EventNums - 关联的事件数量(最近7d)public String getName()
public void setName(String Name)
Name - 策略英文名称public String getKind()
public void setKind(String Kind)
Kind - 策略模板类型,支持的类型如下:
优选策略:
blocknamespacedeletion:存在pod的命名空间不允许删除
blockcrddeletion:存在cr的crd不允许删除
blockmountablevolumetype:禁止挂载指定的volume类型
disallowalwayspullimage:禁止镜像拉取策略使用Always
tkeallowedrepos:容器镜像来源限制
blockunknowndaemonset:禁止未知的DaemonSet部署
blockpvdeletion:PV处于绑定状态则不允许删除
corednsprotect:CoreDNS组件删除保护
blockschedulablenodedelete:非封锁状态的Node不允许删除
resourcesdeletionprotection:资源删除保护
tkeenirequest:弹性网卡资源配置限制
blockworkloadcrossversionupgrade:工作负载镜像版本升级策略管控
blockserviceaccountgranthighprivilegepermission:ServiceAccount权限管控
blockclusteripserviceexist:不允许Service为ClusterIP类型
blockinternetaccess:禁止公网访问
assign:禁止访问Metadata Server
blockhostnetworkpod:禁止创建HostNetwork类型Pod
可选策略:
blockvolumemountpath:禁止容器挂载指定的目录
k8sallowedrepos:容器镜像必须以指定字符串列表中的字符串开头
k8sblockendpointeditdefaultrole:禁止默认ClusterRole修改Endpoints
k8sblockloadbalancer:不允许Service为LoadBalancer类型
k8sblocknodeport:不允许Service为NodePort类型
k8sblockwildcardingress:禁止ingress配置空白或通配符类型的hostname
k8scontainerlimits:限制容器必须设置CPU和内存Limit
k8scontainerratios:限制CPU和内存的Request与Limit的最大比率
k8scontainerrequests:限制CPU和内存的Request必须设置且小于配置的最大值
k8srequiredresources:必须配置内存的Limit,CPU和内存的Request
k8sdisallowanonymous:不允许将白名单以外的ClusterRole和Role关联到system:anonymous User和system:unauthenticated Group
k8sdisallowedtags:约束容器镜像tag
k8sexternalips:限制服务externalIP仅为允许的IP地址列表
k8simagedigests:容器镜像必须包含digest
noupdateserviceaccount:拒绝白名单外的资源更新ServiceAccount
k8sreplicalimits:要求具有spec.replicas字段的对象(Deployments、ReplicaSets等)在定义的范围内
k8srequiredannotations:要求资源包含指定的annotations,其值与提供的正则表达式匹配
k8srequiredlabels:要求资源包含指定的标签,其值与提供的正则表达式匹配
k8srequiredprobes:要求Pod具有Readiness或Liveness Probe
k8spspautomountserviceaccounttokenpod:约束容器不能设置automountServiceAccountToken为true
k8spspallowprivilegeescalationcontainer:约束PodSecurityPolicy中的allowPrivilegeEscalation字段为false
k8spspapparmor:约束AppArmor字段列表
k8spspcapabilities:限制PodSecurityPolicy中的allowedCapabilities和requiredDropCapabilities字段
k8spspflexvolumes:约束PodSecurityPolicy中的allowedFlexVolumes字段类型
k8spspforbiddensysctls:约束PodSecurityPolicy中的sysctls字段不能使用的name
k8spspfsgroup:控制PodSecurityPolicy中的fsGroup字段在限制范围内
k8spsphostfilesystem:约束PodSecurityPolicy中的hostPath字段的参数
k8spsphostnamespace:限制PodSecurityPolicy中的hostPID和hostIPC字段
k8spsphostnetworkingports:约束PodSecurityPolicy中的hostNetwork和hostPorts字段
k8spspprivilegedcontainer:禁止PodSecurityPolicy中的privileged字段为true
k8spspprocmount:约束PodSecurityPolicy中的allowedProcMountTypes字段
k8spspreadonlyrootfilesystem:约束PodSecurityPolicy中的readOnlyRootFilesystem字段
k8spspseccomp:约束PodSecurityPolicy上的seccomp.security.alpha.kubernetes.io/allowedProfileNames注解
k8spspselinuxv2:约束Pod定义SELinux配置的允许列表
k8spspallowedusers:约束PodSecurityPolicy中的runAsUser、runAsGroup、supplementalGroups和fsGroup字段
k8spspvolumetypes:约束PodSecurityPolicy中的volumes字段类型public String getEnabledStatus()
public void setEnabledStatus(String EnabledStatus)
EnabledStatus - 策略开关状态:open打开,close关闭public String getConstraintYamlExample()
public void setConstraintYamlExample(String ConstraintYamlExample)
ConstraintYamlExample - 策略的实例的yaml示例base64编码public OpenConstraintInfo[] getOpenConstraintInfoList()
public void setOpenConstraintInfoList(OpenConstraintInfo[] OpenConstraintInfoList)
OpenConstraintInfoList - 策略关联的实例列表
注意:此字段可能返回 null,表示取不到有效值。Copyright © 2025. All rights reserved.