Skip to content

Commit

Permalink
Setup notation signing keys
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan committed Feb 25, 2024
1 parent 0d2c428 commit 24405a5
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ bin/
cue/cue.mod/gen/
cue/go.mod
cue/go.sum

.notation/podinfo.csr
.notation/podinfo.key
15 changes: 15 additions & 0 deletions .notation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Podinfo signed releases

Podinfo release assets such as the Helm chart and the Flux artifact
are published to GitHub Container Registry and are signed with
[Notation](https://github.com/notaryproject/notation).

## Generate signing keys

Generate a new signing key pair:

```sh
openssl genrsa -out podinfo.key 2048
openssl req -new -key podinfo.key -out podinfo.csr -config codesign.cnf
openssl x509 -req -days 1826 -in podinfo.csr -signkey podinfo.key -out notation.crt -extensions v3_req -extfile codesign.cnf
```
18 changes: 18 additions & 0 deletions .notation/codesign.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[ req ]
default_bits = 2048
default_keyfile = privatekey.pem
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no

[ req_distinguished_name ]
C = RO
ST = BU
L = Bucharest
O = Notary
CN = stefanprodan.com

[ v3_req ]
keyUsage = critical,digitalSignature
extendedKeyUsage = critical,codeSigning
#subjectKeyIdentifier = hash
37 changes: 19 additions & 18 deletions .notation/notation.crt
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
-----BEGIN CERTIFICATE-----
MIIDWjCCAkKgAwIBAgIUBk/7TYVIUsiCeUm5c11abfwMrZUwDQYJKoZIhvcNAQEL
BQAwUTELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAldBMRAwDgYDVQQHDAdTZWF0dGxl
MQ8wDQYDVQQKDAZOb3RhcnkxEjAQBgNVBAMMCWZsdXhjZC5pbz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STQsPr6SvpokPCG4rLQyjgeYYk4CCj5piSxbSUZFavq8v1y7Y
m91USVqfeUX7ZzjDxPHE2A==
-----END CERTIFICATE-----
4 changes: 2 additions & 2 deletions .notation/signingkeys.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"default": "fluxcd.io",
"default": "stefanprodan.com",
"keys": [
{
"name": "fluxcd.io",
"name": "stefanprodan.com",
"keyPath": "/home/runner/.config/notation/localkeys/notation.key",
"certPath": "/home/runner/.config/notation/localkeys/notation.crt"
}
Expand Down
6 changes: 3 additions & 3 deletions .notation/trustpolicy.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"version": "1.0",
"trustPolicies": [
{
"name": "fluxcd.io",
"name": "stefanprodan.com",
"registryScopes": [
"ghcr.io/stefanprodan/podinfo-deploy",
"ghcr.io/stefanprodan/charts/podinfo"
],
"signatureVerification": {
"level" : "strict"
},
"trustStores": [ "ca:fluxcd.io" ],
"trustStores": [ "ca:stefanprodan.com" ],
"trustedIdentities": [
"x509.subject: C=US, ST=WA, L=Seattle, O=Notary, CN=fluxcd.io"
"x509.subject: C=RO, ST=BU, L=Bucharest, O=Notary, CN=stefanprodan.com"
]
}
]
Expand Down

0 comments on commit 24405a5

Please sign in to comment.