getsops / getsops/sops

SOPS cannot handle multi-line .env files

Open
#965 0 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
23.1k
Forks
1.1k
Avg merge
1d 11h
Merged PRs (30d)
9

Description

The parser that SOPS uses seems to have a different interpretation of what constitutes a dotenv file from what how bash views is. This relates in particular to encrypting/decrypt dotenvs that have multiline environement variables.

However, SOPS is not able to handle encrypting this file. Calling sops -e --pgp xxxxxxxx my-vars.env will produce the following error:

Error unmarshalling file: invalid dotenv input line: some values

The parser is trying to interpret the second line of BAR (which is "some values") as another key-value pair, which does not work.

This is a pretty major inconsistency.

Contributor guide

Open the contributing guide

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

Reproduce the issue with a dotenv file containing a multiline BAR value, then run sops -e --pgp xxxxxxxx my-vars.env and inspect the dotenv parser reached by that command. Done means SOPS can encrypt and decrypt dotenv files with multiline environment variables without reporting an invalid dotenv input line.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, devops, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.