-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add sigstore-policy-tester extension
To enable verifying of every container image run through containerd
- Loading branch information
1 parent
95ddb77
commit 0a6e49f
Showing
6 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# sigstore-policy-tester extension | ||
|
||
## Installation | ||
|
||
See [Installing Extensions](https://github.com/siderolabs/extensions#installing-extensions). | ||
|
||
## Usage | ||
|
||
```yaml | ||
machine: | ||
files: | ||
- content: | | ||
[plugins] | ||
[plugins."io.containerd.image-verifier.v1.bindir"] | ||
bin_dir = "/usr/local/bin/containerd-image-verifier" | ||
max_verifiers = 10 | ||
per_verifier_timeout = "10s" | ||
path: /etc/cri/conf.d/20-customization.part | ||
op: create | ||
- content: | | ||
apiVersion: policy.sigstore.dev/v1alpha1 | ||
kind: ClusterImagePolicy | ||
metadata: | ||
name: system | ||
spec: | ||
images: | ||
- glob: "**" | ||
authorities: | ||
- keyless: | ||
url: https://fulcio.sigstore.dev | ||
identities: | ||
- issuer: https://accounts.google.com | ||
subject: k8s-infra-gcr-promoter@k8s-artifacts-prod.iam.gserviceaccount.com | ||
ctlog: | ||
url: https://rekor.sigstore.dev | ||
- keyless: | ||
identities: | ||
- issuer: https://accounts.google.com | ||
subjectRegExp: "@siderolabs\.com$" | ||
path: /etc/containers/sigstore/policy.yaml | ||
op: create | ||
``` | ||
**Important note: add all other identities and keys within the ClusterImagePolicy above for target container images** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: v1alpha1 | ||
metadata: | ||
name: sigstore-policy-tester | ||
version: "$VERSION" | ||
author: Sigstore Authors | ||
description: | | ||
Verify images signed against a policy.yaml | ||
compatibility: | ||
talos: | ||
version: ">= v0.12.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: sigstore-policy-tester | ||
variant: scratch | ||
shell: /toolchain/bin/bash | ||
dependencies: | ||
- stage: base | ||
steps: | ||
- sources: | ||
- url: https://github.com/sigstore/policy-controller/archive/refs/tags/{{ .SIGSTORE_POLICY_TESTER_VERSION }}.tar.gz | ||
destination: sigstore-policy-controller.tar.gz | ||
sha256: f0a3545341b426a77452f58be10f01d194e157e8232bf512967fd36984dd096e | ||
sha512: fb542d15b0b269e505888e41ba7af456e489d7592dca459b193e02ab59cbadd64c9bdcf23ef0323143f8c0905c2aecafad705bd56a31905f3e63dd311d022be1 | ||
- url: https://github.com/BobyMCbobs/containerd-image-verifier-sigstore/archive/refs/tags/{{ .CONTAINERD_IMAGE_VERIFIER_SIGSTORE_VERSION }}.tar.gz | ||
destination: containerd-image-verifier-sigstore.tar.gz | ||
sha256: e62231ad2a45027fe6c194345a00eddd9f7d65ad1e231a7ed182e534feee1d6d | ||
sha512: a7f315a03c52a23fabf8a1783f3ec38a2961a714bd00e56cc67bcce89155ddeed299dd080787c09bd50dc083da58df7addecf54f2e95b5119037de9752cf096e | ||
env: | ||
GOPATH: /go | ||
cachePaths: | ||
- /.cache/go-build | ||
- /go/pkg | ||
prepare: | ||
- | | ||
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml | ||
- | | ||
mkdir -p ${GOPATH}/src/github.com/sigstore/policy-controller | ||
tar -xzf sigstore-policy-controller.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/sigstore/policy-controller | ||
- | | ||
mkdir -p ${GOPATH}/src/github.com/BobyMCbobs/containerd-image-verifier-sigstore | ||
tar -xzf containerd-image-verifier-sigstore.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/BobyMCbobs/containerd-image-verifier-sigstore | ||
build: | ||
- | | ||
export PATH=${PATH}:${TOOLCHAIN}/go/bin | ||
cd ${GOPATH}/src/github.com/sigstore/policy-controller | ||
mkdir ./bin | ||
CGO_ENABLED=0 go build -o ./bin/sigstore-policy-tester ./cmd/tester | ||
- | | ||
export PATH=${PATH}:${TOOLCHAIN}/go/bin | ||
cd ${GOPATH}/src/github.com/BobyMCbobs/containerd-image-verifier-sigstore | ||
mkdir ./bin | ||
CGO_ENABLED=0 go build -o ./bin/containerd-image-verifier-sigstore . | ||
install: | ||
- | | ||
cd ${GOPATH}/src/github.com/sigstore/policy-controller | ||
mkdir -p /rootfs/usr/local/bin/ | ||
cp -av bin/sigstore-policy-tester /rootfs/usr/local/bin/ | ||
- | | ||
cd ${GOPATH}/src/github.com/BobyMCbobs/containerd-image-verifier-sigstore | ||
mkdir -p /rootfs/usr/local/bin/containerd-image-verifier/ | ||
cp -av bin/containerd-image-verifier-sigstore /rootfs/usr/local/bin/containerd-image-verifier/ | ||
test: | ||
- | | ||
mkdir -p /extensions-validator-rootfs | ||
cp -r /rootfs/ /extensions-validator-rootfs/rootfs | ||
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml | ||
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}" | ||
finalize: | ||
- from: /rootfs | ||
to: /rootfs | ||
- from: /pkg/manifest.yaml | ||
to: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VERSION: "{{ .SIGSTORE_POLICY_TESTER_VERSION }}" | ||
CONTAINERD_IMAGE_VERIFIER_SIGSTORE_VERSION: "{{ .CONTAINERD_IMAGE_VERIFIER_SIGSTORE_VERSION }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters