Skip to content

Commit 6e213e7

Browse files
nsheapsclaude
andcommitted
fix(1password-sync): remove 2>&1 from op read, add yq checksum verification
- Remove `2>&1` from `op read` to prevent error messages being written as secret values (P1 security fix) - Add SHA-256 checksum verification for yq binary download (P2 supply chain) - Install yq to $RUNNER_TEMP instead of /usr/local/bin (P3 permissions) - Move ::add-mask:: comment to clarify immediate masking after read Co-Authored-By: Claude Code (User Settings, in: /Users/nathan.heaps/src/nsheaps/agent-team) <noreply@anthropic.com>
1 parent 52e6249 commit 6e213e7

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/actions/1password-secret-sync/action.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ runs:
7171
if ! command -v yq &> /dev/null; then
7272
echo "::group::Installing yq"
7373
YQ_VERSION="v4.44.1"
74-
curl -fsSL "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" -o /usr/local/bin/yq
75-
chmod +x /usr/local/bin/yq
74+
YQ_SHA256="6dc2d0cd4e0caca5aeffd0d784a48263591080e4a0895abe69f3a76eb50d1ba3"
75+
YQ_INSTALL_DIR="${RUNNER_TEMP:-/tmp}/yq-bin"
76+
mkdir -p "$YQ_INSTALL_DIR"
77+
curl -fsSL "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" -o "$YQ_INSTALL_DIR/yq"
78+
echo "$YQ_SHA256 $YQ_INSTALL_DIR/yq" | sha256sum -c
79+
chmod +x "$YQ_INSTALL_DIR/yq"
80+
export PATH="$YQ_INSTALL_DIR:$PATH"
7681
echo "::endgroup::"
7782
fi
7883
@@ -88,14 +93,14 @@ runs:
8893
echo "::group::Secret: $name (source: ${source:0:20}..., $target_count targets)"
8994
9095
# Read secret from 1Password
91-
value=$(op read "$source" 2>&1) || {
96+
value=$(op read "$source") || {
9297
echo "::error::Failed to read secret '$name' from $source"
9398
errors=$((errors + 1))
9499
echo "::endgroup::"
95100
continue
96101
}
97102
98-
# Mask the value in logs
103+
# Mask the value in logs immediately after reading
99104
echo "::add-mask::$value"
100105
echo "Successfully read secret '$name' from 1Password"
101106

0 commit comments

Comments
 (0)