question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Error parsing multi-line secrets because the output contains "\n"

See original GitHub issue

Describe the bug We currently have a vault secret that is a multi-line exported certificate. When setting it to an env variable, the output of vault-action contains \n instead of new lines.

To Reproduce Store a multi line pub key, eg:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
NrRFi9wrf+M7Q==

Notice that the key will be returned as

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU\nGPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3\nPbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA\nNrRFi9wrf+M7Q==

Expected behavior Since the key is being used to sign an app it needs to be returned without the line escaping.

By adding a result = JSON.parse(result) before removing the quote we are able to get the expected value and our code sign task succeeds but I doubt that’s the correct fix. https://github.com/hashicorp/vault-action/blob/master/src/secrets.js#L75

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonodonnellcommented, Jan 4, 2021

Sorry for the delay, we have a company wide shutdown for a few weeks in December and are just returning. We’ll take a look at this soon!

0reactions
jasonodonnellcommented, Jan 11, 2021

Fixed per #173.

Read more comments on GitHub >

github_iconTop Results From Across the Web

1649075 – Multiline secrets are not correctly parsed
The offending line appears to be: <FIRST LINE OF THE SSH KEY> <SECOND LINE OF THE SSH KEY> ^ here ``` This happens...
Read more >
Eclipse CDT Custom Compiler Error Parsing Plugin
I have a make file setup which is nice, but I'd like IDE integration with the error / warning output of my compiler....
Read more >
How do you fix the Azure DevOps Error: Secrets cannot ...
##[error]Error: Secrets cannot contain multiple lines. Looking in Secrets Manager in the AWS Console will not reveal the problem.
Read more >
Multi-line secret value - Drone
In fact, If the value happens to be multi-line, the YAML should have it in quotes. Otherwise it should result in parsing error....
Read more >
Resolve Secrets Manager secret access errors after ... - AWS
How can I resolve issues accessing an encrypted AWS Secrets Manager secret? ... Because AWS KMS managed key policies can't be edited, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found