Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ssh private key format issue #317

Closed

Conversation

presPetkov
Copy link
Contributor

Link to issue - #299

As per the issue, the ssh private keys are in an invalid format coming from the AWS Secrets Manager. I have tried it on both Windows and Linux worker nodes and a Linux Jenkins server and the issue exists on all of them. The change suggested in this PR fixes the carriage returns so the ssh private key format is valid. I have modified the StringSupplier, as that is only used for the sshUserPrivateKey option.

Testing done

AWS Secret:
image

Before:

1. Jenkins can't access github using the private key:
image

2. When the file is taken down onto a node, it has an invalid format:
Capture1

You can see the ^M in the editor

After:
1. Jenkins has access to github using the private key:
image

  1. When the file is taken down onto a node, it has a valid format:
    Capture2

Other secrets work as expected
image

Username and password:

image

Secret string:
image

Submitter checklist

Preview Give feedback

@presPetkov presPetkov marked this pull request as draft March 22, 2024 09:37
@presPetkov presPetkov closed this Mar 22, 2024
@presPetkov
Copy link
Contributor Author

This issue only seems to exist when using the AWS UI. Using the aws cli to create the secret, the issue appears to be gone. I am going to do some further testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant