Class: Google::Apis::CloudbuildV2::SecurityContext
- Inherits:
-
Object
- Object
- Google::Apis::CloudbuildV2::SecurityContext
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/cloudbuild_v2/classes.rb,
lib/google/apis/cloudbuild_v2/representations.rb,
lib/google/apis/cloudbuild_v2/representations.rb
Overview
Security options the container should be run with.
Instance Attribute Summary collapse
-
#allow_privilege_escalation ⇒ Boolean
(also: #allow_privilege_escalation?)
Optional.
-
#capabilities ⇒ Google::Apis::CloudbuildV2::Capabilities
Capabilities adds and removes POSIX capabilities from running containers.
-
#privileged ⇒ Boolean
(also: #privileged?)
Run container in privileged mode.
-
#run_as_group ⇒ Fixnum
Optional.
-
#run_as_non_root ⇒ Boolean
(also: #run_as_non_root?)
Optional.
-
#run_as_user ⇒ Fixnum
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SecurityContext
constructor
A new instance of SecurityContext.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ SecurityContext
Returns a new instance of SecurityContext.
2136 2137 2138 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2136 def initialize(**args) update!(**args) end |
Instance Attribute Details
#allow_privilege_escalation ⇒ Boolean Also known as: allow_privilege_escalation?
Optional. AllowPrivilegeEscalation controls whether a process can gain more
privileges than its parent process. This bool directly controls if the
no_new_privs flag will be set on the container process.
AllowPrivilegeEscalation is true always when the container is: 1) run as
Privileged 2) has CAP_SYS_ADMIN Note that this field cannot be set when spec.
os.name is windows. +optional
Corresponds to the JSON property allowPrivilegeEscalation
2093 2094 2095 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2093 def allow_privilege_escalation @allow_privilege_escalation end |
#capabilities ⇒ Google::Apis::CloudbuildV2::Capabilities
Capabilities adds and removes POSIX capabilities from running containers.
Corresponds to the JSON property capabilities
2099 2100 2101 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2099 def capabilities @capabilities end |
#privileged ⇒ Boolean Also known as: privileged?
Run container in privileged mode.
Corresponds to the JSON property privileged
2104 2105 2106 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2104 def privileged @privileged end |
#run_as_group ⇒ Fixnum
Optional. The GID to run the entrypoint of the container process. Uses runtime
default if unset. May also be set in PodSecurityContext. If set in both
SecurityContext and PodSecurityContext, the value specified in SecurityContext
takes precedence. Note that this field cannot be set when spec.os.name is
windows. +optional
Corresponds to the JSON property runAsGroup
2114 2115 2116 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2114 def run_as_group @run_as_group end |
#run_as_non_root ⇒ Boolean Also known as: run_as_non_root?
Optional. Indicates that the container must run as a non-root user. If true,
the Kubelet will validate the image at runtime to ensure that it does not run
as UID 0 (root) and fail to start the container if it does. If unset or false,
no such validation will be performed. May also be set in PodSecurityContext.
If set in both SecurityContext and PodSecurityContext, the value specified in
SecurityContext takes precedence. +optional
Corresponds to the JSON property runAsNonRoot
2124 2125 2126 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2124 def run_as_non_root @run_as_non_root end |
#run_as_user ⇒ Fixnum
Optional. The UID to run the entrypoint of the container process. Defaults to
user specified in image metadata if unspecified. May also be set in
PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the
value specified in SecurityContext takes precedence. Note that this field
cannot be set when spec.os.name is windows. +optional
Corresponds to the JSON property runAsUser
2134 2135 2136 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2134 def run_as_user @run_as_user end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2141 2142 2143 2144 2145 2146 2147 2148 |
# File 'lib/google/apis/cloudbuild_v2/classes.rb', line 2141 def update!(**args) @allow_privilege_escalation = args[:allow_privilege_escalation] if args.key?(:allow_privilege_escalation) @capabilities = args[:capabilities] if args.key?(:capabilities) @privileged = args[:privileged] if args.key?(:privileged) @run_as_group = args[:run_as_group] if args.key?(:run_as_group) @run_as_non_root = args[:run_as_non_root] if args.key?(:run_as_non_root) @run_as_user = args[:run_as_user] if args.key?(:run_as_user) end |