Brewless Brewless Docs

Deployments

Security updates

How Brewless puts security fixes of the images your application runs on under the live release by itself, and how to switch it off.

On this page

Your application runs on a base image of Brewless: FrankenPHP with PHP, the usual extensions and a few tools from Debian. A realtime server with realtime.image: brewless runs on Brewless's realtime image. Brewless keeps those images up to date and puts a security fix under your live release by itself.

Every round is listed in the public security update log: when it started and finished, the newer PHP releases and the fixed vulnerabilities per component. The log is written from the rounds themselves and names no customer.

What Brewless watches

Every hour Brewless looks, from outside your containers, whether PHP published a newer release, and scans its published images for vulnerabilities rated CRITICAL or HIGH. A finding that has a fix, in a Debian or Alpine package, in PHP or in the realtime image's own dependencies, leads to new images. A finding without a fix yet waits for one.

The watch is a workflow in the public brewless/images repository and runs in GitHub Actions, so it wakes none of your containers. Brewless starts it once every hour.

Signed images

Every image Brewless builds and runs on is signed when it is published, without a key that could be stolen: the publishing workflow of brewless/images gets a short-lived certificate from Sigstore that names the workflow, and the signature is logged in Sigstore's public transparency log. Before Brewless takes a new image it checks that signature itself: that it is of exactly that image, that Sigstore issued the certificate, and that it names a workflow of brewless/images that ran on its main branch. An image that someone put in the registry another way has no such signature.

While this check is being introduced, an image without a valid signature is recorded and still taken; once it is enforced, such an image is never taken and nothing is rolled out on it. You can check an image yourself:

cosign verify ghcr.io/brewless/brewless-base:php8.4 \
  --certificate-identity https://github.com/brewless/images/.github/workflows/images.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

The sections below describe a PHP application. For a Rust application, see Laravel for Rust; for a Go application, Laravel for Go.

What happens with new images

  1. Brewless publishes the new images and only then takes them over. An image with an older PHP release than the one in use is never taken, nor one that was built before the image in use under the same name. A rebuild that brings no newer PHP release and fixes no vulnerability, such as one after a change to the build itself, is taken too, so your next deploy builds on it, but nothing below happens for it: nothing is rolled out and nobody is mailed.
  2. For every environment that runs a live release on an image that changed, Brewless starts a release of its own. It takes the application layer of the live image, exactly as it was built, and puts it on the new base image. Nothing is built: the same commit, the same variables, the same brewless.yml. When only the realtime image changed, the application image stays as it is and only the realtime container takes the new one.
  3. The release goes live like a rollback: the release commands run (a migrate finds nothing to do), the containers switch, and the edge keeps its pages, because the pages did not change.
  4. Within one application the environments go one after the other, with production last. When a release fails, the release before it stays live, and the environments after it in that application are left alone.
  5. Once every environment of your organisation is done, the owners and administrators get a mail: the new PHP releases and the vulnerabilities fixed per component, the environments that run the update now, and the ones that need you, with what to do. It is a security mail, so it comes whatever mail you switched off.

The release shows up in the console as "on updated runtime images", with no one as the person who started it.

A deploy after this builds on the new base image too: the tag of an image names the base image it is built on, so a commit built on the old one is built again.

Your own dependencies, from Composer and npm, are yours: a security update of the images does not change them.

Laravel for Rust

A Laravel for Rust application runs on a base image of its own: the C library, certificates and time zones of Debian, without a shell or a package manager, and your binary on top. Brewless scans that image every hour as well, and a finding rated CRITICAL or HIGH that has a fix in a Debian package leads to a new one. It goes out the way described above: the layer with your binary is taken as it was built and put on the new base image, nothing is compiled, the release goes live like a rollback, production goes last, the owners and administrators get the mail, and the round is in the log, where it says the findings were in the Rust runtime image. runtime_updates: false switches it off in the same way.

A round is of one kind of image. One for the PHP images does not touch a Rust application, and one for the Rust image does not touch a PHP application.

What it does not cover:

  • What is compiled into the binary. A vulnerability in a crate your application depends on, or in Rust's standard library, is in the binary itself. A new base image does not change it. Update the crate and deploy.
  • A new Rust release. A build compiles with the Rust version named in the builder image, today 1.100. It does not move by itself.
  • The realtime image. When only Brewless's realtime image changed, a Rust application's realtime server takes the new one at its next deploy.

Laravel for Go

A Laravel for Go application runs on a base image of its own as well: a distroless image with certificates, time zones and a user, without a C library, a shell or a package manager, and your static binary on top. Brewless watches that image every hour, and when a new one is published, because the distroless image under it or a Go release moved, it goes out the way described above: the layer with your binary is taken as it was built and put on the new base image, nothing is compiled, the release goes live like a rollback, production goes last, the owners and administrators get the mail, and the round is in the log as one of the Go runtime image. runtime_updates: false switches it off in the same way.

A round is of one kind of image. One for the Go image touches neither a PHP nor a Rust application.

A new Go release

Go's standard library is compiled into your binary, so a security fix in Go reaches your application only when it is compiled again. A build compiles with the Go of the builder image, today 1.27. The same hourly watch looks for a new patch release of that Go version, such as 1.27.5. Once there is one, brewless/images builds a new builder image with it, and Brewless reads the Go release from that image itself. Then:

  1. For every environment that runs a live Laravel for Go release compiled by an older Go, Brewless starts a release of its own that builds the live commit again: the same commit, the same variables, the same brewless.yml, compiled by the new Go and put on the newest Go runtime image.
  2. It goes live as a deploy does: the release commands run (a migrate finds nothing to do), the containers switch, and the edge is emptied and warmed, because the binary changed.
  3. Within one application the environments go one after the other, with production last. When a build or a release fails, the release before it stays live, and the environments after it in that application are left alone.
  4. The owners and administrators get the mail, which names the new Go release, and the round is in the log.

The tag of your image names the Go it was compiled by (…-go1.27.5-i…), so a deploy after this compiles with the new Go too, and one that did already is left alone. runtime_updates: false switches this off as well; the mail then lists the environment as one to deploy yourself.

Only a patch release of the Go version in the builder's tag goes out this way. A new Go version, such as 1.28, can change behaviour your code relies on, so that stays your choice.

What it does not cover:

  • Your modules. A vulnerability in a module your application depends on is in your go.sum. Update the module and deploy.
  • The realtime image. When only Brewless's realtime image changed, a Go application's realtime server takes the new one at its next deploy.

New PHP versions

The same watch looks for a new PHP version. Once FrankenPHP publishes an image for one, such as PHP 8.7, brewless/images builds base images for it, and Brewless accepts the version in brewless.yml from then on, without a release of Brewless itself. The owners and administrators of every organisation with a live application get one mail that it can be used, of the kind "tips", so a member who switched those off gets none.

Nothing moves to a new version by itself: a new PHP version can change behaviour your code or your packages rely on, so that stays your choice. Set the version and deploy, staging first:

brewless.yml
php: "8.7"

From then on that version gets its security updates like every other. The version a project gets when it names none, 8.4, does not change with a new version either.

Switching it off

It is on for every environment. To deploy security updates yourself, switch it off for an environment in brewless.yml:

brewless.yml
environments:
  production:
    runtime_updates: false

Or untick Security updates by itself on the Deployments page of the environment in the console. When brewless.yml sets it, the file goes first and the console only shows it.

An environment that has it off still gets a line in the mail. A deploy brings the update.