cloudflared-docker icon indicating copy to clipboard operation
cloudflared-docker copied to clipboard

Use hashes instead of version tags

Open Letgamer opened this issue 1 year ago • 0 comments

What about instead of:

# Build container
ARG GOVERSION=1.21.6
ARG ALPINEVERSION=3.19

The hashes of the containers are used like this:

ARG GOHASH=2523a6f68a0f515fe251aad40b18545155135ca6a5b2e61da8254df9153e3648 # golang:1.21.6-alpine3.19
FROM --platform=${BUILDPLATFORM} \
    golang@sha256:$GOHASH AS build

This would make the container more secure by guaranteeing that the images won't change unless the sha256 is updated manually, so no malicious code will be executed. Version tags on the other hand can be easily overwritten

Letgamer avatar Jan 13 '24 11:01 Letgamer