Skip to content
Closed
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
12 changes: 8 additions & 4 deletions scripts/devenv-builder/configure-composer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ install_and_configure_composer() {
local -r version_id_major="$(awk -F. '{print $1}' <<< "${version_id}")"

"${DNF_RETRY}" "install" "osbuild osbuild-composer"
"${DNF_RETRY}" "install" \
"git composer-cli ostree rpm-ostree \
cockpit-composer bash-completion podman runc genisoimage \

local packages="git composer-cli ostree rpm-ostree \
cockpit-composer bash-completion podman runc \
createrepo yum-utils selinux-policy-devel jq wget lorax rpm-build \
containernetworking-plugins expect httpd-tools vim-common"
python3-psutil expect httpd-tools vim-common"
if [[ "${version_id_major}" -lt 10 ]]; then
packages+=" genisoimage containernetworking-plugins"
fi
"${DNF_RETRY}" "install" "${packages}"

# The mock utility comes from the EPEL repository
"${DNF_RETRY}" "install" "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${version_id_major}.noarch.rpm"
Expand Down
9 changes: 8 additions & 1 deletion test/bin/pyutils/build_bootc_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import platform
import re
import subprocess
import sys
import time
import traceback
Expand Down Expand Up @@ -219,7 +220,13 @@ def extract_container_images(version, repo_spec, outfile, dry_run=False):

# Construct and execute the dnf download command
dnf_command = ["dnf", "download"] + dnf_options + [f"microshift-release-info-{version}"]
if common.run_command(dnf_command, dry_run) is not None:
try:
result = common.run_command(dnf_command, dry_run)
except subprocess.CalledProcessError:
common.print_msg(f"Warning: failed to download release-info for {version} from {repo_spec}, skipping")

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid logging raw repo_spec in warnings.

Line 226 logs repo_spec verbatim; this can expose internal hostnames/paths in CI logs. Log a sanitized label instead.

🔧 Proposed fix
-        common.print_msg(f"Warning: failed to download release-info for {version} from {repo_spec}, skipping")
+        safe_repo = common.basename(repo_spec) if repo_spec else "<default>"
+        common.print_msg(
+            f"Warning: failed to download release-info for {version} from {safe_repo}, skipping"
+        )

As per coding guidelines, “Flag logging that may expose ... internal hostnames ... or customer data”; logging repo_spec directly can leak internal repository endpoints.

🤖 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 `@test/bin/pyutils/build_bootc_images.py` at line 226, The warning message in
the common.print_msg call logs the raw repo_spec value, which can expose
internal hostnames and paths in CI logs. Instead of logging the full repo_spec
directly, replace it with a sanitized or redacted label that provides enough
context for debugging without revealing sensitive infrastructure details. This
aligns with the coding guideline to avoid logging internal hostnames or
sensitive endpoint information.

Source: Coding guidelines

common.popd()
return
if result is not None:
images_output = get_container_images(str(image_path), version)
with open(outfile, "a") as f:
f.write(images_output.replace(',', '\n'))
Expand Down