You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -673,10 +673,9 @@ Example: place the following in your ``~/.bashrc``
673
673
Specify a different GPG key server
674
674
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
675
675
676
-
By default, ``sops`` uses the key server ``gpg.mozilla.org`` to retrieve the GPG
676
+
By default, ``sops`` uses the key server ``keys.openpgp.org`` to retrieve the GPG
677
677
keys that are not present in the local keyring.
678
-
To use a different GPG key server, set the ``SOPS_GPG_KEYSERVER`` environment
679
-
variable.
678
+
This is no longer configurable. You can learn more about why from this write-up: [SKS Keyserver Network Under Attack](https://gist.github.com/rjhansen/67ab921ffb4084c865b3618d6955275f).
680
679
681
680
Example: place the following in your ``~/.bashrc``
682
681
@@ -1426,9 +1425,20 @@ will encrypt the values under the ``data`` and ``stringData`` keys in a YAML fil
1426
1425
containing kubernetes secrets. It will not encrypt other values that help you to
1427
1426
navigate the file, like ``metadata`` which contains the secrets' names.
1428
1427
1428
+
Conversely, you can opt in to only left certain keys without encrypting by using the
1429
+
``--unencrypted-regex`` option, which will leave the values unencrypted of those keys
1430
+
that match the supplied regular expression. For example, this command:
Copy file name to clipboardExpand all lines: cmd/sops/main.go
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,6 @@ func main() {
109
109
the "add-{kms,pgp,gcp-kms,azure-kv,hc-vault-transit}" and "rm-{kms,pgp,gcp-kms,azure-kv,hc-vault-transit}" flags.
110
110
111
111
To use a different GPG binary than the one in your PATH, set SOPS_GPG_EXEC.
112
-
To use a GPG key server other than gpg.mozilla.org, set SOPS_GPG_KEYSERVER.
113
112
114
113
To select a different editor than the default (vim), set EDITOR.
115
114
@@ -184,6 +183,14 @@ func main() {
184
183
Name: "user",
185
184
Usage: "the user to run the command as",
186
185
},
186
+
cli.StringFlag{
187
+
Name: "input-type",
188
+
Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the file's extension to determine the type",
189
+
},
190
+
cli.StringFlag{
191
+
Name: "output-type",
192
+
Usage: "currently json, yaml, dotenv and binary are supported. If not set, sops will use the input file's extension to determine the output format",
193
+
},
187
194
}, keyserviceFlags...),
188
195
Action: func(c*cli.Context) error {
189
196
iflen(c.Args()) !=2 {
@@ -617,6 +624,10 @@ func main() {
617
624
Name: "encrypted-suffix",
618
625
Usage: "override the encrypted key suffix. When empty, all keys will be encrypted, unless otherwise marked with unencrypted-suffix.",
619
626
},
627
+
cli.StringFlag{
628
+
Name: "unencrypted-regex",
629
+
Usage: "set the unencrypted key suffix. When specified, only keys matching the regex will be left unencrypted.",
630
+
},
620
631
cli.StringFlag{
621
632
Name: "encrypted-regex",
622
633
Usage: "set the encrypted key suffix. When specified, only keys matching the regex will be encrypted.",
@@ -674,6 +685,7 @@ func main() {
674
685
unencryptedSuffix:=c.String("unencrypted-suffix")
675
686
encryptedSuffix:=c.String("encrypted-suffix")
676
687
encryptedRegex:=c.String("encrypted-regex")
688
+
unencryptedRegex:=c.String("unencrypted-regex")
677
689
conf, err:=loadConfig(c, fileName, nil)
678
690
iferr!=nil {
679
691
returntoExitError(err)
@@ -689,6 +701,9 @@ func main() {
689
701
ifencryptedRegex=="" {
690
702
encryptedRegex=conf.EncryptedRegex
691
703
}
704
+
ifunencryptedRegex=="" {
705
+
unencryptedRegex=conf.UnencryptedRegex
706
+
}
692
707
}
693
708
694
709
cryptRuleCount:=0
@@ -701,9 +716,12 @@ func main() {
701
716
ifencryptedRegex!="" {
702
717
cryptRuleCount++
703
718
}
719
+
ifunencryptedRegex!="" {
720
+
cryptRuleCount++
721
+
}
704
722
705
723
ifcryptRuleCount>1 {
706
-
returncommon.NewExitError("Error: cannot use more than one of encrypted_suffix, unencrypted_suffix, or encrypted_regex in the same file", codes.ErrorConflictingParameters)
724
+
returncommon.NewExitError("Error: cannot use more than one of encrypted_suffix, unencrypted_suffix, encrypted_regex or unencrypted_regex in the same file", codes.ErrorConflictingParameters)
707
725
}
708
726
709
727
// only supply the default UnencryptedSuffix when EncryptedSuffix and EncryptedRegex are not provided
0 commit comments