Skip to content

Commit f8a6949

Browse files
authored
Merge pull request #10 from felixfontein/docs
Clean up a little bit, and convert commits from main repository's README
2 parents ba266fe + 0c7daa5 commit f8a6949

4 files changed

Lines changed: 91 additions & 23 deletions

File tree

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# THIS IS A TEST CONFIG ONLY!
2-
# FOR THE CONFIGURATION OF YOUR SITE USE hugo.yaml.
2+
# FOR THE CONFIGURATION OF YOUR SITE USE hugo.toml.
33
#
44
# As of Docsy 0.7.0, Hugo 0.110.0 or later must be used.
55
#

content/en/docs/_index.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,22 @@ can use the example files and pgp key provided with the repository:
203203

204204
This last step will decrypt `example.yaml` using the test private key.
205205

206+
## Encrypting with GnuPG subkeys
207+
208+
If you want to encrypt with specific GnuPG subkeys, it does not suffice to provide the
209+
exact key ID of the subkey to SOPS, since GnuPG might use *another* subkey instead
210+
to encrypt the file key with. To force GnuPG to use a specific subkey, you need to
211+
append `!` to the key's fingerprint.
212+
213+
``` yaml
214+
creation_rules:
215+
- pgp: >-
216+
85D77543B3D624B63CEA9E6DBC17301B491B3F21!,
217+
E60892BB9BD89A69F759A1A0A3D652173B763E8F!
218+
```
219+
220+
Please note that this is only passed on correctly to GnuPG since SOPS 3.9.3.
221+
206222
## Encrypting using age
207223
208224
[age](https://age-encryption.org/) is a simple, modern, and secure tool
@@ -234,6 +250,28 @@ decrypt the data.
234250

235251
Encrypting with SSH keys via age is not yet supported by SOPS.
236252

253+
A list of age recipients can be added to the `.sops.yaml`:
254+
255+
``` yaml
256+
creation_rules:
257+
- age: >-
258+
age1s3cqcks5genc6ru8chl0hkkd04zmxvczsvdxq99ekffe4gmvjpzsedk23c,
259+
age1qe5lxzzeppw5k79vxn3872272sgy224g2nzqlzy3uljs84say3yqgvd0sw
260+
```
261+
262+
It is also possible to use `updatekeys`, when adding or removing age recipients. For example:
263+
264+
``` sh
265+
$ sops updatekeys secret.enc.yaml
266+
2022/02/09 16:32:02 Syncing keys for file /iac/solution1/secret.enc.yaml
267+
The following changes will be made to the file's groups:
268+
Group 1
269+
age1s3cqcks5genc6ru8chl0hkkd04zmxvczsvdxq99ekffe4gmvjpzsedk23c
270+
+++ age1qe5lxzzeppw5k79vxn3872272sgy224g2nzqlzy3uljs84say3yqgvd0sw
271+
Is this okay? (y/n):y
272+
2022/02/09 16:32:04 File /iac/solution1/secret.enc.yaml synced with new keys
273+
```
274+
237275
## Encrypting using GCP KMS
238276
239277
GCP KMS uses [Application Default
@@ -689,6 +727,9 @@ stored under a specific directory, like a `git` repository, you can
689727
create a `.sops.yaml` configuration file at the root directory to define
690728
which keys are used for which filename.
691729
730+
Note: The file needs to be named `.sops.yaml`. Other names (i.e. `.sops.yml`) won't be automatically
731+
discovered by sops. You'll need to pass the `--config .sops.yml` option for it to be picked up.
732+
692733
Let\'s take an example:
693734
694735
- file named **something.dev.yaml** should use one set of KMS A, PGP
@@ -1514,6 +1555,24 @@ The value must be formatted as json.
15141555
$ sops set ~/git/svc/sops/example.yaml '["an_array"][1]' '{"uid1":null,"uid2":1000,"uid3":["bob"]}'
15151556
```
15161557
1558+
## Unset a sub-part in a document tree
1559+
1560+
Symmetrically, SOPS can unset a specific part of a YAML or JSON document, by providing
1561+
the path in the `unset` command. This is useful to unset specific values, like keys, without
1562+
needing an editor.
1563+
1564+
``` sh
1565+
$ sops unset ~/git/svc/sops/example.yaml '["app2"]["key"]'
1566+
```
1567+
1568+
The tree path syntax uses regular python dictionary syntax, without the
1569+
variable name. Set to keys by naming them, and array elements by
1570+
numbering them.
1571+
1572+
``` sh
1573+
$ sops unset ~/git/svc/sops/example.yaml '["an_array"][1]'
1574+
```
1575+
15171576
## Showing diffs in cleartext in git
15181577
15191578
You most likely want to store encrypted files in a version controlled
@@ -1597,10 +1656,20 @@ will not encrypt the values under the `description` and `metadata` keys
15971656
in a YAML file containing kubernetes secrets, while encrypting
15981657
everything else.
15991658
1659+
For YAML files, another method is to use `--encrypted-comment-regex` which will
1660+
only encrypt comments and values which have a preceding comment matching the supplied
1661+
regular expression.
1662+
1663+
Conversely, you can opt in to only left certain keys without encrypting by using the
1664+
`--unencrypted-comment-regex` option, which will leave the values and comments
1665+
unencrypted when they have a preeceding comment, or a trailing comment on the same line,
1666+
that matches the supplied regular expression.
1667+
16001668
You can also specify these options in the `.sops.yaml` config file.
16011669
1602-
Note: these four options `--unencrypted-suffix`, `--encrypted-suffix`,
1603-
`--encrypted-regex` and `--unencrypted-regex` are mutually exclusive and
1670+
Note: these six options `--unencrypted-suffix`, `--encrypted-suffix`,
1671+
`--encrypted-regex`, `--unencrypted-regex`, `--encrypted-comment-regex`,
1672+
and `--unencrypted-comment-regex` are mutually exclusive and
16041673
cannot all be used in the same file.
16051674
16061675
# Encryption Protocol

hugo.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ version = "0.0"
105105
url_latest_version = "https://example.com"
106106

107107
# Repository configuration (URLs for in-page links to opening issues and suggesting changes)
108-
github_repo = "https://github.com/getsops/sops"
108+
github_repo = "https://github.com/getsops/docs"
109109
# An optional link to a related project repo. For example, the sibling repository where your product code lives.
110110
github_project_repo = "https://github.com/getsops/sops"
111111

@@ -117,7 +117,7 @@ github_project_repo = "https://github.com/getsops/sops"
117117
github_branch= "main"
118118

119119
# Google Custom Search Engine ID. Remove or comment out to disable search.
120-
gcs_engine_id = "d72aa9b2712488cc3"
120+
# gcs_engine_id = "d72aa9b2712488cc3"
121121

122122
# Enable Lunr.js offline search
123123
offlineSearch = false
@@ -149,8 +149,8 @@ sidebar_search_disable = false
149149
[params.ui.feedback]
150150
enable = true
151151
# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful).
152-
yes = 'Glad to hear it! Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.'
153-
no = 'Sorry to hear that. Please <a href="https://github.com/USERNAME/REPOSITORY/issues/new">tell us how we can improve</a>.'
152+
yes = 'Glad to hear it! Please <a href="https://github.com/getsops/sops/issues/new">tell us how we can improve</a>.'
153+
no = 'Sorry to hear that. Please <a href="https://github.com/getsops/sops/issues/new">tell us how we can improve</a>.'
154154

155155
# Adds a reading time to the top of each doc.
156156
# If you want this feature, but occasionally need to remove the Reading time from a single page,
@@ -160,16 +160,16 @@ enable = false
160160

161161
[params.links]
162162
# End user relevant links. These will show up on left side of footer and in the community page if you have one.
163-
[[params.links.user]]
164-
name = "User mailing list"
165-
url = "https://example.org/mail"
166-
icon = "fa fa-envelope"
167-
desc = "Discussion and help from your fellow users"
168-
[[params.links.user]]
169-
name ="Twitter"
170-
url = "https://example.org/twitter"
171-
icon = "fab fa-twitter"
172-
desc = "Follow us on Twitter to get the latest news!"
163+
#[[params.links.user]]
164+
# name = "User mailing list"
165+
# url = "https://example.org/mail"
166+
# icon = "fa fa-envelope"
167+
# desc = "Discussion and help from your fellow users"
168+
#[[params.links.user]]
169+
# name ="Twitter"
170+
# url = "https://example.org/twitter"
171+
# icon = "fab fa-twitter"
172+
# desc = "Follow us on Twitter to get the latest news!"
173173
[[params.links.user]]
174174
name = "Stack Overflow"
175175
url = "https://stackoverflow.com/questions/tagged/mozilla-sops"
@@ -186,11 +186,11 @@ enable = false
186186
url = "https://slack.cncf.io"
187187
icon = "fab fa-slack"
188188
desc = "Chat with other project developers"
189-
[[params.links.developer]]
190-
name = "Developer mailing list"
191-
url = "https://example.org/mail"
192-
icon = "fa fa-envelope"
193-
desc = "Discuss development issues around the project"
189+
#[[params.links.developer]]
190+
# name = "Developer mailing list"
191+
# url = "https://example.org/mail"
192+
# icon = "fa fa-envelope"
193+
# desc = "Discuss development issues around the project"
194194

195195
# hugo module configuration
196196

layouts/404.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
<div class="td-content">
33
<h1>Not found</h1>
44
<p>Oops! This page doesn't exist. Try going back to the <a href="{{ "" | relURL }}">home page</a>.</p>
5-
<p>You can learn how to make a 404 page like this in <a href="https://gohugo.io/templates/404/">Custom 404 Pages</a>.</p>
65
</div>
76
{{- end }}

0 commit comments

Comments
 (0)