Skip to content

[Question] Encrypt using the same data key #2008

@shtlrs

Description

@shtlrs

I am building a custom python wrapper over sops (called via subprocess), and i currently am following this approach

  1. Decrypt the file to stdout
  2. Convert that yaml content into a python dict
  3. Operate on the dict in memory
  4. Encrypt it and dump it back to the same file path

This works great and all but, it will always re-encrypt the entire file (and uses a different data key), which makes sense.

The reason why I'm doing it like this is because it's easier to operate on a dict rather than having to do type conversions, dump as json string, etc.

I am wondering, is there a reasonable way I could do this where sops would use the same data key to encrypt the context again before saving it to the final file path ?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions