Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ base_images:
hypershift-operator:
name: hypershift-operator
namespace: hypershift
tag: latest
tag: "4.21"
postgresql-13-c9s:
name: postgresql
namespace: ci
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ then
scp "${SSHOPTS[@]}" "${SHARED_DIR}/assisted-ztp-config" "root@${IP}:assisted-ztp-config"
fi

scp "${SSHOPTS[@]}" "${CLUSTER_PROFILE_DIR}/pull-secret" "root@${IP}:/root/pull-secret"

Comment on lines +29 to +30

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

Remove the remote pull-secret after use.

This newly copied credential remains at /root/pull-secret after the SSH session, including when deployment fails. Add failure-safe cleanup (for example, a remote trap), and restrict the file to mode 600 while it exists.

🤖 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/assisted/baremetal/operator/capi/assisted-baremetal-operator-capi-commands.sh`
around lines 29 - 30, Update the pull-secret transfer command to ensure the
remote /root/pull-secret is mode 600 while present and is removed failure-safely
after use, including when deployment or the SSH session fails; use a remote trap
or equivalent cleanup tied to the operation.

tar -czf - . | ssh "${SSHOPTS[@]}" "root@${IP}" "cat > /root/assisted-service.tar.gz"

# shellcheck disable=SC2087
Expand Down Expand Up @@ -65,6 +67,8 @@ then
source /root/assisted-ztp-config
fi

oc image info "\${HYPERSHIFT_IMAGE}" -a /root/pull-secret
oc image info "\${ASSISTED_OPENSHIFT_INSTALL_RELEASE_IMAGE}" -a /root/pull-secret
./deploy_capi_cluster.sh

EOF