1.3.7 • Published 8 months ago

@figedi/sops v1.3.7

Weekly downloads
25
License
SEE LICENSE IN LI...
Repository
github
Last release
8 months ago

SOPS

Minimal Sops re-implementation for decrypting sops files directly w/ node.js

Why?

I needed a quick way to decrypt sops-encoded files loaded w/ node.js without going through child-process hacks

Features

This library in no way supports all sops-versions and is only tested on 3.4.x. It does not implement encoding, although this could probably easily added. An example, not complete version is found in sopsUtils in the specFiles.

Use this at your own risk I've used this in several production projects in a k8s-context in GCP (through GCP KMS).

Usage

Example to decrypt an encrypted file with a GCP-KMS keyring:

import { decryptSopsJsonViaGCPKMS, createKMSManagementClient } from "@figedi/sops/kms"
const someEncryptedJson = require("secrets.enc.json");
const client = createKMSManagementClient("your-project-id", "optional-path-to-mounted-svc-account-json");

const decrypted = await decryptSopsJsonViaGCPKMS(client, someEncryptedJson); 

Note: When providing an encrypted-json with a MAC, the mac will be used and checked. If the decrypted-json does not match the MAC, a ChecksumMismatchError is thrown

Example to test whether file is encrypted w/ gcp kms

import { canDecryptViaKMS } from "@figedi/sops/kms"
const someEncryptedJson = require("secrets.enc.json");
const isDecryptable = canDecryptViaKMS(someEncryptedJson)
1.3.7

8 months ago

1.3.6

8 months ago

1.3.5

11 months ago

1.3.4

11 months ago

1.3.3

11 months ago

1.3.2

11 months ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.2.0

4 years ago