pub struct LinuxContainerSecurityContext {Show 16 fields
pub capabilities: Option<Capability>,
pub privileged: bool,
pub namespace_options: Option<NamespaceOption>,
pub selinux_options: Option<SeLinuxOption>,
pub run_as_user: Option<Int64Value>,
pub run_as_group: Option<Int64Value>,
pub run_as_username: String,
pub readonly_rootfs: bool,
pub supplemental_groups: Vec<i64>,
pub no_new_privs: bool,
pub masked_paths: Vec<String>,
pub readonly_paths: Vec<String>,
pub seccomp: Option<SecurityProfile>,
pub apparmor: Option<SecurityProfile>,
pub apparmor_profile: String,
pub seccomp_profile_path: String,
}Expand description
LinuxContainerSecurityContext holds linux security configuration that will be applied to a container.
Fields§
§capabilities: Option<Capability>Capabilities to add or drop.
privileged: boolIf set, run container in privileged mode. Privileged mode is incompatible with the following options. If privileged is set, the following features MAY have no effect:
- capabilities
- selinux_options
- seccomp
- apparmor
Privileged mode implies the following specific options are applied:
- All capabilities are added.
- Sensitive paths, such as kernel module paths within sysfs, are not masked.
- Any sysfs and procfs mounts are mounted RW.
- AppArmor confinement is not applied.
- Seccomp restrictions are not applied.
- The device cgroup does not restrict access to any devices.
- All devices from the host’s /dev are available within the container.
- SELinux restrictions are not applied (e.g. label=disabled).
namespace_options: Option<NamespaceOption>Configurations for the container’s namespaces. Only used if the container uses namespace for isolation.
selinux_options: Option<SeLinuxOption>SELinux context to be optionally applied.
run_as_user: Option<Int64Value>UID to run the container process as. Only one of run_as_user and run_as_username can be specified at a time.
run_as_group: Option<Int64Value>GID to run the container process as. run_as_group should only be specified when run_as_user or run_as_username is specified; otherwise, the runtime MUST error.
run_as_username: StringUser name to run the container process as. If specified, the user MUST exist in the container image (i.e. in the /etc/passwd inside the image), and be resolved there by the runtime; otherwise, the runtime MUST error.
readonly_rootfs: boolIf set, the root filesystem of the container is read-only.
supplemental_groups: Vec<i64>List of groups applied to the first process run in the container, in addition to the container’s primary GID.
no_new_privs: boolno_new_privs defines if the flag for no_new_privs should be set on the container.
masked_paths: Vec<String>masked_paths is a slice of paths that should be masked by the container runtime, this can be passed directly to the OCI spec.
readonly_paths: Vec<String>readonly_paths is a slice of paths that should be set as readonly by the container runtime, this can be passed directly to the OCI spec.
seccomp: Option<SecurityProfile>Seccomp profile for the container.
apparmor: Option<SecurityProfile>AppArmor profile for the container.
apparmor_profile: StringAppArmor profile for the container, candidate values are:
- runtime/default: equivalent to not specifying a profile.
- unconfined: no profiles are loaded
- localhost/<profile_name>: profile loaded on the node (localhost) by name. The possible profile names are detailed at https://gitlab.com/apparmor/apparmor/-/wikis/AppArmor_Core_Policy_Reference
seccomp_profile_path: StringSeccomp profile for the container, candidate values are:
- runtime/default: the default profile for the container runtime
- unconfined: unconfined profile, ie, no seccomp sandboxing
- localhost/
: the profile installed on the node. is the full path of the profile. Default: “”, which is identical with unconfined.
Trait Implementations§
Source§impl Clone for LinuxContainerSecurityContext
impl Clone for LinuxContainerSecurityContext
Source§fn clone(&self) -> LinuxContainerSecurityContext
fn clone(&self) -> LinuxContainerSecurityContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de> Deserialize<'de> for LinuxContainerSecurityContext
impl<'de> Deserialize<'de> for LinuxContainerSecurityContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for LinuxContainerSecurityContext
impl Message for LinuxContainerSecurityContext
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for LinuxContainerSecurityContext
impl PartialEq for LinuxContainerSecurityContext
Source§fn eq(&self, other: &LinuxContainerSecurityContext) -> bool
fn eq(&self, other: &LinuxContainerSecurityContext) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LinuxContainerSecurityContext
Auto Trait Implementations§
impl Freeze for LinuxContainerSecurityContext
impl RefUnwindSafe for LinuxContainerSecurityContext
impl Send for LinuxContainerSecurityContext
impl Sync for LinuxContainerSecurityContext
impl Unpin for LinuxContainerSecurityContext
impl UnwindSafe for LinuxContainerSecurityContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request