Skip to content
ddroidPublic

About

A secure, POSIX-compliant wrapper for yay that enforces a 24-hour delay on AUR package installations and updates to protect against zero-day supply chain attacks.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yup: Stop getting wrecked by zero-day AUR updates

Most Arch Linux users think the biggest risk to their system is a broken dependency.

The real threat is a compromised maintainer account on the Arch User Repository (AUR). You run a standard update, pull a hijacked package, and suddenly a malicious commit is executing root commands on your machine.

Why aren't you putting a quarantine buffer between your system and fresh AUR commits?


yup (Yay Update Protector) is a POSIX-compliant Bash wrapper for yay that enforces a strict 24-hour quarantine on every AUR package you install or update.

If a package was modified on the AUR within the last 86,400 seconds (24 hours), yup hits the brakes. Waiting a single day gives the security community time to detect, flag, and revoke compromised or malicious packages before they hit your machine.


Features

  • 24-Hour Quarantine Delay: Automatically delays updates or installs for packages updated within 24 hours (configurable).
  • Emergency Whitelist & Bypass: Apply critical zero-day security patches instantly with --emergency-update, --bypass-delay <pkg>, or persistent configuration whitelist files.
  • Automated Caching & State Logging: Caches AUR RPC responses and timestamp checks in /var/cache/yup or $XDG_CACHE_HOME/yup with configurable TTL to reduce network overhead and protect against RPC rate limits.
  • Offline / Server Resiliency: Automatically falls back to cached metadata if the AUR RPC API encounters downtime or transient network failures.
  • Transparent Yay Passthrough: Full compatibility with yay arguments (-S, -Syu, -Rns, -Si, -Qi, --noconfirm, etc.). Query, search, and removal operations bypass quarantine checks immediately.
  • Official AUR PKGBUILD: Distributable and installable directly via AUR.
  • Comprehensive Test Suite: Automated unit tests for time calculations, argument parsing, bypass rules, and caching.
  • Full Man Page: Complete Linux manual page documentation (man yup).

How It Works

yup intercepts your command-line arguments and queries the Arch Linux RPC API (https://aur.archlinux.org/rpc/) to check the exact LastModified timestamp of target packages using jq:

  1. Older than 24 hours (Safe)? Intercepted packages proceed to yay for installation.
  2. Younger than 24 hours (Quarantined)?
    • During system upgrades (-Syu), yup adds --ignore <pkg> to your yay invocation. Safe packages update normally; unvetted updates wait until their 24 hours elapse.
    • During explicit manual installs (-S <pkg>), yup halts execution before any untrusted PKGBUILD can run on your system.
  3. Official Arch repos? Packages from official repositories (core, extra, multilib) do not exist in the AUR RPC. yup recognizes repo packages and passes them through immediately without quarantine delays.

Installation

Method 1: Install from AUR (Recommended)

Once packaged or cloned from the AUR:

yay -S yup

Or using makepkg:

git clone https://aur.archlinux.org/yup.git
cd yup
makepkg -si

Method 2: Manual Installation

Prerequisites: bash, curl, jq, and yay.

sudo pacman -S bash curl jq yay

Clone the repository and install the binary and man page:

git clone https://github.com/ddroid/yup.git
cd yup
chmod +x yup
sudo install -Dm755 yup /usr/local/bin/yup
sudo install -Dm644 yup.1 /usr/local/share/man/man1/yup.1
sudo install -dm755 /var/cache/yup

Shell Alias (Optional)

Alias yay to yup in your ~/.bashrc or ~/.zshrc so you never forget to enforce quarantine:

alias yay="yup"

Usage

Use yup just like you use yay. All standard flags and package targets work out of the box.

Standard System Upgrade

Checks pending AUR updates against the 24-hour rule, ignores packages updated in the last 24h, and upgrades all safe packages:

yup -Syu

Emergency Whitelist & Bypass

When a critical zero-day vulnerability occurs and an upstream project releases an emergency patch, you can bypass the quarantine buffer:

1. Emergency bypass for all packages in current upgrade:

yup -Syu --emergency-update

2. Bypass delay for specific package(s):

# Single package
yup -S openssl-git --bypass-delay openssl-git

# Multiple packages (comma-separated or repeated)
yup -Syu --bypass-delay openssl-git,linux-custom

3. Persistent whitelist configuration: Add trusted package names (one per line) to:

  • Per-user: ~/.config/yup/whitelist
  • System-wide: /etc/yup/whitelist
  • Environment variable: export YUP_WHITELIST="pkg1,pkg2"
mkdir -p ~/.config/yup
echo "my-custom-kernel" >> ~/.config/yup/whitelist

Installing Packages

# Safe package (modified > 24 hours ago) -> installs normally
yup -S timeshift

# Unsafe package (modified < 24 hours ago) -> blocks and warns
yup -S recent-package

# Emergency install of recent package
yup -S recent-package --bypass-delay recent-package

Pass-through Commands

Removal and query commands bypass quarantine immediately:

yup -Rns timeshift
yup -Qi yay
yup -Si discord

Cache Management & Options

yup automatically caches AUR query timestamps and run status in /var/cache/yup (or $XDG_CACHE_HOME/yup / ~/.cache/yup) to eliminate redundant API requests and preserve AUR RPC quotas.

  • Inspect current run state: cat ~/.cache/yup/state.json (or /var/cache/yup/state.json)
  • Clear cache:
    yup --clear-cache
  • Run without caching:
    yup -Syu --no-cache
  • Custom quarantine delay (e.g. 12 hours = 43200s, or 3 days = 259200s):
    yup -Syu --delay 43200

CLI Options & Environment Variables

Flag / Option Description
--emergency-update Bypass 24-hour quarantine for all packages in the run
--bypass-delay <pkg> Bypass quarantine for specific package(s) (comma-separated or repeated)
--delay <seconds> Custom quarantine delay threshold (default: 86400)
--cache-dir <dir> Custom cache directory
--clear-cache Purge cached AUR timestamps and exit
--no-cache Disable reading or writing to cache for this run
-h, --help Show usage options and help summary
-v, --version Display version number (1.1.0)
Environment Variable Description
YUP_DELAY Custom quarantine delay in seconds (default: 86400)
YUP_CACHE_DIR Custom cache directory path
YUP_CACHE_TTL Cache time-to-live in seconds (default: 300)
YUP_WHITELIST Comma- or space-separated list of whitelisted packages
YUP_NO_CACHE Set to 1 to disable cache operations

Automated Tests

Run the standalone POSIX/Bash test suite:

./tests/test_yup.sh

Or using bats:

bats tests/test_yup.bats

License

MIT License. See LICENSE for details.

About

A secure, POSIX-compliant wrapper for yay that enforces a 24-hour delay on AUR package installations and updates to protect against zero-day supply chain attacks.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages