Skip to content

Commit

Permalink
Fixed security context
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Feb 5, 2024
1 parent 514f084 commit 7834168
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/+ephemeral-spec.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `runAsNonRoot: false` and `runAsUser: 0` to the security context of an epheremal agent when running privileged (to prevent overriding these values with values from the pod spec).
2 changes: 2 additions & 0 deletions mirrord/kube/src/api/container/ephemeral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ impl ContainerVariant for EphemeralTargetedVariant<'_> {
"add": get_capabilities(agent),
},
"privileged": agent.privileged,
"runAsNonRoot": agent.privileged.then_some(false),
"runAsUser": agent.privileged.then_some(0),
},
"imagePullPolicy": agent.image_pull_policy,
"targetContainerName": runtime_data.container_name,
Expand Down

0 comments on commit 7834168

Please sign in to comment.