Supply Chain Security and the Real World:
Lessons from Incidents
Adrian Mouat
Technical Community Advocate
Chainguard
3
4
5
6
7
8
9
10
11
12
13
Adrian Mouat
14
Incident 1
CodeCov
June 2021
15
17
NEVER do this!
FROM debian
COPY mysecret ./
RUN curl -H 'Authorization: Bearer \
$(cat mysecret)' https://api.example.com
RUN rm mysecret
18
Instead
FROM debian
RUN --mount=type=secret,id=mysec \
curl -H 'Authorization: Bearer \
$(cat /run/secrets/mysec)' \
https://api.example.com
$ docker build --secret id=mysec,src=./mysecret .
19
20
bash <(curl -s https://codecov.io/bash)
21
Not totally awful...
22
What to do with these
23
Using Checksums
ENV REDIS_DOWNLOAD_URL http://download…redis-7.4.2.tar.gz
ENV REDIS_DOWNLOAD_SHA \
4ddebb…9767dd89dbe712d2b68e808af6a1f
RUN wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"
RUN echo "$REDIS_DOWNLOAD_SHA *redis.tar.gz" \
| sha256sum -c -
24
Using GPG
Redis Dockerfile good example
wget -O /usr/local/bin/gosu.asc "$url.asc"
wget -O /usr/local/bin/gosu "$url"
gpg --batch --keyserver hkps://keys.openpgp.org \
--recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
gpg --batch --verify /usr/local/bin/gosu.asc \
/usr/local/bin/gosu
25
For Distributing Software
26
27
28
Secrets and Environment Variables
29
Secrets and Environment Variables
30
Incident 2
ChangedFiles
Mar 2025
31
tj-actions/changed-files
32
Like all the best stories, it has a (review)dog
33
Photo by charlesdeluvio on Unsplash
reviewdog
34
35
36
Verify Contributors & Contributions
37
Restrict Tag Updates
38
Pin Actions to Digests
- uses: chainguard-dev/digestabot@v1.2.2
- uses: chainguard-dev/digestabot@432222…1c95ce2cedac # v1.2.2
39
Avoid Long-Lived Credentials
40
Incident 3
Shai-Hulud
Sep 2025
41
Shai-Hulud
42
Exfiltration
43
44
Friends don't let friends publish from a laptop
45
Trusted Publishing
46
Trusted Publishing
47
Trufflehog
48
Multi Factor Authentication (MFA)
49
Wrap Up
50
Recap
51
Tooling
52
"If all ransomware groups suddenly became cybersecurity specialists, and those who are now cybersecurity specialists began pentesting networks, the ransomware would end."
wazawaka
53