Skip to content

Commit 7822605

Browse files
committed
fix(router): add verification of downloaded nginx archive on build
When building the router docker image, the archive is downloaded over an insecure connection. This commit adds a SHA256 checksum verification. The checkum can be generated by person updating the scipt, after manually verifying their own downloaded nginx archive via provided PGP signature (http://nginx.org/download/$VERSION_NGINX.tar.gz.asc).
1 parent 59ff8d2 commit 7822605

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

router/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if [[ -z $DOCKER_BUILD ]]; then
1111
fi
1212

1313
export VERSION_NGINX=nginx-1.9.2
14+
export SHA256_NGINX=80b6425be14a005c8cb15115f3c775f4bc06bf798aa1affaee84ed9cf641ed78
1415
export VERSION_NAXSI=0d53a64ed856e694fcb4038748c8cf6d5551a603
1516

1617
export BUILD_PATH=/tmp/build
@@ -39,6 +40,7 @@ apk add --update-cache \
3940

4041
# grab the source files
4142
curl -sSL http://nginx.org/download/$VERSION_NGINX.tar.gz -o $BUILD_PATH/$VERSION_NGINX.tar.gz
43+
echo "$SHA256_NGINX *$VERSION_NGINX.tar.gz" | sha256sum -c - || exit 10
4244
curl -sSL https://github.com/nbs-system/naxsi/archive/$VERSION_NAXSI.tar.gz -o $BUILD_PATH/$VERSION_NAXSI.tar.gz
4345

4446
# expand the source files

0 commit comments

Comments
 (0)