@@ -94,10 +94,27 @@ setup: force-upgrade setup-go setup-binaries setup-schemastore
9494setup-go :
9595 go build -o $(PACKAGE_PATH ) /bin/ $(REPO_PATH ) /golang/cmd/...
9696setup-binaries : $(PACKAGE_PATH ) /bin/slsa-verifier souffle gnu-sed
97+
98+ # Install SLSA Verifier.
99+ SLSA_VERIFIER_TAG := v2.7.1
100+ SLSA_VERIFIER_BIN := slsa-verifier-linux-amd64
101+ SLSA_VERIFIER_BIN_PATH := $(PACKAGE_PATH ) /bin/$(SLSA_VERIFIER_BIN )
102+ SLSA_VERIFIER_PROVENANCE := $(SLSA_VERIFIER_BIN ) .intoto.jsonl
103+ SLSA_VERIFIER_PROVENANCE_PATH := $(PACKAGE_PATH ) /bin/$(SLSA_VERIFIER_PROVENANCE )
104+
97105$(PACKAGE_PATH ) /bin/slsa-verifier :
98- git clone --depth 1 https://github.com/slsa-framework/slsa-verifier.git -b v2.7.1
99- cd slsa-verifier/cli/slsa-verifier && go build -o $(PACKAGE_PATH ) /bin/
100- cd $(REPO_PATH ) && rm -rf slsa-verifier
106+ mkdir -p $(PACKAGE_PATH ) /bin \
107+ && wget -O $(PACKAGE_PATH ) /bin/slsa-verifier https ://github.com/slsa-framework/slsa-verifier/releases/download/$(SLSA_VERIFIER_TAG ) /$(SLSA_VERIFIER_BIN ) \
108+ && wget -O $(SLSA_VERIFIER_PROVENANCE_PATH ) https ://github.com/slsa-framework/slsa-verifier/releases/download/$(SLSA_VERIFIER_TAG ) /$(SLSA_VERIFIER_PROVENANCE ) \
109+ && chmod +x $(PACKAGE_PATH)/bin/slsa-verifier \
110+ && EXPECTED_HASH=$$(jq -r '.payload' $(SLSA_VERIFIER_PROVENANCE_PATH) | base64 -d | jq -r '.subject[] | select(.name == "$(SLSA_VERIFIER_BIN)") | .digest.sha256') \
111+ && ACTUAL_HASH=$$(sha256sum $(PACKAGE_PATH)/bin/slsa-verifier | awk '{print $$1}'); \
112+ if [ "$$EXPECTED_HASH" != "$$ACTUAL_HASH" ]; then \
113+ echo "Hash mismatch: expected $$EXPECTED_HASH, got $$ACTUAL_HASH"; \
114+ exit 1; \
115+ fi
116+
117+ # Set up schemastore for GitHub Actions specs.
101118setup-schemastore : $(PACKAGE_PATH ) /resources/schemastore/github-workflow.json $(PACKAGE_PATH ) /resources/schemastore/LICENSE $(PACKAGE_PATH ) /resources/schemastore/NOTICE
102119$(PACKAGE_PATH ) /resources/schemastore/github-workflow.json :
103120 cd $(PACKAGE_PATH ) /resources \
@@ -257,15 +274,12 @@ requirements.txt: pyproject.toml
257274# editable mode (like the one in development here) because they may not have
258275# a PyPI entry; also print out CVE description and potential fixes if audit
259276# found an issue.
260- # Ignore GHSA-4xh5-x5gv-qwph since we are using Python >=3.11.14, which is not vulnerable to this
261- # CVE. Remove this once a new version of pip that fixes the CVE is released.
262- # See https://github.com/pypa/pip/issues/13607
263277.PHONY : audit
264278audit :
265279 if ! $$ (python -c " import pip_audit" & > /dev/null); then \
266280 echo " No package pip_audit installed, upgrade your environment!" && exit 1; \
267281 fi ;
268- python -m pip_audit --skip-editable --desc on --fix --dry-run --ignore-vuln GHSA-4xh5-x5gv-qwph
282+ python -m pip_audit --skip-editable --desc on --fix --dry-run
269283
270284# Run some or all checks over the package code base.
271285.PHONY : check check-code check-bandit check-flake8 check-lint check-mypy check-go check-actionlint
0 commit comments