1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00
Commit Graph

1062 Commits

Author SHA1 Message Date
Martin Litvaj
99adfaed0b Rename LoadForFile to LoadCreationRuleForFile (#663) 2020-05-04 22:58:45 +02:00
Vaibhav Kaushik
e4abd871c7 Add HashiCorp Vault support (#655)
* feat: initial adding of vualt transit backend to sops
initial work on integration
feat(vault): added cli coomands working for vualt"

fix(vault): fixed config with correct tests

fix(vault): added vault to keygroup and to keyservice server

fixed metadata load

* feat(docs): added docs in README.md and in command help

fix(doc): fix rst formatting"

fix(doc): fix rst formatting

* fix(vault): addressed typos and fixes from autrilla

feat(cli): moved vault to hc-vault naming

* fix(test): typo while rebasing

* fix typos and imporve error messages for vault kms

* rename package from vault to hcvault

* refactor vault keysource url validation

* add negative test cases  for vault keysource

* add hc vault transit config option via objects
additional to URIs

* remove vault_example.yml

* streamline key name to snake case

* rename `BackendPath` to `EnginePath` for hc vault

* correction in hc-vault-transit commands

Signed-off-by: vnzongzna <github@vaibhavk.in>

* resolving conflict

Signed-off-by: vnzongzna <github@vaibhavk.in>

* Apply suggestions from code review

Co-Authored-By: Adrian Utrilla <adrianutrilla@gmail.com>

* allowing only hc_vault_transit_uri as input

Co-Authored-By: gitirabassi
Co-Authored-By: ldue
Signed-off-by: vnzongzna <github@vaibhavk.in>

Co-authored-by: gitirabassi <giacomo@tirabassi.eu>
Co-authored-by: ldue <larsduennwald@gmail.com>
Co-authored-by: Vaibhav Kaushik <vaibhavkaushik@vaibhavka-ltm1.internal.salesforce.com>
Co-authored-by: Adrian Utrilla <adrianutrilla@gmail.com>
2020-05-04 21:27:51 +02:00
Martin Litvaj
8f93ee37a7 #664 remove outdated contact info (#668) 2020-04-28 21:56:05 +02:00
Martin Litvaj
89d77b2082 Fix #611 - Dont break when config file exists but CreationRules are empty (#662) 2020-04-24 23:54:06 +02:00
AJ Bahnken
8b14d4e86f Merge pull request #651 from max-sixty/patch-1
Readme tweak
2020-04-15 17:37:17 -07:00
AJ Bahnken
45b67e7db1 Merge pull request #649 from mozilla/jvehent-patch-3
Update container to go 1.14
2020-04-15 17:36:35 -07:00
Maximilian Roos
1f37a83366 Readme small tweak
Reference `run` python3 function
Use rst ticks
2020-04-12 17:47:18 -04:00
AJ Bahnken
007c9b0c80 Merge pull request #645 from mozilla/jvehent-patch-2
Update authors
2020-04-09 10:06:40 -07:00
Julien Vehent
1aa3647b53 Update base container to Go 1.14 2020-04-03 16:34:48 -04:00
Julien Vehent
273e4bff9d Update authors 2020-03-30 10:31:31 -04:00
Noel Cower
84816c31be Add support for decoding JSON arrays of arrays (#642)
Add support for decoding JSON arrays of arrays by handling, during
slice decoding, when the next token is an array opening. This produces
nested []interface{} slices.

Closes #640.
2020-03-20 22:53:37 +01:00
Spencer Judd
4507019a33 Add standard newline/quoting behavior to dotenv store (#622)
Rationale
=========

The dotenv store as it exists right now performs splitting on newlines
to determine where a new key-value pair or comment begins. This works
remarkably well, up until you need to handle values that contain
newlines.

While I couldn't find an offical dotenv file format spec, I sampled a
number of open-source dotenv parsers and it seems that they typically
apply the following rules:

Comments:

* Comments may be written by starting a line with the `#` character.

Newline handling:

* If a value is unquoted or single-quoted and contains the character
  sequence `\n` (`0x5c6e`), it IS NOT decoded to a line feed (`0x0a`).

* If a value is double-quoted and contains the character sequence `\n`
  (`0x5c6e`), it IS decoded to a line feed (`0x0a`).

Whitespace trimming:

* For comments, the whitespace immediately after the `#` character and any
  trailing whitespace is trimmed.

* If a value is unquoted and contains any leading or trailing whitespace, it
  is trimmed.

* If a value is either single- or double-quoted and contains any leading or
  trailing whitespace, it is left untrimmed.

Quotation handling:

* If a value is surrounded by single- or double-quotes, the quotation marks
  are interpreted and not included in the value.

* Any number of single-quote characters may appear in a double-quoted
  value, or within a single-quoted value if they are escaped (i.e.,
  `'foo\'bar'`).

* Any number of double-quote characters may appear in a single-quoted
  value, or within a double-quoted value if they are escaped (i.e.,
  `"foo\"bar"`).

Because single- and double-quoted values may contain actual newlines,
we cannot split our input data on newlines as this may be in the middle
of a quoted value. This, along with the other rules around handling
quoted values, prompted me to try and implement a more robust parsing
solution. This commit is my first stab at that.

Special Considerations
======================

This is _not_ a backwards-compatible change:

* The `dotenv` files produced by this version of SOPS _cannot_ be read
  by an earlier version.

* The `dotenv` files produced by an earlier version of SOPS _can_ be
  read by this version, with the understanding that the semantics around
  quotations and newlines have changed.

Examples
========

The below examples show how double-quoted values are passed to the
running environment:

```console
$ echo 'FOO="foo\\nbar\\nbaz"' > plaintext.env
$ sops -e --output ciphertext.env plaintext.env
$ sops exec-env ciphertext.env 'env | grep FOO | xxd'
00000000: 464f 4f3d 666f 6f5c 6e62 6172 5c6e 6261  FOO=foo\nbar\nba
00000010: 7a0a                                     z.
```

```console
$ echo 'FOO="foo\nbar\nbaz"' > plaintext.env
$ sops -e --output ciphertext.env plaintext.env
$ sops exec-env ciphertext.env 'env | grep -A2 FOO | xxd'
00000000: 464f 4f3d 666f 6f0a 6261 720a 6261 7a0a  FOO=foo.bar.baz.
```
2020-03-20 22:47:14 +01:00
AJ Bahnken
7f350d81b5 Merge pull request #627 from alx13/develop
Fixes #626 return exit code with exec-env and exec-file
2020-02-11 12:38:17 -08:00
Alex Ostapenko
69ecd186ae fixes #626
now returning exit code with exec-env and exec-file
2020-02-10 22:04:27 +01:00
AJ Bahnken
4bc27f6eb7 Merge pull request #625 from mozilla/revert-616-aws
Revert "update aws-sdk-go dependency"
2020-02-10 16:37:02 +01:00
AJ Bahnken
0e1eb95dc0 Revert "update aws-sdk-go dependency" 2020-02-10 07:35:32 -08:00
AJ Bahnken
94a04e244a Merge pull request #616 from joshua-rutherford/aws
update aws-sdk-go dependency
2020-02-10 16:35:28 +01:00
Joshua Rutherford
e4660ebd22 f 2020-01-30 19:08:18 -05:00
ikedam
f7e880bfd8 Alpine-based docker image (#609)
* Add Dockerfile.alpine

* Publish alpine containers as "mozilla/sops:vX.X.X-alpine",  "mozilla/sops:vX.X-alpine",  "mozilla/sops:vX-alpine",  and "mozilla/sops:alpine"
2020-01-30 19:39:54 +01:00
Spencer Judd
16343503c2 Fix newline encoding for dotenv store (#612)
When reading and writing dotenv files, we need to make sure to
encode/decode newline characters. SOPS does not currently do this, as
can be seen from the below:

```console
$ echo '{"foo": "foo\nbar\nbaz"}' > plaintext.json
$ sops -e --output ciphertext.json plaintext.json
$ sops -d --output-type dotenv ciphertext.json
foo=foo
bar
baz
```

This output, is invalid and cannot even be fed back into SOPS:

```console
$ sops -d --output-type dotenv --output plaintext.env ciphertext.json
$ sops -e plaintext.env
Error unmarshalling file: invalid dotenv input line: bar
```

This commit fixes the issue, such that the final `sops -d ...` command
above produces the correct output:

```console
$ sops -d --output-type dotenv ciphertext.json
foo=foo\nbar\nbaz
```
2020-01-24 18:03:34 +01:00
AJ Bahnken
db9c552652 Merge pull request #607 from eddiewebb/circleci-tag
Added version to docker tag #542
2020-01-23 12:49:08 -08:00
Eddie Webb
19e44ab46f removed duplicate error message 2020-01-18 11:29:47 -05:00
Eddie Webb
75b8701874 change local reference to dpeloy script 2020-01-18 08:39:27 -05:00
Eddie Webb
f65e55e905 Use simple cut command for version
This eliminates use of 3rd party tool but greatly simplifies supported versions.
MAJOR.MINOR.PTACH

Minor & Patch may be omitted ("v3", "v3.2", "v3.2.1")
2020-01-18 08:31:15 -05:00
Eddie Webb
b113ebc283 Added version to docker tag #542, using existing tag scheme 2020-01-16 10:27:15 -05:00
AJ Bahnken
df39dca1cf Merge pull request #602 from mmorev/develop
Publishing improvements: directory walking; prevent Vault unneeded version increment
2020-01-14 12:57:16 -08:00
Mikhail Morev
0c26330546 Merge pull request #4 from mmorev/fix-relativepaths
Recursive publish - use relative paths
2020-01-14 15:38:17 +03:00
MOREV Mikhail
0c6558b7f2 Recursive publish - use relative paths 2020-01-14 15:36:26 +03:00
Mikhail Morev
3db9c71596 Update cmd/sops/main.go
Co-Authored-By: AJ Bahnken <1144310+ajvb@users.noreply.github.com>
2020-01-14 00:45:55 +03:00
Mikhail Morev
67f1654ce9 Merge pull request #3 from mmorev/fix-singlefile
Fix destination path on single file publish
2020-01-13 15:03:45 +06:00
MOREV Mikhail
3ccc7e4067 Fix destination path on single file publish 2020-01-13 15:00:33 +06:00
Mikhail Morev
ed3172733d Merge pull request #2 from mmorev/fix-recursive
Dont fail Vault publish with write-only access; improve vault publish logging
2020-01-11 10:50:24 +06:00
MOREV Mikhail
01b5fb6279 Dont fail Vault publish with write-only access; improve vault publish logging 2020-01-11 10:49:00 +06:00
Mikhail Morev
02b0437c2a Merge pull request #1 from mmorev/fix-recursive
fix filepath.Walk abuse; rename recursive flag; minor fixes
2020-01-10 10:30:22 +06:00
MOREV Mikhail
3ab2d41c2f fix filepath.Walk abuse; rename recursive flag; minor fixes 2020-01-10 09:57:36 +06:00
MOREV Mikhail
4254322d7e update docs 2020-01-09 11:25:25 +06:00
MOREV Mikhail
10ef21c8b8 Skip publish to Vault if secret is up-to-date
in order to avoid version increment
2020-01-09 11:07:35 +06:00
MOREV Mikhail
ef68940d2f Add -omit-extensions option for publish subcommand 2020-01-09 11:07:28 +06:00
MOREV Mikhail
8a216e9260 Add -recurse option for publish subcommand 2020-01-09 11:07:21 +06:00
AJ Bahnken
53c6470316 Merge pull request #591 from apeschel/topic/apeschel/updatekeys_on_examples
Update the PGP Key for all Examples
2019-12-12 13:49:47 -08:00
Aaron Peschel
6788bf8ee6 Update sops format version for example files
At the moment, the examples produce warnings, due to the very old format
they use.

This commit re-encrypts the example files to eliminate the warnings that
are occurring from the use of the very old sops format.
2019-12-10 14:47:45 -08:00
Aaron Peschel
e99a5ff1d5 Update the PGP Key for all Examples
Commit e9b9f7aeef generated new PGP keys
for this repository, but failed to update the keys used by the examples.
As a result, the documentation for testing with the dev pgp key does not
work.

This commit rekeys the examples using the newly generated examples,
which allows the testing to work again.
2019-12-10 14:34:45 -08:00
AJ Bahnken
83a354e92f Merge pull request #584 from mozilla/develop
Fix fpm commands and PROJECT var in Makefile
2019-12-02 09:32:45 -08:00
AJ Bahnken
4a7892c5f5 Merge branch 'master' into develop 2019-12-02 09:23:38 -08:00
AJ Bahnken
6ec0e6a2e2 Fix fpm commands and PROJECT var in Makefile 2019-12-02 09:14:23 -08:00
AJ Bahnken
647560046f Merge branch 'develop' v3.5.0 2019-11-21 15:12:19 -08:00
AJ Bahnken
8302b6a18c fix go mod path in go build commands 2019-11-21 15:11:58 -08:00
AJ Bahnken
afd073a5be Merge pull request #579 from mozilla/develop
Develop -> Master for 3.5.0
2019-11-21 14:53:27 -08:00
AJ Bahnken
bc4b7478ad prepare 3.5.0 release (#578) 2019-11-21 13:53:50 -08:00
AJ Bahnken
c19d2580c9 Merged master into develop 2019-11-21 12:34:36 -08:00