Struct SecurityContextConstraints

Source
pub struct SecurityContextConstraints {
Show 25 fields pub allow_host_dir_volume_plugin: bool, pub allow_host_ipc: bool, pub allow_host_network: bool, pub allow_host_pid: bool, pub allow_host_ports: bool, pub allow_privilege_escalation: Option<bool>, pub allow_privileged_container: bool, pub allowed_capabilities: Vec<String>, pub allowed_flex_volumes: Option<Vec<AllowedFlexVolume>>, pub allowed_unsafe_sysctls: Option<Vec<String>>, pub default_add_capabilities: Vec<String>, pub default_allow_privilege_escalation: Option<bool>, pub forbidden_sysctls: Option<Vec<String>>, pub fs_group: Option<FSGroupStrategyOptions>, pub groups: Option<Vec<String>>, pub metadata: ObjectMeta, pub priority: i32, pub read_only_root_filesystem: bool, pub required_drop_capabilities: Vec<String>, pub run_as_user: Option<RunAsUserStrategyOptions>, pub se_linux_context: Option<SELinuxContextStrategyOptions>, pub seccomp_profiles: Option<Vec<String>>, pub supplemental_groups: Option<SupplementalGroupsStrategyOptions>, pub users: Option<Vec<String>>, pub volumes: Vec<String>,
}
Expand description

SecurityContextConstraints governs the ability to make requests that affect the SecurityContext that will be applied to a container. For historical reasons SCC was exposed under the core Kubernetes API group. That exposure is deprecated and will be removed in a future release - users should instead use the security.openshift.io group to manage SecurityContextConstraints.

Fields§

§allow_host_dir_volume_plugin: bool

AllowHostDirVolumePlugin determines if the policy allow containers to use the HostDir volume plugin

§allow_host_ipc: bool

AllowHostIPC determines if the policy allows host ipc in the containers.

§allow_host_network: bool

AllowHostNetwork determines if the policy allows the use of HostNetwork in the pod spec.

§allow_host_pid: bool

AllowHostPID determines if the policy allows host pid in the containers.

§allow_host_ports: bool

AllowHostPorts determines if the policy allows host ports in the containers.

§allow_privilege_escalation: Option<bool>

AllowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.

§allow_privileged_container: bool

AllowPrivilegedContainer determines if a container can request to be run as privileged.

§allowed_capabilities: Vec<String>

AllowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field maybe added at the pod author’s discretion. You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. To allow all capabilities you may use ‘*’.

§allowed_flex_volumes: Option<Vec<AllowedFlexVolume>>

AllowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the “Volumes” field.

§allowed_unsafe_sysctls: Option<Vec<String>>

AllowedUnsafeSysctls is a list of explicitly allowed unsafe sysctls, defaults to none. Each entry is either a plain sysctl name or ends in “*” in which case it is considered as a prefix of allowed sysctls. Single * means all unsafe sysctls are allowed. Kubelet has to whitelist all allowed unsafe sysctls explicitly to avoid rejection.

Examples: e.g. “foo/” allows “foo/bar”, “foo/baz”, etc. e.g. “foo.” allows “foo.bar”, “foo.baz”, etc.

§default_add_capabilities: Vec<String>

DefaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capabiility in both DefaultAddCapabilities and RequiredDropCapabilities.

§default_allow_privilege_escalation: Option<bool>

DefaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.

§forbidden_sysctls: Option<Vec<String>>

ForbiddenSysctls is a list of explicitly forbidden sysctls, defaults to none. Each entry is either a plain sysctl name or ends in “*” in which case it is considered as a prefix of forbidden sysctls. Single * means all sysctls are forbidden.

Examples: e.g. “foo/” forbids “foo/bar”, “foo/baz”, etc. e.g. “foo.” forbids “foo.bar”, “foo.baz”, etc.

§fs_group: Option<FSGroupStrategyOptions>

FSGroup is the strategy that will dictate what fs group is used by the SecurityContext.

§groups: Option<Vec<String>>

The groups that have permission to use this security context constraints

§metadata: ObjectMeta

Standard object’s metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata

§priority: i32

Priority influences the sort order of SCCs when evaluating which SCCs to try first for a given pod request based on access in the Users and Groups fields. The higher the int, the higher priority. An unset value is considered a 0 priority. If scores for multiple SCCs are equal they will be sorted from most restrictive to least restrictive. If both priorities and restrictions are equal the SCCs will be sorted by name.

§read_only_root_filesystem: bool

ReadOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the SCC should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.

§required_drop_capabilities: Vec<String>

RequiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.

§run_as_user: Option<RunAsUserStrategyOptions>

RunAsUser is the strategy that will dictate what RunAsUser is used in the SecurityContext.

§se_linux_context: Option<SELinuxContextStrategyOptions>

SELinuxContext is the strategy that will dictate what labels will be set in the SecurityContext.

§seccomp_profiles: Option<Vec<String>>

SeccompProfiles lists the allowed profiles that may be set for the pod or container’s seccomp annotations. An unset (nil) or empty value means that no profiles may be specifid by the pod or container. The wildcard ‘*’ may be used to allow all profiles. When used to generate a value for a pod the first non-wildcard profile will be used as the default.

§supplemental_groups: Option<SupplementalGroupsStrategyOptions>

SupplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.

§users: Option<Vec<String>>

The users who have permissions to use this security context constraints

§volumes: Vec<String>

Volumes is a white list of allowed volume plugins. FSType corresponds directly with the field names of a VolumeSource (azureFile, configMap, emptyDir). To allow all volumes you may use “*”. To allow no volumes, set to [“none”].

Implementations§

Source§

impl SecurityContextConstraints

Source

pub fn create_security_context_constraints( body: &SecurityContextConstraints, optional: CreateOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<CreateResponse<Self>>), RequestError>

create SecurityContextConstraints

Use the returned k8s_openapi::ResponseBody<k8s_openapi::CreateResponse<Self>> constructor, or k8s_openapi::CreateResponse<Self> directly, to parse the HTTP response.

§Arguments
  • body

  • optional

    Optional parameters. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn delete_collection_security_context_constraints( delete_optional: DeleteOptional<'_>, list_optional: ListOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<DeleteResponse<List<Self>>>), RequestError>

delete collection of SecurityContextConstraints

Use the returned k8s_openapi::ResponseBody<k8s_openapi::DeleteResponse<k8s_openapi::List<Self>>> constructor, or k8s_openapi::DeleteResponse<k8s_openapi::List<Self>> directly, to parse the HTTP response.

§Arguments
  • delete_optional

    Delete options. Use Default::default() to not pass any.

  • list_optional

    List options. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn delete_security_context_constraints( name: &str, optional: DeleteOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<DeleteResponse<Self>>), RequestError>

delete SecurityContextConstraints

Use the returned k8s_openapi::ResponseBody<k8s_openapi::DeleteResponse<Self>> constructor, or k8s_openapi::DeleteResponse<Self> directly, to parse the HTTP response.

§Arguments
  • name

    name of the SecurityContextConstraints

  • optional

    Optional parameters. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn list_security_context_constraints( optional: ListOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<ListResponse<Self>>), RequestError>

list or watch objects of kind SecurityContextConstraints

This operation only supports listing all items of this type.

Use the returned k8s_openapi::ResponseBody<k8s_openapi::ListResponse<Self>> constructor, or k8s_openapi::ListResponse<Self> directly, to parse the HTTP response.

§Arguments
  • optional

    Optional parameters. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn patch_security_context_constraints( name: &str, body: &Patch, optional: PatchOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<PatchResponse<Self>>), RequestError>

partially update the specified SecurityContextConstraints

Use the returned k8s_openapi::ResponseBody<k8s_openapi::PatchResponse<Self>> constructor, or k8s_openapi::PatchResponse<Self> directly, to parse the HTTP response.

§Arguments
  • name

    name of the SecurityContextConstraints

  • body

  • optional

    Optional parameters. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn read_security_context_constraints( name: &str, optional: ReadSecurityContextConstraintsOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<ReadSecurityContextConstraintsResponse>), RequestError>

read the specified SecurityContextConstraints

Use the returned k8s_openapi::ResponseBody<ReadSecurityContextConstraintsResponse> constructor, or ReadSecurityContextConstraintsResponse directly, to parse the HTTP response.

§Arguments
  • name

    name of the SecurityContextConstraints

  • optional

    Optional parameters. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn replace_security_context_constraints( name: &str, body: &SecurityContextConstraints, optional: ReplaceOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<ReplaceResponse<Self>>), RequestError>

replace the specified SecurityContextConstraints

Use the returned k8s_openapi::ResponseBody<k8s_openapi::ReplaceResponse<Self>> constructor, or k8s_openapi::ReplaceResponse<Self> directly, to parse the HTTP response.

§Arguments
  • name

    name of the SecurityContextConstraints

  • body

  • optional

    Optional parameters. Use Default::default() to not pass any.

Source§

impl SecurityContextConstraints

Source

pub fn watch_security_context_constraints( optional: WatchOptional<'_>, ) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<WatchResponse<Self>>), RequestError>

list or watch objects of kind SecurityContextConstraints

This operation only supports watching one item, or a list of items, of this type for changes.

Use the returned k8s_openapi::ResponseBody<k8s_openapi::WatchResponse<Self>> constructor, or k8s_openapi::WatchResponse<Self> directly, to parse the HTTP response.

§Arguments
  • optional

    Optional parameters. Use Default::default() to not pass any.

Trait Implementations§

Source§

impl Clone for SecurityContextConstraints

Source§

fn clone(&self) -> SecurityContextConstraints

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SecurityContextConstraints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SecurityContextConstraints

Source§

fn default() -> SecurityContextConstraints

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SecurityContextConstraints

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl ListableResource for SecurityContextConstraints

Source§

const LIST_KIND: &'static str = "SecurityContextConstraintsList"

The kind of the list type of the resource. Read more
Source§

impl Metadata for SecurityContextConstraints

Source§

type Ty = ObjectMeta

The type of the metadata object.
Source§

fn metadata(&self) -> &<Self as Metadata>::Ty

Gets a reference to the metadata of this resource value.
Source§

fn metadata_mut(&mut self) -> &mut <Self as Metadata>::Ty

Gets a mutable reference to the metadata of this resource value.
Source§

impl PartialEq for SecurityContextConstraints

Source§

fn eq(&self, other: &SecurityContextConstraints) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Resource for SecurityContextConstraints

Source§

const API_VERSION: &'static str = "security.openshift.io/v1"

The API version of the resource. This is a composite of Resource::GROUP and Resource::VERSION (eg "apiextensions.k8s.io/v1beta1") or just the version for resources without a group (eg "v1"). Read more
Source§

const GROUP: &'static str = "security.openshift.io"

The group of the resource, or the empty string if the resource doesn’t have a group.
Source§

const KIND: &'static str = "SecurityContextConstraints"

The kind of the resource. Read more
Source§

const VERSION: &'static str = "v1"

The version of the resource.
Source§

impl Serialize for SecurityContextConstraints

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SecurityContextConstraints

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,