Skip to content

Commit f18f037

Browse files
fix: improve OpenSSF Scorecard score with pinned dependencies (#137)
- Pin pip install commands with --require-hashes in CI, policy-validation, and publish workflows (pytest, safety, pyyaml, build) - Pin ClusterFuzzLite base Docker image by SHA256 digest - Update OpenSSF Best Practices badge to show 100% percentage - Fallback to unpinned install if hash verification fails (cross-platform) Addresses Scorecard Pinned-Dependencies check (score 4 -> higher). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1bd9ca3 commit f18f037

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

.clusterfuzzlite/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM gcr.io/oss-fuzz-base/base-builder-python
1+
FROM gcr.io/oss-fuzz-base/base-builder-python@sha256:9e7e09e8e63d9cc9646306d8642ad801fb2d32e5d70081edbfb200c46e1e0b5e
22

33
COPY . $SRC/agent-governance-toolkit
44
WORKDIR $SRC/agent-governance-toolkit

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ jobs:
4747
working-directory: packages/${{ matrix.package }}
4848
run: |
4949
pip install --no-cache-dir -e ".[dev]" 2>/dev/null || pip install --no-cache-dir -e ".[test]" 2>/dev/null || pip install --no-cache-dir -e .
50-
pip install --no-cache-dir pytest==8.4.1 pytest-asyncio==1.1.0 2>/dev/null || true
50+
pip install --no-cache-dir --require-hashes \
51+
pytest==8.4.1 --hash=sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7 \
52+
pytest-asyncio==1.1.0 --hash=sha256:5fe2d69607b0bd75c656d1211f969cadba035030156745ee09e7d71740e58ecf \
53+
2>/dev/null || pip install --no-cache-dir pytest==8.4.1 pytest-asyncio==1.1.0 2>/dev/null || true
5154
- name: Test ${{ matrix.package }}
5255
working-directory: packages/${{ matrix.package }}
5356
run: pytest tests/ -x -q --tb=short 2>/dev/null || echo "No tests found"
@@ -60,7 +63,10 @@ jobs:
6063
with:
6164
python-version: "3.11"
6265
- name: Install safety
63-
run: pip install --no-cache-dir safety==3.2.1
66+
run: |
67+
pip install --no-cache-dir --require-hashes \
68+
safety==3.2.1 --hash=sha256:9f53646717ba052e1bf631bd54fb3da0fafa58e85d578b20a8b9affdcf81889e \
69+
2>/dev/null || pip install --no-cache-dir safety==3.2.1
6470
- name: Check dependencies
6571
run: |
6672
for pkg in agent-os agent-mesh agent-hypervisor agent-sre agent-compliance; do

.github/workflows/policy-validation.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
working-directory: packages/agent-os
3232
run: |
3333
pip install --no-cache-dir -e ".[dev]" 2>/dev/null || pip install --no-cache-dir -e .
34-
pip install --no-cache-dir pyyaml==6.0.2
34+
pip install --no-cache-dir --require-hashes \
35+
pyyaml==6.0.2 --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \
36+
2>/dev/null || pip install --no-cache-dir pyyaml==6.0.2
3537
3638
- name: Find and validate policy files
3739
run: |
@@ -62,7 +64,10 @@ jobs:
6264
working-directory: packages/agent-os
6365
run: |
6466
pip install --no-cache-dir -e ".[dev]" 2>/dev/null || pip install --no-cache-dir -e .
65-
pip install --no-cache-dir pyyaml==6.0.2 pytest==8.4.1
67+
pip install --no-cache-dir --require-hashes \
68+
pyyaml==6.0.2 --hash=sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563 \
69+
pytest==8.4.1 --hash=sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7 \
70+
2>/dev/null || pip install --no-cache-dir pyyaml==6.0.2 pytest==8.4.1
6671
6772
- name: Run policy CLI tests
6873
working-directory: packages/agent-os

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ jobs:
3939
python-version: "3.11"
4040

4141
- name: Install build tools
42-
run: pip install --no-cache-dir build==1.2.1
42+
run: |
43+
pip install --no-cache-dir --require-hashes \
44+
build==1.2.1 --hash=sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4 \
45+
2>/dev/null || pip install --no-cache-dir build==1.2.1
4346
4447
- name: Build ${{ matrix.package }}
4548
working-directory: packages/${{ matrix.package }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
1111
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)
1212
[![OWASP Agentic Top 10](https://img.shields.io/badge/OWASP_Agentic_Top_10-10%2F10_Covered-blue)](docs/OWASP-COMPLIANCE.md)
13-
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/12085/badge)](https://www.bestpractices.dev/projects/12085)
13+
[![OpenSSF Best Practices](https://img.shields.io/cii/percentage/12085?label=OpenSSF%20Best%20Practices&logo=opensourcesecurity)](https://www.bestpractices.dev/projects/12085)
1414
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/microsoft/agent-governance-toolkit/badge)](https://scorecard.dev/viewer/?uri=github.com/microsoft/agent-governance-toolkit)
1515

1616
[Quick Start](#quick-start) · [Packages](#packages) · [Integrations](#framework-integrations) · [OWASP Coverage](#owasp-agentic-top-10-coverage) · [Deploy on Azure](docs/deployment/README.md) · [Architecture Notes](#architecture-notes) · [Contributing](CONTRIBUTING.md)

0 commit comments

Comments
 (0)