mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-12 09:33:23 +00:00
Not one action reference in this repository was pinned. Every uses: line named a mutable tag, and one named a branch. That includes the jobs holding the AUR deploy key, the jobs with release write scope, and the packaging jobs that run with a signing key in the environment, so whoever controls one of those action repositories could repoint a tag into a job holding our credentials. Sixty-two of the sixty-six references are now full commit SHAs with the original tag kept as a trailing comment, so a reader can still tell which release a pin is. Each SHA was resolved from the upstream peeled tag. Four references are left unpinned and justified in one place rather than silently: two actions select the tool they install from the ref name itself, so a bare SHA hands them a hex string where a toolchain name belongs and the step fails. Pinning those means moving the selection into with:, which changes what resolves, and that is a separate decision from pinning. A guard enforces the form on every sweep, wired into the parity job and the local runner beside the existing checkers. It accepts only owner/repo@40-hex with a mandatory trailing comment, treats an unreadable tree as exit 2 rather than as a pass, and its header names what it does not cover: the actions that pinned actions themselves invoke, the pip and cargo installs that are version pinned at best, and anything fetched at run time. The sharper hole was not the tags. The OpenWrt packaging workflow fetched a helper binary straight from a release URL with no verification, in two jobs that hold a signing key, which is code execution from a third-party host into a credentialed job and needs nobody to retag anything. That download now goes through a shared script with per-architecture pinned SHA-256 constants, modelled on the zig block already in that workflow. Upstream publishes no checksum document, so the provenance comment records the asset URL and the date the hashes were taken by downloading rather than pretending they were verified against a published sum.
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
name: AUR Publish (fips-git)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'packaging/aur/PKGBUILD-git'
|
|
- 'packaging/aur/fips.sysusers'
|
|
- 'packaging/aur/fips.tmpfiles'
|
|
- 'packaging/aur/fips.install'
|
|
|
|
jobs:
|
|
aur-publish-fips-git:
|
|
name: Publish fips-git to AUR
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
|
|
- name: Patch PKGBUILD-git b2sums for local assets
|
|
run: |
|
|
set -euo pipefail
|
|
SYSUSERS_SUM=$(b2sum packaging/aur/fips.sysusers | awk '{print $1}')
|
|
TMPFILES_SUM=$(b2sum packaging/aur/fips.tmpfiles | awk '{print $1}')
|
|
if [ -z "$SYSUSERS_SUM" ] || [ -z "$TMPFILES_SUM" ]; then
|
|
echo "Failed to compute asset b2sums"; exit 1
|
|
fi
|
|
awk -v s1="$SYSUSERS_SUM" -v s2="$TMPFILES_SUM" '
|
|
/^b2sums=\(/ { in_block=1; count=0 }
|
|
in_block {
|
|
count++
|
|
if (count == 2) sub(/[a-f0-9]{128}/, s1)
|
|
if (count == 3) sub(/[a-f0-9]{128}/, s2)
|
|
if ($0 ~ /\)/) in_block=0
|
|
}
|
|
{ print }
|
|
' packaging/aur/PKGBUILD-git > packaging/aur/PKGBUILD-git.new
|
|
mv packaging/aur/PKGBUILD-git.new packaging/aur/PKGBUILD-git
|
|
echo "Patched PKGBUILD-git b2sums:"
|
|
awk '/^b2sums=\(/,/\)$/' packaging/aur/PKGBUILD-git
|
|
|
|
- name: Publish to AUR
|
|
uses: KSXGitHub/github-actions-deploy-aur@abe8ac26b51011c88be58c8809fd2ac674068ea5 # v4.1.2
|
|
with:
|
|
pkgname: fips-git
|
|
pkgbuild: packaging/aur/PKGBUILD-git
|
|
updpkgsums: false
|
|
assets: |
|
|
packaging/aur/fips.sysusers
|
|
packaging/aur/fips.tmpfiles
|
|
packaging/aur/fips.install
|
|
commit_username: ${{ github.repository_owner }}
|
|
commit_email: ${{ secrets.AUR_EMAIL }}
|
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
|
commit_message: "Update PKGBUILD-git (${{ github.sha }})"
|