LinuxSecurityContext

class oci.container_instances.models.LinuxSecurityContext(**kwargs)

Bases: oci.container_instances.models.security_context.SecurityContext

Security context for Linux container.

Attributes

SECURITY_CONTEXT_TYPE_LINUX str(object=’’) -> str
capabilities Gets the capabilities of this LinuxSecurityContext.
is_non_root_user_check_enabled Gets the is_non_root_user_check_enabled of this LinuxSecurityContext.
is_root_file_system_readonly Gets the is_root_file_system_readonly of this LinuxSecurityContext.
run_as_group Gets the run_as_group of this LinuxSecurityContext.
run_as_user Gets the run_as_user of this LinuxSecurityContext.
security_context_type Gets the security_context_type of this SecurityContext.

Methods

__init__(**kwargs) Initializes a new LinuxSecurityContext object with values from keyword arguments.
get_subtype(object_dictionary) Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
SECURITY_CONTEXT_TYPE_LINUX = 'LINUX'
__init__(**kwargs)

Initializes a new LinuxSecurityContext object with values from keyword arguments. The default value of the security_context_type attribute of this class is LINUX and it should not be changed. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • security_context_type (str) – The value to assign to the security_context_type property of this LinuxSecurityContext. Allowed values for this property are: “LINUX”
  • run_as_user (int) – The value to assign to the run_as_user property of this LinuxSecurityContext.
  • run_as_group (int) – The value to assign to the run_as_group property of this LinuxSecurityContext.
  • is_non_root_user_check_enabled (bool) – The value to assign to the is_non_root_user_check_enabled property of this LinuxSecurityContext.
  • is_root_file_system_readonly (bool) – The value to assign to the is_root_file_system_readonly property of this LinuxSecurityContext.
  • capabilities (oci.container_instances.models.ContainerCapabilities) – The value to assign to the capabilities property of this LinuxSecurityContext.
capabilities

Gets the capabilities of this LinuxSecurityContext.

Returns:The capabilities of this LinuxSecurityContext.
Return type:oci.container_instances.models.ContainerCapabilities
static get_subtype(object_dictionary)

Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.

is_non_root_user_check_enabled

Gets the is_non_root_user_check_enabled of this LinuxSecurityContext. Indicates if the container must run as a non-root user. If true, the service validates the container image at runtime to ensure that it is not going to run with UID 0 (root) and fails the container instance creation if the validation fails.

Returns:The is_non_root_user_check_enabled of this LinuxSecurityContext.
Return type:bool
is_root_file_system_readonly

Gets the is_root_file_system_readonly of this LinuxSecurityContext. Determines if the container will have a read-only root file system. Default value is false.

Returns:The is_root_file_system_readonly of this LinuxSecurityContext.
Return type:bool
run_as_group

Gets the run_as_group of this LinuxSecurityContext. The group ID (GID) to run the entrypoint process of the container. Uses runtime default if not provided.

Returns:The run_as_group of this LinuxSecurityContext.
Return type:int
run_as_user

Gets the run_as_user of this LinuxSecurityContext. The user ID (UID) to run the entrypoint process of the container. Defaults to user specified UID in container image metadata if not provided. This must be provided if runAsGroup is provided.

Returns:The run_as_user of this LinuxSecurityContext.
Return type:int
security_context_type

Gets the security_context_type of this SecurityContext. The type of security context

Allowed values for this property are: “LINUX”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.

Returns:The security_context_type of this SecurityContext.
Return type:str