getsops / getsops/sops

Inconsistency with very large hex numbers between sops and ansible

Open
#1,003 2 comments 1 reaction 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

If line contains very long hex string, sops strips away quotas from it (because it thinks that there is no type problems and 0x...... is a string), but Ansible (because Python has no limit for integers) thinks it's a number.

The problem:

foo: "0x0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"

on the next edit become:

foo: 0x0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF

(no quotes). Ansible see this as a number and write (instead of proper 0x.. form) 514631507721405306298073637848375664226723355710112857507800679889911926255 into file content.

Sops should preserve quotes around strings.

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 the quoted long hexadecimal YAML value shown in the report, then trace SOPS's YAML parsing and serialization path. Compare the next edit with Ansible's interpretation; done means the value remains quoted and is not converted to a decimal integer.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, go, python
Domain
devops, security
Issue type
Bug
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.