redhat-developer / redhat-developer/mapt

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

Open Beginner friendly
#817 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
24
Forks
36
Avg merge
6d 13h
Merged PRs (30d)
8

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the host-access secret commands in all tkn/infra-aws-*.yaml tasks and compare the handling of host, username, and id_rsa. Verify that host and username values no longer contain trailing newlines while the SSH key retains its PEM newlines, then validate that the SSH task resolves the hostname and accepts the key.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, shell
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.