openservicemesh / osm

Open Service Mesh (OSM) is a lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.
https://openservicemesh.io/
Apache License 2.0
2.59k stars 277 forks source link

osm-healthcheck (v1.1.2) should not run as root #5246

Closed lorenzo-biava closed 1 year ago

lorenzo-biava commented 1 year ago

Bug description:

Injected osm-healthcheck container runs as root (at least on v1.1.2 -- note that OSM is running v1.2.1, so there might also be some inconsistencies between the image versions). It should be run under a different user. The container image is built with "user: 0" and it's injected without specifying a different runAsUser.

This leads to the Pod being rejected by security policies in certain environments. E.g.

message: 'container has runAsNonRoot and image will run as root (pod: "xxxxxxxxx(fe265a59-4567-416d-8904-11e42899c815)", container: osm-healthcheck)'

Affected area (please mark with X where applicable):

Expected behavior:

The osm-healthcheck container should not be run as root.

https://github.com/openservicemesh/osm/blob/v1.2.1/pkg/injector/patch.go#L124 should set: securityContext.runAsUser: something other than 0

Steps to reproduce the bug (as precisely as possible):

Create a deployment with:

How was OSM installed?:

AKS Add-on

Anything else we need to know?:

Bug report archive:

Environment:

github-actions[bot] commented 1 year ago

This issue will be closed due to a long period of inactivity. If you would like this issue to remain open then please comment or update.

lorenzo-biava commented 1 year ago

still valid

github-actions[bot] commented 1 year ago

This issue will be closed due to a long period of inactivity. If you would like this issue to remain open then please comment or update.

github-actions[bot] commented 1 year ago

Issue closed due to inactivity.