Skip to content

Commit d70b1a0

Browse files
zkoppertCopilot
andauthored
fix: harden pip install against supply chain attacks (#686)
Resolves code scanning alert #94 (pip install without hash verification). - Expand requirements.txt via pip-compile to pin all transitive dependencies to exact versions (5 top-level → 17 total packages) - Add --no-deps to Dockerfile pip install to prevent pip from resolving any packages beyond what is explicitly listed This follows the approach recommended in the Opengrep rule guidance: 'use pip install --no-deps -r requirements.txt when using pip-compile workflow.' With all transitive deps pinned and --no-deps preventing runtime dependency resolution, no unvetted packages can be introduced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c9c5bcf commit d70b1a0

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LABEL com.github.actions.name="issue-metrics" \
1616
WORKDIR /action/workspace
1717
COPY requirements.txt *.py /action/workspace/
1818

19-
RUN python3 -m pip install --no-cache-dir -r requirements.txt \
19+
RUN python3 -m pip install --no-cache-dir --no-deps -r requirements.txt \
2020
&& apt-get -y update \
2121
&& apt-get -y install --no-install-recommends git=1:2.47.3-0+deb13u1 \
2222
&& rm -rf /var/lib/apt/lists/*

requirements.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
1-
github3.py==4.0.1
1+
certifi==2026.2.25
2+
# via requests
3+
cffi==2.0.0
4+
# via cryptography
5+
charset-normalizer==3.4.4
6+
# via requests
7+
cryptography==46.0.5
8+
# via pyjwt
9+
github3-py==4.0.1
10+
# via -r requirements.txt
11+
idna==3.11
12+
# via requests
213
numpy==2.4.2
14+
# via -r requirements.txt
15+
pycparser==3.0
16+
# via cffi
17+
pyjwt==2.11.0
18+
# via github3-py
19+
python-dateutil==2.9.0.post0
20+
# via github3-py
321
python-dotenv==1.2.1
22+
# via -r requirements.txt
423
pytz==2025.2
24+
# via -r requirements.txt
525
requests==2.32.5
26+
# via
27+
# -r requirements.txt
28+
# github3-py
29+
six==1.17.0
30+
# via python-dateutil
31+
uritemplate==4.2.0
32+
# via github3-py
33+
urllib3==2.6.3
34+
# via requests

0 commit comments

Comments
 (0)