Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/scripts/install-podman.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Pin and install podman, working around a crun incompatibility on some
# runner images.
#
# Runner images occasionally pre-install podman 5.x paired with a crun too
# old to support it, breaking sandbox creation with "crun: unknown version
# specified". Pin to the 4.x series, which matches the crun shipped on these
# images, until GitHub Actions runner images ship a compatible crun pairing.
# `apt-get install -y podman` alone does not downgrade an already-installed
# newer version, so the pin's Pin-Priority authorizes the downgrade and
# --allow-downgrades permits apt to execute it.
#
# See #5733. Remove this pin once runner images ship crun >= 1.15
# (podman 5.x's requirement) as standard.
#
# Usage:
# .github/scripts/install-podman.sh
set -euo pipefail

sudo install -d /etc/apt/preferences.d
printf 'Package: podman\nPin: version 4.*\nPin-Priority: 1001\n' \
| sudo tee /etc/apt/preferences.d/podman-pin >/dev/null
sudo apt-get update
sudo apt-get install -y --allow-downgrades podman

installed_version="$(podman --version)"
case "${installed_version}" in
*"version 4."*) ;;
*)
echo "::error::Failed to pin podman to the 4.x series (see #5733); got: ${installed_version}"
exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] injection

The ::error:: workflow command and the final echo (line 35) interpolate ${installed_version} (from podman --version) without sanitizing for GHA workflow command sequences. The value originates from a system-installed binary and is not directly attacker-controlled, making this a defense-in-depth observation rather than a practical vulnerability.

;;
esac

echo "${installed_version}"
4 changes: 1 addition & 3 deletions .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,7 @@ jobs:

- name: Install Podman
if: steps.changes.outputs.relevant != 'false'
run: |
sudo apt-get update
sudo apt-get install -y podman
run: .github/scripts/install-podman.sh

- name: Configure rootless Podman
if: steps.changes.outputs.relevant != 'false'
Expand Down
5 changes: 1 addition & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,7 @@ runs:

- name: Install Podman
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y podman
podman --version
run: "$GITHUB_ACTION_PATH/.github/scripts/install-podman.sh"

- name: Configure rootless Podman
shell: bash
Expand Down
1 change: 1 addition & 0 deletions internal/scaffold/vendormanifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ var vendoredDefaultsInfraPaths = []string{
".github/actions/setup-gcp/action.yml",
".github/actions/validate-enrollment/action.yml",
".github/scripts/install-openshell.sh",
".github/scripts/install-podman.sh",
".github/scripts/openshell-version.sh",
}

Expand Down
Loading