Skip to content

Conversation

@bastimeyer
Copy link
Contributor

  • Download and verify PGP signature instead of sha256 sum
  • Add public key ncopa.asc:
    0482d84022f52df1c4e7cd43293acd0907d9495a
    Natanael Copa <[email protected]>

I've noticed that the chroot_build.sh script was downloading both the Alpine minirootfs tarball and its sha256 sum over HTTP (no HSTS). Verifying the tarball using the checksum that has also been downloaded over a non-TLS connection at the same time doesn't achieve anything security-wise.

wget "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_RELEASE%.*}/releases/${ALPINE_ARCH}/alpine-minirootfs-${ALPINE_RELEASE}-${ALPINE_ARCH}.tar.gz"
wget "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_RELEASE%.*}/releases/${ALPINE_ARCH}/alpine-minirootfs-${ALPINE_RELEASE}-${ALPINE_ARCH}.tar.gz.sha256"
sha256sum -c alpine-minirootfs-${ALPINE_RELEASE}-${ALPINE_ARCH}.tar.gz.sha256

This PR therefore adds the PGP signing pub-key of Alpine releases (0482d84022f52df1c4e7cd43293acd0907d9495a) to the repo, downloads the PGP signature instead of the sha256 sum and verifies the tarball using that.

- Download and verify PGP signature instead of sha256 sum
- Add public key ncopa.asc:
  0482d84022f52df1c4e7cd43293acd0907d9495a
  Natanael Copa <[email protected]>
@probonopd
Copy link
Member

Thanks @bastimeyer. Alternatively we might want to store a hash of the files even in this repository and check against it, like we do for some other files iirc. @TheAssassin wdyt?

@github-actions
Copy link

Build for testing:
artifacts x86_64
artifacts i686
artifacts armhf
Use at your own risk.

@github-actions
Copy link

Build for testing:
artifacts x86_64
artifacts i686
artifacts armhf
artifacts aarch64
Use at your own risk.

@TheAssassin
Copy link
Member

@probonopd checking against a specific hash is probably overkill. We trust Alpine. Authenticating the bundles is a good idea, though.

@probonopd probonopd enabled auto-merge (squash) May 21, 2025 20:55
@probonopd probonopd merged commit 94bfa3c into AppImage:main May 21, 2025
8 of 9 checks passed
@bastimeyer bastimeyer deleted the scripts/chroot/fix-alpine-minirootfs-download branch May 21, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants