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
impl SecurityContextConstraints
Sourcepub fn create_security_context_constraints(
body: &SecurityContextConstraints,
optional: CreateOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<CreateResponse<Self>>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn delete_collection_security_context_constraints(
delete_optional: DeleteOptional<'_>,
list_optional: ListOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<DeleteResponse<List<Self>>>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn delete_security_context_constraints(
name: &str,
optional: DeleteOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<DeleteResponse<Self>>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn list_security_context_constraints(
optional: ListOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<ListResponse<Self>>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn patch_security_context_constraints(
name: &str,
body: &Patch,
optional: PatchOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<PatchResponse<Self>>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn read_security_context_constraints(
name: &str,
optional: ReadSecurityContextConstraintsOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<ReadSecurityContextConstraintsResponse>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn replace_security_context_constraints(
name: &str,
body: &SecurityContextConstraints,
optional: ReplaceOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<ReplaceResponse<Self>>), RequestError>
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
impl SecurityContextConstraints
Sourcepub fn watch_security_context_constraints(
optional: WatchOptional<'_>,
) -> Result<(Request<Vec<u8>>, fn(StatusCode) -> ResponseBody<WatchResponse<Self>>), RequestError>
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
impl Clone for SecurityContextConstraints
Source§fn clone(&self) -> SecurityContextConstraints
fn clone(&self) -> SecurityContextConstraints
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SecurityContextConstraints
impl Debug for SecurityContextConstraints
Source§impl Default for SecurityContextConstraints
impl Default for SecurityContextConstraints
Source§fn default() -> SecurityContextConstraints
fn default() -> SecurityContextConstraints
Source§impl<'de> Deserialize<'de> for SecurityContextConstraints
impl<'de> Deserialize<'de> for SecurityContextConstraints
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 Resource for SecurityContextConstraints
impl Resource for SecurityContextConstraints
Source§const API_VERSION: &'static str = "security.openshift.io/v1"
const API_VERSION: &'static str = "security.openshift.io/v1"
Resource::GROUP
and Resource::VERSION
(eg "apiextensions.k8s.io/v1beta1"
)
or just the version for resources without a group (eg "v1"
). Read more