mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
docs(marketplace): document digest pinning and verify on tap
Update the tap command help and the community-index README for the new
behaviour: digest references, the automatic tag-to-digest pin, the
--certificate-identity / --certificate-oidc-issuer pull-time verify flags, and
the optional index entry digest. Extend the generated openapi definitions and
model-name helper for the new TapVerify type (code generation is otherwise
run in CI).
Assisted-by: LLM
Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit 5747f94781)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
1 parent
c20d9319c7
commit
a3d883b4bf
4 files changed
+63
-8
No files matched your search
+12
-5
@@ -306,11 +306,18 @@ With --secret the OCIRepository is given a pull-credential secretRef (the
|
||||
admin pre-creates the Secret in cozy-system), so a private repository taps in
|
||||
one command.
|
||||
|
||||
Trust: tap validates the artifact's structure but does NOT verify its cosign
|
||||
signature. Signature verification is the community index's job at publication
|
||||
time ('cozypkg validate --require-signature' in the index CI gate, pinned to
|
||||
the entry's recorded identity), and can additionally be enforced at pull time
|
||||
via Flux OCIRepository verification. Installing an app from a tapped repository
|
||||
Pinning: a tapped repository does not follow a moving tag. A reference given by
|
||||
digest (oci://host/org/repo@sha256:...) is pinned to that digest immediately; a
|
||||
tag reference is pinned to the digest it currently resolves to as soon as the
|
||||
source materializes, with the tag kept informational. Moving the tag upstream
|
||||
changes nothing in the cluster; tap the repository again to move the pin.
|
||||
|
||||
Trust: tap validates the artifact's structure. Keyless signature verification at
|
||||
pull time is enabled with --certificate-identity and --certificate-oidc-issuer,
|
||||
which set a Flux cosign verify policy on the source so content is pulled only
|
||||
when signed by that identity. Signature verification at publication time is the
|
||||
community index's job ('cozypkg validate --require-signature' in the index CI
|
||||
gate, pinned to the entry's recorded identity). Installing an app from a tapped repository
|
||||
runs its charts in your management cluster: tap only sources you trust.`,
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
||||
@@ -20,6 +20,7 @@ Each file under `entries/` is a single record (see `entries/example.foo.yaml`):
|
||||
name: foo.bar
|
||||
ociRef: oci://ghcr.io/foo/bar
|
||||
version: v1.2.3
|
||||
digest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
|
||||
description: A SQL database operator
|
||||
maintainer: Foo <foo@example.com>
|
||||
homepage: https://example.com/foo
|
||||
@@ -31,15 +32,17 @@ signing:
|
||||
issuer: https://token.actions.githubusercontent.com
|
||||
```
|
||||
|
||||
`digest` is optional but recommended: when set to the `sha256:<hex>` the gate verified, tapping the entry's short name pins that exact content instead of following the `version` tag, so a later retag of the same version cannot change what installs. The gate records it from the artifact it just verified, and `version` is kept informational alongside it.
|
||||
|
||||
## Two-lane merge policy
|
||||
|
||||
Following krew-index, submissions take one of two lanes:
|
||||
|
||||
- **Owner version bump.** A change that only updates an existing entry's `version` or description, leaving `ociRef` and `signing` untouched, auto-merges once the new artifact validates and is signed by the entry's **recorded** cosign identity. This keeps the routine "new release of a listed package" path fast.
|
||||
- **Owner version bump.** A change that only updates an existing entry's `version`, `digest`, or description, leaving `ociRef` and `signing` untouched, auto-merges once the new artifact validates and is signed by the entry's **recorded** cosign identity. This keeps the routine "new release of a listed package" path fast.
|
||||
- **New entry, or a change to `ociRef`, `maintainer`, or `signing`.** These are the security-relevant edits and require maintainer review before merge.
|
||||
|
||||
Cosign verification is **mandatory** on the gate for both lanes: the trust anchor is the recorded signing identity, so a bump fails if the new artifact is not signed by the originally approved identity.
|
||||
|
||||
## Trust model
|
||||
|
||||
Signature verification happens here, at publication time, not at tap time. `cozypkg tap` and the dashboard connect flow validate an artifact's structure but do not verify its cosign signature: a cluster that taps a listed repository trusts that this index already verified it. The verification points are this CI gate (which pins each release to the entry's recorded identity) and, optionally, Flux `OCIRepository` verification at pull time. Installing an app from a tapped repository runs its charts in the management cluster, so operators should tap only sources they trust or that appear in a curated index like this one.
|
||||
Signature verification happens here, at publication time, not at tap time. `cozypkg tap` and the dashboard connect flow validate an artifact's structure; they do not verify a cosign signature unless asked (with `--certificate-identity` / `--certificate-oidc-issuer`, which set a Flux pull-time verify policy). A cluster that taps a listed repository otherwise trusts that this index already verified it. The verification point is this CI gate, which pins each release to the entry's recorded identity. Independently of signing, a tapped repository is pinned to a digest and does not follow a moved tag: a `digest` recorded on the entry pins the exact content the gate verified, and a tag-only tap is pinned to the digest it first resolves to. Installing an app from a tapped repository runs its charts in the management cluster, so operators should tap only sources they trust or that appear in a curated index like this one.
|
||||
@@ -118,3 +118,7 @@ func (in TapSource) OpenAPIModelName() string {
|
||||
func (in TapPackage) OpenAPIModelName() string {
|
||||
return "com.github.cozystack.cozystack.pkg.apis.core.v1alpha1.TapPackage"
|
||||
}
|
||||
|
||||
func (in TapVerify) OpenAPIModelName() string {
|
||||
return "com.github.cozystack.cozystack.pkg.apis.core.v1alpha1.TapVerify"
|
||||
}
|
||||
@@ -48,6 +48,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
|
||||
corev1alpha1.TapPackage{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TapPackage(ref),
|
||||
corev1alpha1.TapSource{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TapSource(ref),
|
||||
corev1alpha1.TapSpec{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TapSpec(ref),
|
||||
corev1alpha1.TapVerify{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TapVerify(ref),
|
||||
corev1alpha1.TenantModule{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TenantModule(ref),
|
||||
corev1alpha1.TenantModuleList{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TenantModuleList(ref),
|
||||
corev1alpha1.TenantModuleStatus{}.OpenAPIModelName(): schema_pkg_apis_core_v1alpha1_TenantModuleStatus(ref),
|
||||
@@ -715,11 +716,51 @@ func schema_pkg_apis_core_v1alpha1_TapSpec(ref common.ReferenceCallback) common.
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"verify": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Verify is a connect-time input only: a signature-verification policy to set on the tap's Flux source (spec.verify). It is consumed when a Tap is created, preserved across repeat connects, and never returned on read.",
|
||||
Ref: ref(corev1alpha1.TapVerify{}.OpenAPIModelName()),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
corev1alpha1.TapPackage{}.OpenAPIModelName(), corev1alpha1.TapSource{}.OpenAPIModelName()},
|
||||
corev1alpha1.TapPackage{}.OpenAPIModelName(), corev1alpha1.TapSource{}.OpenAPIModelName(), corev1alpha1.TapVerify{}.OpenAPIModelName()},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_pkg_apis_core_v1alpha1_TapVerify(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "TapVerify is a connect-time signature-verification policy for a tap. It maps to the Flux OCIRepository spec.verify: keyless cosign identity matching (issuer + subject) is the supported form, so a moved tag cannot be followed unless it is also signed by the recorded identity.",
|
||||
Type: []string{"object"},
|
||||
Properties: map[string]spec.Schema{
|
||||
"provider": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Provider is the signature technology: \"cosign\" (default) or \"notation\".",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"issuer": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Issuer is the OIDC issuer URL for keyless cosign verification, e.g. https://token.actions.githubusercontent.com.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
"subject": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Subject is the certificate identity (subject) for keyless cosign verification; it is matched against the artifact's signing identity.",
|
||||
Type: []string{"string"},
|
||||
Format: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user