Class ContainerSecurityConfig
java.lang.Object
io.github.alersrt.pod4j.openapi.model.ContainerSecurityConfig
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2024-11-29T01:29:49.168634544+07:00[Asia/Barnaul]",
comments="Generator version: 7.7.0")
public class ContainerSecurityConfig
extends Object
ContainerSecurityConfig is a container's security features, including SELinux, Apparmor, and Seccomp.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCapAddItem(String capAddItem) addCapDropItem(String capDropItem) addGroupsItem(String groupsItem) addMaskItem(String maskItem) addProcfsOptsItem(String procfsOptsItem) addSelinuxOptsItem(String selinuxOptsItem) addUnmaskItem(String unmaskItem) apparmorProfile(String apparmorProfile) booleanstatic ContainerSecurityConfigCreate an instance of ContainerSecurityConfig given an JSON stringApparmorProfile is the name of the Apparmor profile the container will use.CapAdd are capabilities which will be added to the container.CapDrop are capabilities which will be removed from the container.Groups are a list of supplemental groups the container's user will be granted access to.@Valid IDMappingOptionsGet idmappingsLabelNested indicates whether or not the container is allowed to run fully nested containers including SELinux labelling.getMask()Mask is the path we want to mask in the container.NoNewPrivileges is whether the container will set the no new privileges flag on create, which disables gaining additional privileges (e.g.Privileged is whether the container is privileged.ProcOpts are the options used for the proc mount.ReadOnlyFilesystem indicates that everything will be mounted as read-only.ReadWriteTmpfs indicates that when running with a ReadOnlyFilesystem mount temporary file systems.SeccompPolicy determines which seccomp profile gets applied the container.SeccompProfilePath is the path to a JSON file containing the container's Seccomp profile.SelinuxProcessLabel is the process label the container will use.getUmask()Umask is the umask the init process of the container will be run with.Unmask a path in the container.getUser()User is the user the container will be run as.@Valid NamespaceGet usernsinthashCode()idmappings(IDMappingOptions idmappings) labelNested(Boolean labelNested) noNewPrivileges(Boolean noNewPrivileges) privileged(Boolean privileged) procfsOpts(List<String> procfsOpts) readOnlyFilesystem(Boolean readOnlyFilesystem) readWriteTmpfs(Boolean readWriteTmpfs) seccompPolicy(String seccompPolicy) seccompProfilePath(String seccompProfilePath) selinuxOpts(List<String> selinuxOpts) voidsetApparmorProfile(String apparmorProfile) voidvoidsetCapDrop(List<String> capDrop) voidvoidsetIdmappings(IDMappingOptions idmappings) voidsetLabelNested(Boolean labelNested) voidvoidsetNoNewPrivileges(Boolean noNewPrivileges) voidsetPrivileged(Boolean privileged) voidsetProcfsOpts(List<String> procfsOpts) voidsetReadOnlyFilesystem(Boolean readOnlyFilesystem) voidsetReadWriteTmpfs(Boolean readWriteTmpfs) voidsetSeccompPolicy(String seccompPolicy) voidsetSeccompProfilePath(String seccompProfilePath) voidsetSelinuxOpts(List<String> selinuxOpts) voidvoidvoidvoidtoJson()Convert an instance of ContainerSecurityConfig to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_APPARMOR_PROFILE
- See Also:
-
SERIALIZED_NAME_CAP_ADD
- See Also:
-
SERIALIZED_NAME_CAP_DROP
- See Also:
-
SERIALIZED_NAME_GROUPS
- See Also:
-
SERIALIZED_NAME_IDMAPPINGS
- See Also:
-
SERIALIZED_NAME_LABEL_NESTED
- See Also:
-
SERIALIZED_NAME_MASK
- See Also:
-
SERIALIZED_NAME_NO_NEW_PRIVILEGES
- See Also:
-
SERIALIZED_NAME_PRIVILEGED
- See Also:
-
SERIALIZED_NAME_PROCFS_OPTS
- See Also:
-
SERIALIZED_NAME_READ_ONLY_FILESYSTEM
- See Also:
-
SERIALIZED_NAME_READ_WRITE_TMPFS
- See Also:
-
SERIALIZED_NAME_SECCOMP_POLICY
- See Also:
-
SERIALIZED_NAME_SECCOMP_PROFILE_PATH
- See Also:
-
SERIALIZED_NAME_SELINUX_OPTS
- See Also:
-
SERIALIZED_NAME_UMASK
- See Also:
-
SERIALIZED_NAME_UNMASK
- See Also:
-
SERIALIZED_NAME_USER
- See Also:
-
SERIALIZED_NAME_USERNS
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
ContainerSecurityConfig
public ContainerSecurityConfig()
-
-
Method Details
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is invalid with respect to ContainerSecurityConfig
-
fromJson
Create an instance of ContainerSecurityConfig given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of ContainerSecurityConfig
- Throws:
IOException- if the JSON string is invalid with respect to ContainerSecurityConfig
-
apparmorProfile
-
getApparmorProfile
ApparmorProfile is the name of the Apparmor profile the container will use. Optional.- Returns:
- apparmorProfile
-
setApparmorProfile
-
capAdd
-
addCapAddItem
-
getCapAdd
CapAdd are capabilities which will be added to the container. Conflicts with Privileged. Optional.- Returns:
- capAdd
-
setCapAdd
-
capDrop
-
addCapDropItem
-
getCapDrop
CapDrop are capabilities which will be removed from the container. Conflicts with Privileged. Optional.- Returns:
- capDrop
-
setCapDrop
-
groups
-
addGroupsItem
-
getGroups
Groups are a list of supplemental groups the container's user will be granted access to. Optional.- Returns:
- groups
-
setGroups
-
idmappings
-
getIdmappings
Get idmappings- Returns:
- idmappings
-
setIdmappings
-
labelNested
-
getLabelNested
LabelNested indicates whether or not the container is allowed to run fully nested containers including SELinux labelling. Optional.- Returns:
- labelNested
-
setLabelNested
-
mask
-
addMaskItem
-
getMask
Mask is the path we want to mask in the container. This masks the paths given in addition to the default list. Optional- Returns:
- mask
-
setMask
-
noNewPrivileges
-
getNoNewPrivileges
NoNewPrivileges is whether the container will set the no new privileges flag on create, which disables gaining additional privileges (e.g. via setuid) in the container. Optional.- Returns:
- noNewPrivileges
-
setNoNewPrivileges
-
privileged
-
getPrivileged
Privileged is whether the container is privileged. Privileged does the following: Adds all devices on the system to the container. Adds all capabilities to the container. Disables Seccomp, SELinux, and Apparmor confinement. (Though SELinux can be manually re-enabled). TODO: this conflicts with things. TODO: this does more. Optional.- Returns:
- privileged
-
setPrivileged
-
procfsOpts
-
addProcfsOptsItem
-
getProcfsOpts
ProcOpts are the options used for the proc mount.- Returns:
- procfsOpts
-
setProcfsOpts
-
readOnlyFilesystem
-
getReadOnlyFilesystem
ReadOnlyFilesystem indicates that everything will be mounted as read-only. Optional.- Returns:
- readOnlyFilesystem
-
setReadOnlyFilesystem
-
readWriteTmpfs
-
getReadWriteTmpfs
ReadWriteTmpfs indicates that when running with a ReadOnlyFilesystem mount temporary file systems. Optional.- Returns:
- readWriteTmpfs
-
setReadWriteTmpfs
-
seccompPolicy
-
getSeccompPolicy
SeccompPolicy determines which seccomp profile gets applied the container. valid values: empty,default,image- Returns:
- seccompPolicy
-
setSeccompPolicy
-
seccompProfilePath
-
getSeccompProfilePath
SeccompProfilePath is the path to a JSON file containing the container's Seccomp profile. If not specified, no Seccomp profile will be used. Optional.- Returns:
- seccompProfilePath
-
setSeccompProfilePath
-
selinuxOpts
-
addSelinuxOptsItem
-
getSelinuxOpts
SelinuxProcessLabel is the process label the container will use. If SELinux is enabled and this is not specified, a label will be automatically generated if not specified. Optional.- Returns:
- selinuxOpts
-
setSelinuxOpts
-
umask
-
getUmask
Umask is the umask the init process of the container will be run with.- Returns:
- umask
-
setUmask
-
unmask
-
addUnmaskItem
-
getUnmask
Unmask a path in the container. Some paths are masked by default, preventing them from being accessed within the container; this undoes that masking. If ALL is passed, all paths will be unmasked. Optional.- Returns:
- unmask
-
setUnmask
-
user
-
getUser
User is the user the container will be run as. Can be given as a UID or a username; if a username, it will be resolved within the container, using the container's /etc/passwd. If unset, the container will be run as root. Optional.- Returns:
- user
-
setUser
-
userns
-
getUserns
Get userns- Returns:
- userns
-
setUserns
-
equals
-
hashCode
public int hashCode() -
toString
-
toJson
Convert an instance of ContainerSecurityConfig to an JSON string- Returns:
- JSON string
-