接口说明
VarmorPolicySpec / VarmorClusterPolicySpec
| 字段 | 子字段 | 子字段 | 描述 |
|---|---|---|---|
| target | kind string | - | 用于指定防护目标的 Workloads 类型。 可用值: Deployment, StatefulSet, DaemonSet, Pod。 |
| name string | - | 可选字段。用于指定防护目标的对象名称。 | |
| containers string array | - | 可选字段。用于指定防护目标的容器名,如果为空默认对 Workloads 中的所有容器开启沙箱防护。(不含 initContainers, ephemeralContainers) | |
| selector LabelSelector | - | 可选字段。用于根据标签选择器识别防护目标,并开启沙箱防护。 注意 selector 字段与 name 字段互斥,不能同时存在。 | |
| policy | enforcer string | - | 指定要使用的 LSM。 可用值: AppArmor, BPF, Seccomp, AppArmorBPF, AppArmorSeccomp, BPFSeccomp, AppArmorBPFSeccomp |
| mode string | - | 用于指定防护模式。 可用值:AlwaysAllow, RuntimeDefault, EnhanceProtect, BehaviorModeling, DefenseInDepth | |
| enhanceProtect | hardeningRules string array | 可选字段。用于指定要使用的内置加固规则。 | |
| attackProtectionRules AttackProtectionRules array | 可选字段。用于指定要使用的内置规则。 | ||
| vulMitigationRules string array | 可选字段。用于指定要使用的内置规则。 | ||
| appArmorRawRules AppArmorRawRules array | 可选字段。用于设置自定义的 AppArmor 规则。 | ||
| bpfRawRules BpfRawRules | 可选字段。用于支持用户设置自定义的 BPF 黑名单规则。 | ||
| syscallRawRules LinuxSyscall array | 可选字段。用于支持用户使用 Seccomp enforcer 设置自定义的 Syscall 黑名单规则。请参考 此文档 创建自定义规则。 | ||
| privileged bool | 可选字段。当对特权容器进行加固,请务必将此值设置为 true。若为 false,将在 RuntimeDefault 模式的基础上构造 AppArmor/BPF Profiles。若为 ture,则在 AlwaysAllow 模式的基础上构造 AppArmor/BPF Profiles。 注意:当为 true 时,vArmor 不会为目标构造 Seccomp Profiles。(默认值:false) | ||
| auditViolations bool | 可选字段。用于审计违反沙箱策略的行为。此特性当前支持 AppArmor 和 BPF enforcers,任何违反沙箱策 略的行为都会被记录到宿主机的 /var/log/varmor/violations.log 文件中。(默认值:false) | ||
| allowViolations bool | 可选字段。放行违反沙箱策略的行为。此特性当前支持 AppArmor 和 BPF enforcers,任何违反沙箱策略的行为都不会被拦截。(默认值:false) | ||
| modelingOptions | duration int | 动态建模的时间。(单位:分钟)[实验功能] | |
| updateExistingWorkloads bool | - | - | 可选字段。用于指定是否对符合条件的工作负载进行滚动更新,从而在 Policy 创建或删除时,对目标工作负载开启或关闭防护。(默认值:false) 注意:vArmor 只会对 Deployment、StatefulSet、DaemonSet 类型的工作负载进行滚动更新,如果 .spec.target.kind 为 Pod,需要您自行重建 Pod 来开启或关闭防护。 |
| PLACEHOLDER_PLACEHOLD |
AttackProtectionRules
| 字段 | 描述 |
|---|---|
| rules string array | 要使用的内置规则列表。 |
| targets string array | 可选字段。对指定可执行文件列表开启 rules 中的内置规则,可执行文件必须使用全路径。仅 AppArmor enforcer 支持此特性。 |
| PLACEHOLDER |