mimir icon indicating copy to clipboard operation
mimir copied to clipboard

Migrate Mimir to distroless Docker image

Open pracucci opened this issue 3 years ago • 10 comments

We should migrate Mimir to a distroless Docker image, to reduce the attack surface.

The main pushback towards this move was because it's then very difficult to debug a live container (e.g. look at files on disk or sockets), but in recent K8S versions we could use kubectl debug (doc) to add a debugging container to a running pod.

pracucci avatar Oct 12 '22 16:10 pracucci

Nice, I didn't know about kubectl debug before. The debuggability would have been my only reason to not use a distroless image, so this reason is void now.

replay avatar Oct 12 '22 17:10 replay

I like the idea, but kubectl debug and ephemeral containers are new feature in Kubernetes (marked as stable since 1.25, released in late august 2022), and not everyone has it available yet. For example it is not enabled in our dev GCP cluster. How long should we wait before proceeding with this?

pstibrany avatar Oct 13 '22 06:10 pstibrany

How long should we wait before proceeding with this?

This issue originates from a conversation I had with Thomas (head security at Grafana) and Bryan.

My idea is to publish both alpine and distroless images for Mimir (and GEM) so that users / customers can choose. Moreover, we should also pubilsh a mimir-debug image to use for debugging purposes (with all our tooling inside, e.g. s3/gcs/azure clients). At Grafana we could slowly migrate to distroless, and share our learnings (documentation, improve the debug image, ...).

WDYT?

pracucci avatar Oct 13 '22 12:10 pracucci

My idea is to publish both alpine and distroless images for Mimir (and GEM) so that users / customers can choose. Moreover, we should also pubilsh a mimir-debug image to use for debugging purposes (with all our tooling inside, e.g. s3/gcs/azure clients). At Grafana we could slowly migrate to distroless, and share our learnings (documentation, improve the debug image, ...).

WDYT?

Publishing both sounds like a good idea. Internally we don't use Mimir docker images in any way, so that's a separate conversation.

pstibrany avatar Oct 13 '22 12:10 pstibrany