getsops / getsops/sops

YAML processing always strips quotes from literals

Open
#949 13 comments 5 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

I have reviewed other issues regarding preserving original file format and apreciate that retaining exact formatting of the source YAML is difficult. As a workaround, it would be very useful to be able to allow to force YAML output to always be quoted.

Our use case is Dropwizard YAML config file with env var substitution. Original file has quotes around passwords, which can be any special characters. After processing with SOPS they are gone and file ends up being invalid if password starts with any of the YAML control characters. Escaping injected values doesn't help since the quotes are already missing.

database:
user: "${PGUSER:-justMe}"
password: "${PGPASSWORD:-SuperSecret123}"

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

No file or test is named in the issue. Start by locating SOPS's YAML output and serialization path, then reproduce the Dropwizard example with quoted values. Done means a configurable way to force YAML scalar output to remain quoted, with a regression test covering values that begin with YAML control characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.