Host/username secret values contain trailing newlines, sanitization fix breaks SSH key

オープン 初心者向け
#817 コメント 12 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

@abdulazeem-tk4vr がすでに取り組んでいます。

2026年6月17日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
aws, shell

調査の方向性

すべての tkn/infra-aws-*.yaml タスクにあるホストアクセス用シークレットのコマンドを調査し、host、username、id_rsa の処理を比較します。host と username の値に末尾の改行が含まれなくなっている一方で、SSH キーは PEM の改行を保持していることを確認し、その後、SSH タスクがホスト名を解決し、キーを受け入れることを検証します。

索引モデルが issue の本文から書いたものです。

説明

Commit 83fe6f288 added tr -d '\n\r' to sanitize host and username values before base64 encoding in the host-access secret. This fixed trailing newlines in host/username but also stripped newlines from id_rsa, breaking the PEM format.

Commit 0e675cb76 reverted the fix entirely, which brought back the trailing newline problem — SSH fails with Could not resolve hostname because the host value includes \n.

Neither state works:

  • main (reverted): valid SSH key, broken hostname
  • 83fe6f288: clean hostname, broken SSH key

The fix is to sanitize host and username but not id_rsa:

host: $(cat /opt/host-info/host | tr -d '\n\r' | base64 -w0)
username: $(cat /opt/host-info/username | tr -d '\n\r' | base64 -w0)
id_rsa: $(cat /opt/host-info/id_rsa | base64 -w0)

Affects all tkn/infra-aws-*.yaml tasks.

主要言語
Go
スター
25
フォーク
41
平均マージ
5日 3時間
マージ済み PR(30日)
16

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

redhat-developer/mapt のほかの issue

redhat-developer/mapt の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。