Skip to content

Document that exec-env does not work when encrypted values are of types other than strings #1167

@spencerwilson

Description

@spencerwilson

The following runs fine:

{
        "database_password": "123"
}

but if you switch to

{
        "database_password": 123
}

you get

% sops exec-env secrets/service-accounts/out.json 'echo secret: $database_password'
panic: interface conversion: interface {} is float64, not string

goroutine 1 [running]:
go.mozilla.org/sops/v3/stores/dotenv.(*Store).EmitPlainFile(0x103f852a8, {0x14000195dd0, 0x1, 0x1})
	/home/runner/work/sops/sops/stores/dotenv/store.go:122 +0x328
main.decrypt({{0x1038b89b0, 0x1400009aae0}, {0x12b2188d0, 0x103f852a8}, {0x1038c4358, 0x103f852a8}, {0x16d2ab48e, 0x21}, 0x0, {0x0, ...}, ...})
	/home/runner/work/sops/sops/cmd/sops/decrypt.go:47 +0x178
main.main.func1(0x140001de420)
	/home/runner/work/sops/sops/cmd/sops/main.go:156 +0x204
gopkg.in/urfave/cli%2ev1.HandleAction({0x10371e0c0, 0x103896d10}, 0x140001de420)
	/home/runner/work/sops/sops/vendor/gopkg.in/urfave/cli.v1/app.go:490 +0x84
gopkg.in/urfave/cli%2ev1.Command.Run({{0x1033f7e37, 0x8}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x103438657, 0x45}, {0x0, ...}, ...}, ...)
	/home/runner/work/sops/sops/vendor/gopkg.in/urfave/cli.v1/command.go:210 +0x80c
gopkg.in/urfave/cli%2ev1.(*App).Run(0x14000103040, {0x140001a8040, 0x4, 0x4})
	/home/runner/work/sops/sops/vendor/gopkg.in/urfave/cli.v1/app.go:255 +0x5cc
main.main()
	/home/runner/work/sops/sops/cmd/sops/main.go:989 +0x2fe4

This is not documented in the section on exec-env - https://github.com/mozilla/sops/tree/e1edc059487ddd14236dfe47267b05052f6c20b4#passing-secrets-to-other-processes - and maybe should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions