pub struct ContainerSecurity {
pub profile: ContainerSecurityProfile,
pub run_as_user: Option<i64>,
pub run_as_group: Option<i64>,
pub read_only_root_filesystem: Option<bool>,
pub writable_paths: Vec<String>,
}Expand description
Container process identity and filesystem security.
Absent means no pod security settings are applied: the workload runs as
its image was built. Setting profile: restricted applies the restricted
profile (with the image’s own non-root user unless runAsUser is set).
On the wire every field a previous Operator requires is always written with
a concrete value (runAsUser/runAsGroup as 65532 and readOnlyRootFilesystem
as the profile’s default when unset) and profile is written as restricted
(the only value a previous release knows), so state and bundles written by
this version stay readable after an Operator rollback. The *Unset and
unrestricted markers, which previous releases ignore, record what was
really set, so reading restores the exact value and never treats a real 0
or false as unset. A previous Operator applies restricted to an opted-out
workload, so an image that needs root must not be rolled back to it.
Fields§
§profile: ContainerSecurityProfileRuntime security profile. unrestricted is the explicit opt-out.
run_as_user: Option<i64>Numeric UID for the container process. Defaults to the image’s user, which must not be root.
run_as_group: Option<i64>Numeric GID for the container process. Defaults to the image’s group.
read_only_root_filesystem: Option<bool>Mount the root filesystem read-only. Defaults to true under restricted.
writable_paths: Vec<String>Absolute paths backed by a writable emptyDir. /tmp is always writable.
Implementations§
Source§impl ContainerSecurity
impl ContainerSecurity
Sourcepub fn is_restricted(security: Option<&ContainerSecurity>) -> bool
pub fn is_restricted(security: Option<&ContainerSecurity>) -> bool
Whether a workload with this (possibly absent) setting runs restricted.
Absent is not restricted: only an explicit restricted profile is.
Trait Implementations§
Source§impl Clone for ContainerSecurity
impl Clone for ContainerSecurity
Source§impl Debug for ContainerSecurity
impl Debug for ContainerSecurity
Source§impl<'de> Deserialize<'de> for ContainerSecurity
impl<'de> Deserialize<'de> for ContainerSecurity
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>,
impl Eq for ContainerSecurity
Source§impl PartialEq for ContainerSecurity
impl PartialEq for ContainerSecurity
Source§impl Serialize for ContainerSecurity
impl Serialize for ContainerSecurity
impl StructuralPartialEq for ContainerSecurity
Auto Trait Implementations§
impl Forget for ContainerSecurity
impl Freeze for ContainerSecurity
impl Move for ContainerSecurity
impl RefUnwindSafe for ContainerSecurity
impl Send for ContainerSecurity
impl Sync for ContainerSecurity
impl Unpin for ContainerSecurity
impl UnsafeUnpin for ContainerSecurity
impl UnwindSafe for ContainerSecurity
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.