skipper icon indicating copy to clipboard operation
skipper copied to clipboard

Scratch image as base image of Skipper docker image

Open sepehrdaddev opened this issue 1 year ago • 5 comments

Is your feature request related to a problem? Please describe. Today skipper uses alpine 3 as a docker base image for docker images, while alpine 3 is one of most minimal docker images out there, it still comes with some unnecessary things such as busybox which can increase the security risk due to its increased attack surface.

Describe the solution you would like Being a Go application, skipper can be used as a static binary and packaged as a docker image using scratch as a base and ca-certificates. as ca-certificates are the only necessary things needs to run skipper (apart from the static builds), this will reduce the attack surface drastically and hence lower risk of any breaches.

Would you like to work on it? Yes, but no time (likely)

sepehrdaddev avatar Feb 21 '24 16:02 sepehrdaddev

Are you looking for these configurations in a docker image ??

Dockerfile

  • Start from scratch FROM scratch

  • Copy ca-certificates COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

  • Copy the Skipper binary into the container COPY skipper /skipper

  • Set the entry point for Skipper ENTRYPOINT ["/skipper"]

Ritish134 avatar Feb 22 '24 05:02 Ritish134

@Ritish134 yes

szuecs avatar Feb 22 '24 09:02 szuecs

Could you please guide what next steps to perform to solve this issue ...

Ritish134 avatar Feb 22 '24 15:02 Ritish134

@Ritish134 either you do it or someone else will do it or we decide it's a nice idea but we won't have time. Feel free to learn more about the topic, but we can't guide you there.

szuecs avatar Feb 22 '24 16:02 szuecs

This issue can be dangerous to do, because it can break all kind of readinessProbes or livenessProbes. I added label "architectural" and "breaking change" because it seems to be very dangerous change, but looks "simple".

szuecs avatar Feb 23 '24 10:02 szuecs