If your developers use Macs, Homebrew is almost certainly used throughout your fleet, and acts as a critical component of engineering’s workflow.
Is Homebrew secure? Does it meet requirements for enterprise-grade software, specifically in regulated industries? Does using a package manager compromise your company’s security posture?
Our answer to these questions, at a high level, is yes: Homebrew is more secure than you might think.
Let’s first dispel some myths about Homebrew:
While some package managers do not require human review for all newly-created or updated packages, that’s not the case with Homebrew. There’s rigor in the vetting process, which has a robust system of both automated and human-dependent processes.
Homebrew has two main repositories, known as “taps,” for package contributions: Homebrew/homebrew-core and Homebrew/homebrew-cask. Each has slightly different processes for testing, security, code review, and maintenance.
The Homebrew/homebrew-core tap only accepts open source packages, which will build from source on Homebrew’s testing infrastructure. Homebrew then generates a binary package called a bottle, which is what all users in a supported configuration will end up installing on their machines.
To create a package for Homebrew/core, there is a brew create
command that will generate a template for a new package definition called a formula, which specifies the source code URL, name and homepage URL for the software. See Homebrew/core’s Acceptable Formulae documentation for requirements to submit a formula.
If you’re submitting the formula for inclusion in Homebrew/core, you’ll need to add a test to your formula to verify that Homebrew has built and installed the software correctly. Next, you'll build the formula from source on your local machine, and, as long as that build is ok, open a pull request to the Homebrew/homebrew-core repository on GitHub.
Homebrew’s GitHub Actions will run a series of automatic audits and style checks on the formula. These tests have been developed by the Homebrew maintainers to check not just style, but also that the license is acceptable, and to ensure the software is appropriate for Homebrew/core.
Usually within a day, at least one human will review the pull request, and depending on the submission, may request updates to be made. Once the pull request is merged, 50 minutes later any Homebrew user can type brew install <formula>
and install that software.
From then onwards, a Homebrew maintainer, contributor, or GitHub Action will generally keep that formula up-to-date by monitoring when there's new versions, and creating pull requests for those. Users who have that software installed can keep their installation up-to-date by running brew upgrade
.
If “upstream”, the original author of the software, gets compromised, the Homebrew project will respond accordingly by relying on a combination of Apple security features, CVE reports, and the Homebrew maintainers and security team.
The Homebrew/homebrew-cask tap accepts pre-compiled binaries, and it’s most commonly used for installing desktop applications. Casks are not compiled on Homebrew infrastructure. Because of how they are packaged, some casks may be changed on the upstream’s server at any time so cannot be checksummed as formulae can.
Casks can also be created via brew create
but the code that’s generated for a cask looks a bit different. Instead of Homebrew compiling source code, it's downloading an application or binary off the internet and installing it on your machine.
The process for submitting a cask is different from a formula: casks don’t have a test block, but there are still GitHub Actions tests to ensure the cask behaves properly. Casks can also auto update themselves. For the guidelines on submitting a cask, see Homebrew’s Acceptable Casks documentation.
When an end-user installs a graphical application, that application needs to be signed by Apple, which provides their own security review process (i.e. Quarantine, Gatekeeper).
Among the core maintainers are security experts who advise and protect the project, most recently:
In addition to remediating incidents, the Security Team has led security audits and ensures Homebrew stays in-line with security best practices.
admin
user with complete control of their machine which has made it among the most popular developer tools on the internet. By contrast, the security trust model of Workbrew provides separation between the workbrew
user who owns and runs Homebrew, and the user (who does not have to be an admin) who can run Homebrew commands on the machine. You can think about it as a sort of two-way suspicion, insulating both parties.brew upgrade
in order for the fleet to be secured. With Workbrew, this can be done with a single command as well as monitoring what software versions are installed.