All Projects → kpcyrd → pacman-bintrans

kpcyrd / pacman-bintrans

Licence: GPL-3.0 license
Experimental binary transparency for pacman with sigstore and rekor

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to pacman-bintrans

pip-audit
Audits Python environments and dependency trees for known vulnerabilities
Stars: ✭ 735 (+830.38%)
Mutual labels:  supply-chain
Invidious-Updater
Automatic install and update script for Invidious
Stars: ✭ 181 (+129.11%)
Mutual labels:  archlinux
paclabel
A tiny pacman wrapper that makes possible to attach labels to packages.
Stars: ✭ 16 (-79.75%)
Mutual labels:  archlinux
dotfiles
My main working machine setup. Here be cyber dragons, and optional bugs.
Stars: ✭ 35 (-55.7%)
Mutual labels:  archlinux
pacwatch
A pacman wrapper which helps you watch important package updates.
Stars: ✭ 24 (-69.62%)
Mutual labels:  archlinux
arch-config
Scripts and Ansible playbook to setup Arch Linux on ZFS.
Stars: ✭ 36 (-54.43%)
Mutual labels:  archlinux
dots
Configuration file for linux distro
Stars: ✭ 37 (-53.16%)
Mutual labels:  archlinux
deepin-wine-qq-arch
Tencent QQ on Deepin Wine5(com.qq.im.deepin) For Archlinux
Stars: ✭ 274 (+246.84%)
Mutual labels:  archlinux
aurblobs
Automatically create binary repositories from AUR packages
Stars: ✭ 14 (-82.28%)
Mutual labels:  archlinux
dotfiles
Salonia Matteo's dotfiles (GNU/Linux configuration)
Stars: ✭ 19 (-75.95%)
Mutual labels:  archlinux
EndeavourOS-ISO
EndeavourOS ISO framework based on Arch-ISO
Stars: ✭ 159 (+101.27%)
Mutual labels:  archlinux
vdr4arch
VDR PKGBUILDs for Arch Linux
Stars: ✭ 33 (-58.23%)
Mutual labels:  archlinux
dotfiles
The ricer's canvas
Stars: ✭ 53 (-32.91%)
Mutual labels:  archlinux
dotfiles
🚀 @1995parham Linux / OSx configurations files
Stars: ✭ 79 (+0%)
Mutual labels:  archlinux
tizen-studio-arch
How to install TizenStudio on Arch Linux
Stars: ✭ 31 (-60.76%)
Mutual labels:  archlinux
dotfiles
🧊 My dotfiles for Arch Linux
Stars: ✭ 15 (-81.01%)
Mutual labels:  archlinux
no-mans-sky-rice-i3wm
i3WM rice themed using No Man's Sky's colors
Stars: ✭ 34 (-56.96%)
Mutual labels:  archlinux
secret-service
Service to keep secrets of applications
Stars: ✭ 56 (-29.11%)
Mutual labels:  archlinux
HADRIAN
Pantheon Desktop Environment installer script for Arch Linux
Stars: ✭ 19 (-75.95%)
Mutual labels:  archlinux
arch-secure-boot
UEFI Secure Boot for Arch Linux + btrfs snapshot recovery
Stars: ✭ 60 (-24.05%)
Mutual labels:  archlinux

pacman-bintrans

This is an experimental implementation of binary transparency for pacman, the Arch Linux package manager. This project was originally heavily inspired by prior work by Mozilla and then re-implemented with the rekor transparency log of sigstore.

Cryptographic signatures prove that a message originates from somebody with control over the private key, but it's impossible to prove that the private key didn't sign additional messages. In update security this means a signed update is a strong indicator the update is authentic, but you can't be sure this update is the same update everybody else got. Somebody in control of the update key could craft a malicious update, sign it and feed it specifically to you. This attack is much less likely to get noticed than pushing a malicious update to all users.

Because transparency logs work best with a "single-purpose key", meaning the key is only ever used to sign Arch Linux packages, we're creating a special "transparency key". The operator needs to sign every Arch Linux package and upload the signature to the transparency log. They also need to maintain an audit log that tracks why each signature was created.

An external auditor could then fetch all signatures from sigstore and check if they belong to officially released packages.

Usage

pacman-bintrans integrates into pacman by registering it as a custom transport in /etc/pacman.conf:

XferCommand = /usr/bin/pacman-bintrans -O %o %u --transparency-url https://pacman-bintrans.vulns.xyz/sigs/ --pubkey 'RWSC6c8TVaOYGoe60E+sPiPgumSQENiSNJrBOH6IUYdfmY9xIDJCFXa2'

To verify everything is working correctly you can clear your download cache with pacman -Scc and then try to re-download and reinstall a package with pacman -Suy filesystem.

pacman still verifies pgp signatures, but in addition also runs rekor-cli verify on each package to ensure it has been properly logged in the sigstore transparency log.

Verifying Reproducible Builds

Arch Linux has multiple independent rebuilders. A rebuilder tracks all pre-compiled packages in Arch Linux, downloads the source code and attempts to compile them again and expects the resulting package to be bit-for-bit identical with the official, pre-compiled package. Arch Linux supports this by publishing BUILDINFO files that describe the build environment. A rebuilder can use this file to setup an almost identical build environment that matches all compiler and library versions of the original build environment. At the time of writing this works with about 86% of all packages in Arch Linux. Software shouldn't attempt to track anything of the build environment that can't reasonably be normalized, for example by probing the current date/time or by testing for cpu features like SSE/AVX at build time instead of runtime.

To query a rebuilder for every update you're about to install you can add --rebuilder <url>, this option can be set multiple times:

--rebuilder https://reproducible.archlinux.org/
--rebuilder https://r-b.engineering.nyu.edu/
--rebuilder https://wolfpit.net/rebuild/

The full command could look like this:

XferCommand = /usr/bin/pacman-bintrans -O %o %u --transparency-url https://pacman-bintrans.vulns.xyz/sigs/ --pubkey 'RWSC6c8TVaOYGoe60E+sPiPgumSQENiSNJrBOH6IUYdfmY9xIDJCFXa2' --rebuilder https://reproducible.archlinux.org/ --rebuilder https://r-b.engineering.nyu.edu/ --rebuilder https://wolfpit.net/rebuild/

To configure a threshold of required successful builds for every update you can use this option:

--required-rebuild-confirms 2

🚧 But wait! 🚧 Rejecting all packages that haven't been reproduced by at least two other parties is a really exciting goal with massive security benefits, unfortunately there are still too many unreproducible packages and nobody has managed to build a useful system with only reproducible software yet. If you use --required-rebuild-confirms with anything higher than 0 your update system is eventually going to stop working because pacman can't download any unreproducible updates anymore (this may even include critical security updates).

Generating transparency proofs

This section is intended for package maintainers that are planning to run package repositories with binary transparency enabled.

cd pacman-bintrans-sign
cargo run --release -- -v \
    --repo-url 'https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch' --repo-name core --architecture x86_64 \
    --signature-dir ../www/ --pubkey-path ~/keys/minisign.pub --seckey-path ~/keys/seckey

Searching the transparency log

There's a command to list all signatures that have been logged so far:

cd pacman-bintrans-monitor
cargo run

Fetching with a proxy

It's possible to make all requests through a proxy (eg. Tor) with the --proxy <value> flag for privacy reasons. This includes the package download, the connection to the --transparency-url, the connection to the transparency log and the connections to any rebuilders.

XferCommand = /usr/bin/pacman-bintrans --proxy 'socks5h://127.0.0.1:9050' --bypass-proxy-for-pkgs -O %o %u --transparency-url https://pacman-bintrans.vulns.xyz/sigs/ --pubkey 'RWSC6c8TVaOYGoe60E+sPiPgumSQENiSNJrBOH6IUYdfmY9xIDJCFXa2'

To speed up upgrades you can use --bypass-proxy-for-pkgs so the packages are downloaded directly, but the extra security checks run through the proxy.

Acknowledgments

Current development is crowd-funded through GitHub sponsors.

Initial development in 2021 was funded by Google and The Linux Foundation.

License

GPLv3+

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].