Skip to content

Conversation

@tonistiigi
Copy link
Member

Add an option to use signed cache with Github backend. Signing needs to happen by an external program set in the toml config (eg. cosign via github OIDC) and is verified against the policy specified in the toml config. This allows reusable workflow running in Github actions environment to ensure that cache can not be modified outside of the workflow, even if full access to cache storage is available.

ref docker/github-builder-experimental#56

}

type VerifyPolicy struct {
TimestampTreshold int `toml:"timestampTreshold"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Suggested change
TimestampTreshold int `toml:"timestampTreshold"`
TimestampThreshold int `toml:"timestampThreshold"`
Comment on lines +10 to +12
type SignConfig struct {
Command []string `toml:"command"`
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess in the future we could have some kind of Backend attribute so we can choose different kind of backend if we have built-in ones supported like sigstore:

type SignConfig struct {
	Backend  string           `toml:"backend"`
	Sigstore *SigstoreBackend `toml:"sigstore,omitempty"`
	Command  *CommandBackend  `toml:"command,omitempty"`
}

type SigstoreBackend struct {
	OIDCProvider string `toml:"oidc-provider"`
	TLogUpload   bool   `toml:"tlog-upload"`
}

type CommandBackend struct {
	Commands []string `toml:"commands"`
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need the extra params? Isn't the command args flexible enough to do whatever you need to do?

Copy link
Member

@crazy-max crazy-max Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if one day we have signing with sigstore built-in in buildkit (similar to remote cache backends) we would not need to copy the cosign binary in the build container and shell out. Maybe better through the gateway as an image?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future maybe, but I don't know how it would look like then.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@crazy-max crazy-max added this to the v0.27.0 milestone Dec 18, 2025
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs https://github.com/moby/buildkit/blob/master/docs/buildkitd.toml.md update with new sections or maybe a new "signing" page under https://github.com/moby/buildkit/tree/master/docs but we can do it later when we expand on signing in our code base. (cc @dvdksn)

Currently this is tested in the Docker GitHub Builder: docker/github-builder-experimental#60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment