Skip to content

Commit d2f15b6

Browse files
zkoppertCopilot
andcommitted
fix: remediate supply chain security findings
Address 4 high-severity code scanning findings from vuln-mgmt#195573: 1. Pin Docker base image to SHA256 digest (code-scanning/14) 2. Pin bundler gem to exact version 2.4.10 (code-scanning/16) 3. Add hash verification for pip install in Dockerfile (code-scanning/15) 4. Add hash verification for pip install in CI workflow (code-scanning/12) Additionally pin all GitHub Actions to full commit SHAs for supply chain integrity. Uses requirements file syntax for pip hash verification since --hash is a per-requirement option, not a CLI flag. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Zack Koppert <zkoppert@github.com>
1 parent ee2b5c5 commit d2f15b6

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v6.0.2
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525
with:
2626
fetch-depth: 10
2727

@@ -30,12 +30,12 @@ jobs:
3030
ruby-version: ${{ matrix.ruby }}
3131
bundler-cache: true
3232

33-
- uses: actions/setup-python@v6.2.0
33+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3434
with:
3535
# This should match lib/github/markups.rb GitHub::Markups::MARKUP_RST
3636
python-version: "3.x"
3737

38-
- uses: actions/cache@v5.0.4
38+
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3939
with:
4040
path: ~/.cache/pip
4141
key: ${{ runner.os }}-pip
@@ -52,7 +52,9 @@ jobs:
5252
sudo cpanm --installdeps --notest Pod::Simple
5353
5454
- name: Install Python dependencies
55-
run: python -m pip install docutils
55+
run: |
56+
echo 'docutils==0.22.4 --hash=sha256:d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de' > /tmp/requirements.txt
57+
python -m pip install -r /tmp/requirements.txt
5658
5759
- name: Run rake
5860
run: |

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:trusty
1+
FROM ubuntu:trusty@sha256:64483f3496c1373bfd55348e88694d1c4d0c9b660dee6bfef5e12f43b9933b30 # trusty
22

33
RUN apt-get update -qq
44
RUN apt-get install -y apt-transport-https
@@ -18,15 +18,16 @@ RUN install-zef-as-user && zef install Pod::To::HTML
1818
RUN curl -L http://cpanmin.us | perl - App::cpanminus
1919
RUN cpanm --installdeps --notest Pod::Simple
2020

21-
RUN pip install docutils
21+
RUN echo 'docutils==0.22.4 --hash=sha256:d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de' > /tmp/requirements.txt && \
22+
pip install -r /tmp/requirements.txt
2223

2324
ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims
2425
RUN curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-installer | bash
2526
RUN rbenv install 2.4.1
2627
RUN rbenv global 2.4.1
2728
RUN rbenv rehash
2829

29-
RUN gem install bundler
30+
RUN gem install bundler -v 2.4.10
3031

3132
WORKDIR /data/github-markup
3233
COPY github-markup.gemspec .

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docutils==0.22.4 --hash=sha256:d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de

0 commit comments

Comments
 (0)