Skip to content

NO-JIRA: fix: add rootless podman runtime setup to cryptoscan commands script - #83037

Closed
fracappa wants to merge 1 commit into
openshift:mainfrom
fracappa:fca/propagate-cryptoscan-in-main-rebase
Closed

NO-JIRA: fix: add rootless podman runtime setup to cryptoscan commands script#83037
fracappa wants to merge 1 commit into
openshift:mainfrom
fracappa:fca/propagate-cryptoscan-in-main-rebase

Conversation

@fracappa

@fracappa fracappa commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

The MicroShift rebase cryptoscan CI command now supports rootless Podman execution. It creates missing user and group entries, configures subordinate UID and GID ranges, and writes registry and VFS storage settings in the user home directory.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 6, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@fracappa: This pull request explicitly references no jira issue.

Details

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fracappa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 6, 2026
@openshift-ci
openshift-ci Bot requested review from fonta-rh and jaypoulz August 6, 2026 13:19
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The cryptoscan command script now initializes rootless Podman. It creates missing user and group entries, configures subordinate ID ranges, and writes registry and VFS storage settings.

Changes

Rootless Podman setup

Layer / File(s) Summary
Configure rootless Podman
ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh
The script adds fallback user and group creation, subordinate UID/GID configuration, permissive registry search settings, and VFS storage configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of rootless Podman runtime setup to the cryptoscan commands script.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR modifies only a shell script (openshift-microshift-rebase-cryptoscan-commands.sh) that adds rootless Podman setup. No Ginkgo test files or test names are present in the changes. The check do...
Test Structure And Quality ✅ Passed The only changed file is a shell commands script; the patch adds Podman setup and no Ginkgo test code, so these test-structure requirements are not applicable.
Microshift Test Compatibility ✅ Passed The pull request changes only a cryptoscan shell script and adds no Ginkgo e2e tests or MicroShift-incompatible API references.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes only a shell script and adds no Ginkgo e2e tests, so the SNO multi-node compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only a CI/CD step registry shell script for Podman setup. No deployment manifests, operator code, controllers, or scheduling constraints are introduced.
Ote Binary Stdout Contract ✅ Passed The commit changes only a CI shell command script; no OTE Go binary, main/suite setup, or process-level stdout logging code is added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The change adds only a shell-script Podman setup; no new Ginkgo e2e test or test network behavior is present.
No-Weak-Crypto ✅ Passed The 27 added lines only configure Podman identity, UID/GID ranges, registries, and VFS storage; they add no weak algorithms, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The step has no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation setting. Its runtime image uses USER 1000; USER 0 is limited to justified image setup.
No-Sensitive-Data-In-Logs ✅ Passed The added commands trace only Podman identity, numeric ranges, and public registry names; they do not print secret contents, tokens, passwords, API keys, or PII.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@fracappa: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-microshift-main-test-rebase openshift/microshift presubmit Registry content changed
pull-ci-openshift-microshift-release-5.0-test-rebase openshift/microshift presubmit Registry content changed
periodic-ci-openshift-microshift-release-5.0-periodics-rebase-on-nightlies N/A periodic Registry content changed

Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh`:
- Line 22: Update the setup around the containers configuration directory to
ensure rootless Podman receives the pull secret through a supported
authentication path before any Podman commands run. Use REGISTRY_AUTH_FILE, pass
the auth file explicitly, or copy the secret to ${HOME}/.docker/config.json, and
ensure the configured path matches the checked-in entrypoint path.
- Around line 23-30: Update the Podman registry configuration in the heredoc to
set short-name-mode to enforcing instead of permissive. Replace any unqualified
image references used by this script with fully qualified registry, repository,
and tag or digest references; define explicit aliases only where short names are
required.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 049eb240-d9a5-4c38-a89a-c7956905fa0d

📥 Commits

Reviewing files that changed from the base of the PR and between 3abed54 and 99fb546.

📒 Files selected for processing (1)
  • ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh

echo "${PODMAN_USER}:${PODMAN_START_ID}:${PODMAN_END_ID}" > /etc/subuid
echo "${PODMAN_USER}:${PODMAN_START_ID}:${PODMAN_END_ID}" > /etc/subgid

mkdir -p "${HOME}/.config/containers"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 4 \
  '\.pull-secret\.json|REGISTRY_AUTH_FILE|--authfile|auth\.json|\b(podman|buildah|skopeo)\b' \
  scripts \
  ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh || true

Repository: openshift/release

Length of output: 3095


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== step command file =="
cat -n ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh

echo
echo "== entrypoint file =="
if [ -f ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/scripts/auto-rebase/rebase_job_entrypoint.sh ]; then
  echo "FOUND"
  cat -n ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/scripts/auto-rebase/rebase_job_entrypoint.sh
else
  echo "MISSING"
fi

echo
echo "== related rebase scripts =="
fd -i 'rebase|token|registry|auth|podman' ci-operator/scripts ci-operator/step-registry/openshift/microshift/rebase 2>/dev/null || true

echo
echo "== focused search =="
rg -n -C 3 \
  '\b(rebase_job_entrypoint|fetch_tools|pull-secret|REGISTRY_AUTH_FILE|--authfile|auth\.json|podman|buildah|skopeo|polaris|secret).*' \
  ci-operator/scripts ci-operator/step-registry/openshift/microshift 2>/dev/null || true

Repository: openshift/release

Length of output: 50373


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== step metadata/yaml relevant credentials =="
cat -n ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-ref.yaml
echo
cat -n ci-operator/step-registry/openshift/microshift/rebase/openshift-microshift-rebase-ref.yaml

echo
echo "== repo top-level scripts =="
git ls-files scripts/* scripts/auto-rebase/* 2>/dev/null | sed -n '1,120p'
echo

echo "== exact entrypoint paths in repo =="
git ls-files | rg 'scripts/auto-rebase/rebase_job_entrypoint\.sh|fetch_tools\.sh|cryptoscan|microshift-rebase' | sed -n '1,200p'

Repository: openshift/release

Length of output: 3732


🌐 Web query:

Podman authfile default XDG_RUNTIME_DIR containers auth.json fallback $HOME/.docker/config.json REGISTRY_AUTH_FILE

💡 Result:

In Podman, the authentication file mechanism is designed to handle credentials for registry access with specific default behaviors and fallback logic [1][2]. Default Authentication File Location On Linux, the default path for reading and writing authentication credentials is ${XDG_RUNTIME_DIR}/containers/auth.json [1][3][4]. Because XDG_RUNTIME_DIR is typically located in /run (an ephemeral directory), credentials stored here are not persistent across system reboots [1][5][6]. On macOS and Windows, the default path is $HOME/.config/containers/auth.json [1][2]. Fallback Logic When Podman requires authentication, it performs a search in the following order: 1. It first checks the file specified by the --authfile flag, if provided [1][7]. 2. If no authfile is specified, it looks for credentials in the default path: ${XDG_RUNTIME_DIR}/containers/auth.json (on Linux) [1][2]. 3. If credentials are not found or are invalid in the default path, Podman falls back to checking $HOME/.docker/config.json, which is the standard configuration file used by Docker [1][4][2]. Note that this fallback is read-only; Podman does not write new credentials to the Docker config file [8]. Environment Variable Override You can override the default authentication file path by setting the REGISTRY_AUTH_FILE environment variable [3][7][2]. Setting this variable allows you to specify a persistent path or a custom location for your credentials [1][6]. Example of overriding the path: export REGISTRY_AUTH_FILE=$HOME/.config/containers/auth.json

Citations:


Verify the rootless Podman authentication handoff.

${HOME}/.pull-secret.json is not a Podman default path, and the checked-in entrypoint path is missing. If the rootless Podman toolchain runs before this secret is copied, private registry pulls can fail unless REGISTRY_AUTH_FILE is set, --authfile is passed for each Podman invocation, or ${HOME}/.docker/config.json is used as the Docker fallback.

[operational_advice]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh`
at line 22, Update the setup around the containers configuration directory to
ensure rootless Podman receives the pull secret through a supported
authentication path before any Podman commands run. Use REGISTRY_AUTH_FILE, pass
the auth file explicitly, or copy the secret to ${HOME}/.docker/config.json, and
ensure the configured path matches the checked-in entrypoint path.

Comment on lines +23 to +30
cat > "${HOME}/.config/containers/registries.conf" <<PODMAN_EOF
unqualified-search-registries = [
"registry.access.redhat.com",
"registry.redhat.io",
"docker.io"
]
short-name-mode = "permissive"
PODMAN_EOF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 4 \
  '\b(podman|buildah|skopeo)\b' \
  scripts \
  ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh || true

Repository: openshift/release

Length of output: 1662


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== file outline / relevant sections =="
sed -n '1,220p' ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh

echo
echo "== image references and registry aliases in step registry dirs =="
rg -n 'short-name-mode|registries\.conf|unqualified-search-registries|alias|microshift|podman|buildah|skopeo|imagepull|quay|registry\.access\.redhat\.com|registry\.redhat\.io|docker\.io' ci-operator/step-registry/openshift/microshift/rebase -S || true

echo
echo "== deterministic short-name alias/order behavior in step script by static parse =="
python3 - <<'PY'
from pathlib import Path
p = Path('ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh')
s = p.read_text()
start = s.index('PODMAN_EOF')
print(s[start:start+300])
for tool in ['podman','buildah','skopeo']:
    print(f'uses {tool}:', tool in s)
    idx = s.find(tool)
    if idx >= 0:
        lines=s[idx:idx+300].splitlines()
        print('line near first usage:', lines[0])
PY

Repository: openshift/release

Length of output: 8618


🌐 Web query:

Podman registries.conf unqualified-search-registries short-name-mode permissive enforcing aliases

💡 Result:

In Podman, the configuration of container registry lookups is managed within the registries.conf file [1][2]. When a container image is pulled using a "short name" (an image reference that does not include a registry domain, such as ubi10 instead of registry.access.redhat.com/ubi10), Podman resolves the image using the following mechanisms [3][4]: Aliases The [aliases] table in registries.conf maps short names directly to fully qualified image references [1][2]. If a matching alias is found, Podman uses it immediately, bypassing the unqualified-search-registries list [3][5]. Aliases provide administrators with control over image sources, helping to prevent potential spoofing risks [1][2]. If both a manual configuration and a machine-generated alias file exist, the machine-generated file has precedence [3][1][5]. Unqualified-search-registries This is a list of registries that Podman queries in order when a short name is used and no alias is found [1][6]. If multiple registries are listed, Podman attempts to pull from them sequentially until the image is found [4][6]. Short-name-mode This setting defines how Podman handles ambiguity when a short name is not aliased and multiple registries are configured in unqualified-search-registries [3][4]. The three modes are [1][4]: enforcing: If no alias exists and more than one search registry is configured, Podman prompts the user to select a registry if running in an interactive terminal (TTY) [3][1]. If non-interactive (e.g., in a CI/CD pipeline), Podman will return an error to prevent ambiguous or insecure pulls [3][4]. If the pull succeeds, the choice is saved as an alias for future use [1][2]. permissive: Behaves like enforcing when interactive (prompts the user and records the alias) [3][4]. However, if non-interactive, Podman does not error; instead, it falls back to the legacy behavior of searching all configured unqualified-search-registries in order [3][1]. No alias is recorded in this mode [1][2]. disabled: Podman ignores alias matching and always searches all configured registries in the order specified [1][4]. This reflects the behavior of older versions of Podman [4]. By default, if short-name-mode is not specified, it defaults to permissive mode [3][5]. New installations are often configured to use enforcing mode to enhance security [4].

Citations:


Do not allow permissive short-name image resolution.

With unqualified-search-registries = ["registry.access.redhat.com", "registry.redhat.io", "docker.io"] and short-name-mode = "permissive", a non-interactive Podman image pull for an unqualified short name uses the next configured registry when the first registry is unavailable. CI image sources should not depend on fallback lookup order. Use fully qualified image references and change the mode to enforcing; add explicit aliases if short names are required.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@ci-operator/step-registry/openshift/microshift/rebase/cryptoscan/openshift-microshift-rebase-cryptoscan-commands.sh`
around lines 23 - 30, Update the Podman registry configuration in the heredoc to
set short-name-mode to enforcing instead of permissive. Replace any unqualified
image references used by this script with fully qualified registry, repository,
and tag or digest references; define explicit aliases only where short names are
required.

@fracappa

fracappa commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of: openshift/microshift#7051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants