Skip to content

Commit a66cddc

Browse files
committed
Pin repo-setup to commit SHA on stable with checksum verification
Pin the repo-setup build-time dependency to a specific commit on the stable branch and verify the SHA-256 checksum of the downloaded archive before extraction. Previously repo-setup was fetched from the floating main branch with no integrity check. This applies to both the diskimage-builder element (dib/repo-setup/pre-install.d/00-03-repo-setup) and the bootc build path (bootc/install-repo-setup.sh). Jira: OSPRH-32780
1 parent 5c2fca5 commit a66cddc

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

bootc/install-repo-setup.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22

33
set -eux
44

5+
# Pin repo-setup to a specific commit on the stable branch
6+
# To update: change REPO_SETUP_COMMIT, download the new archive, and update REPO_SETUP_SHA256
7+
REPO_SETUP_COMMIT=85321f7e0af502d7f06f845886058daf09da34f6
8+
REPO_SETUP_SHA256=1050e4ed0472098165c4bde84a9991a6a13171426d16862f6651e28635d1727f
9+
510
pushd output
6-
curl -sL https://github.com/openstack-k8s-operators/repo-setup/archive/refs/heads/main.tar.gz | tar xvz
7-
pushd repo-setup-main
11+
curl -sL -o repo-setup.tar.gz \
12+
"https://github.com/openstack-k8s-operators/repo-setup/archive/${REPO_SETUP_COMMIT}.tar.gz"
13+
echo "${REPO_SETUP_SHA256} repo-setup.tar.gz" | sha256sum -c -
14+
tar xzf repo-setup.tar.gz
15+
pushd "repo-setup-${REPO_SETUP_COMMIT}"
816
python3 -m venv ./venv
917
source ./venv/bin/activate
1018
PBR_VERSION=0.0.0 python3 -m pip install ./

dib/repo-setup/pre-install.d/00-03-repo-setup

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@ if [ -n "${DIB_YUM_REPO_CONF:-}" ] ; then
99
exit 0
1010
fi
1111

12-
# Install latest version of repo-setup without installing pip or git
12+
# Install repo-setup pinned to a specific commit on the stable branch
13+
# To update: change REPO_SETUP_COMMIT, download the new archive, and update REPO_SETUP_SHA256
14+
REPO_SETUP_COMMIT=85321f7e0af502d7f06f845886058daf09da34f6
15+
REPO_SETUP_SHA256=1050e4ed0472098165c4bde84a9991a6a13171426d16862f6651e28635d1727f
1316
cd /tmp
14-
curl -sL https://github.com/openstack-k8s-operators/repo-setup/archive/refs/heads/main.tar.gz | tar xvz
15-
cd repo-setup-main
17+
curl -sL -o repo-setup.tar.gz \
18+
"https://github.com/openstack-k8s-operators/repo-setup/archive/${REPO_SETUP_COMMIT}.tar.gz"
19+
echo "${REPO_SETUP_SHA256} repo-setup.tar.gz" | sha256sum -c -
20+
tar xzf repo-setup.tar.gz
21+
cd "repo-setup-${REPO_SETUP_COMMIT}"
1622
python3 -m venv ./venv
1723
source ./venv/bin/activate
1824
PBR_VERSION=0.0.0 python3 -m pip install ./

0 commit comments

Comments
 (0)