The job never starts: the GitLab runner checks the job image against its allowed_images list and rejects everything not on it. That is a simple but effective supply chain rule at runner level.
Symptom
ERROR: The "docker:27-cli" image is not present on list of allowed images: - alpine:3.20 - python:3.12-slim - gcr.io/kaniko-project/executor:*
A test job with image: docker:27-cli fails while the other jobs keep running.
Diagnosis
The runner configuration lives in the gitlab-runner container; copy it to the host to check and edit it.
docker cp gitlab-runner:/etc/gitlab-runner/config.toml ~/seclab/kap01/config.toml
Causes
allowed_imagesImage not approved
The list only allows alpine:3.20, python:3.12-slim and the Kaniko image. Everything else is rejected – even popular images like docker:*.
Tags/digestsApproval by tag or digest
Wildcards * are allowed. If the list contains a digest, the pipeline has to use exactly that digest too.
Fix
[runners.docker]
image = "alpine:3.20"
privileged = false
network_mode = "kind"
volumes = ["/cache"]
pull_policy = ["always"]
allowed_images = [
"alpine:3.20",
"python:3.12-slim",
"gcr.io/kaniko-project/executor:*",
]
docker cp ~/seclab/kap01/config.toml gitlab-runner:/etc/gitlab-runner/config.toml
sleep 5
docker logs --tail 5 gitlab-runner
Don't: Do not remove allowed_images or open it with * for everything – then any pipeline can smuggle arbitrary foreign code in as a job image.
Secure supply chains hands-on, Chapter 1: running CI/CD yourself – GitLab, hardening the runner with allowed_images, pull_policy and privileged.
Go to day 0 →
FAQ
Why pull_policy always?
So no job uses a locally cached image that another job may have tampered with.
Does this apply to services images too?
There is a separate list, allowed_services, in the same configuration.