Your ticks and choices are saved in this browser only.
Organizations
An organization owns repositories the way your own account does, but it can have several owners and one set of security settings that every new repository starts with.
These steps apply only if your project is in an organization. A project on a personal account can reach every level without one.
When an organization helps
- More than one person works on the project.
- You publish several apps and want them all to start with the same settings.
- You might hand the project over one day. Changing who's in an organization is easier than transferring every repository.
If you maintain one app on your own, you don't need one. Start with Your GitHub account instead.
What you gain and what it costs
On the free plan, an organization gives you:
- Several owners, each with their own login, so nobody shares a password or a token.
- Two-factor login required for everyone in it.
- One security configuration that new repositories get automatically.
- One Actions policy for every repository, such as which actions may run and whether they must be pinned.
- Default community files, such as a security policy, from a single
.githubrepository.
It has costs too.
- Rules for main and tags are still set in each repository. Organization-wide rulesets need a paid plan (Team or Enterprise).
- Moving an existing repository in has side effects. GitHub redirects the old address, but container images on ghcr.io don't follow, and the default security configuration isn't applied to a repository you move in.
- It's one more thing to protect. An owner can change or delete every repository in the organization.
Controls
Do these in order, and finish the first five before you create or move any repositories into the organization. The default security configuration only reaches repositories created after you set it.
ORG-1Level 1Secure your own account first, then create the organization from it. Settings → Organizations → New organization, on the free plan. Whoever holds an owner's login controls the organization, so do the steps in Your GitHub account before this one.
ORG-2Level 1Require two-factor login for everyone. In the organization's Settings → Authentication security, turn on the two-factor requirement. GitHub removes anyone who doesn't have it, and you can add them back once they've set it up.
ORG-3Level 1Decide who the owners are. If you work alone, one owner is fine, but losing your login then means losing the organization. Keep your recovery codes offline and set up a second way to sign in. It also helps to write down who could take over. If others work with you, make two people you trust owners and everyone else a member.
ORG-4Level 1Limit what members can do. In the organization's Settings, open Member privileges.
- Base permission: Read, which is the default. Give write access per repository instead.
- Repository creation: untick Public and Private, so only owners create repositories. Members can create both by default.
- Admin repository permissions: untick Repository deletion and transfer, so only owners can delete or move a repository.
- Pages creation: untick Public, so only owners can publish a website under the organization's name.
ORG-5Level 1Create a security configuration for every repository, new ones included. In the organization's Settings, open Advanced Security → Configurations → New configuration. Most features start enabled. Change these:
- Name: your organization's name followed by "Baseline", such as "my-org Baseline".
- Dependabot alerts → Security updates: Enabled.
- Dependabot alerts → Malware alerts: Enabled.
- Policy → Use as default for newly created repositories: Public.
- Policy → Enforce configuration: keep Enforce for repository owners, so nobody can turn a feature off in one repository.
If several people have write access, also set Bypass privileges and each Prevent direct alert dismissals, so one person can't push a secret or dismiss an alert alone. Leave the rest as it starts.
Choose Save configuration. Saving doesn't apply it to the repositories you already have, so apply it next:
- On the Configurations page, choose the pencil beside your new configuration.
- Set Apply to: All repositories, and check that Allow repository owners to modify features is Off.
- Choose Review, then Save and enable.
These features are free for public repositories. On a paid plan with GitHub Advanced Security, private repositories are billed per active committer, and the review screen shows how many licenses it would use. Choose All for new repositories only if you mean to pay for them. A repository you move in later needs the configuration applied by hand.
ORG-6Level 2Set an Actions policy. Settings → Actions → General.
- Allow only actions created by GitHub, plus the ones you list, such as
home-assistant/*andhacs/*. - Turn on Require actions to be pinned to a full-length commit SHA. Workflows that use a tag or a branch, like
@v7or@main, then fail, so pin them first and let Dependabot keep the SHAs current. - Under Workflow permissions, choose read-only access, so a workflow without its own
permissionsblock can't write. - Untick Allow GitHub Actions to create and approve pull requests.
- Allow only actions created by GitHub, plus the ones you list, such as
ORG-7Level 1If the organization holds several apps, add a public
.githubrepository with default community files. ASECURITY.mdand.github/ISSUE_TEMPLATE/config.ymlthere show on every repository that doesn't have its own, and thatSECURITY.mdcounts as each of those repositories' security policy for level 1. Use the files from Security policy and Repository basics, with the organization's name in place of a single repository. Some tools only read a repository's own files, so the template below carries a copy too.ORG-8Level 2If the organization holds several apps, start new ones from a template repository. Add the files every new app should start with, then tick Settings → General → Template repository.
SECURITY.md, issue forms and a.gitignorewith secret patterns.github/dependabot.ymlwith a 7-day cooldown- The security workflow from Checks in CI, with actions pinned by SHA
- The release workflow from Releases
A template only copies files. Each new repository still needs its own rulesets for main and tags. Set them up once, export them (Settings → Rules → Rulesets, then Export on each ruleset), and import them into the next repository with New ruleset → Import a ruleset. The bypass list isn't exported, so add it again.
ORG-9Level 1If you move an existing repository in, check what depends on its old address. GitHub redirects links, clones and the Marketplace's entry, but only until someone creates a repository with the old name. Container images on ghcr.io keep their old path, so update the image name in your app's config. Then apply the security configuration to the repository.
Check it worked
Create a test repository from your template. Its Settings → Advanced Security page should show the organization's configuration, with Dependabot alerts, secret scanning, push protection, private reporting and CodeQL turned on. Its Security and quality tab should show the security policy while you're signed out. Delete the test repository afterwards.
Attacks on npm, PyPI and GitHub Actions
How six attacks on npm, PyPI and GitHub Actions worked, and which controls would have stopped them.
None of these attacks happened in the Home Assistant Marketplace, and the 2026 sweep found no malware there. The projects here were the victims, and several of them published detailed reports afterwards. Every fact on this page comes from those reports, the registry, GitHub or CISA, linked under each attack.
Phished logins on PyPI and npm, 2025
In July 2025, PyPI found a phishing campaign that sent package maintainers to pypj.org, a lookalike of pypi.org. Four accounts were phished. With one of them, the attacker created API tokens and uploaded two releases of num2words, 0.5.15 and 0.5.16, with malware in them. PyPI removed the releases and revoked the tokens. PyPI's report says the fake site worked as a proxy, so it could capture authenticator-app codes and session cookies as well as passwords. It recommends WebAuthn, meaning a passkey or a security key.
On September 8, 2025, the maintainer of debug, chalk and 16 other npm packages got a 2FA reset email from npmjs.help, which the maintainer later called "shockingly authentic". The npm account was taken over, and new versions such as debug 4.4.2 and chalk 5.6.1 were published with code that redirected cryptocurrency transactions in the browser to the attacker's addresses. npm removed them over the course of the day.
A lookalike site collects the password and the 2FA code.
ACC-1 A passkey or security key only signs in to the site it was made for, so it gives a lookalike nothing to pass on.
The attacker publishes new versions from the maintainer's account.
No control in the repository can stop a publish from the maintainer's own account. This step can only be prevented by ACC-1, in the step before.
Projects that use the package pick up the new version.
DEP-4 npm's versions were gone the same day, so with a 7-day cooldown Dependabot would never have offered them. DEP-3 With exact versions pinned, a new release only reaches your users through a pull request you merge.
Sources: PyPI's incident report, GitHub advisory GHSA-4x49-vf9v-38px, the maintainer's comment.
Shai-Hulud, a worm on npm, 2025
In September 2025, CISA warned of a self-replicating worm that had compromised more than 500 npm packages. Its install script collected GitHub personal access tokens and cloud keys for AWS, Google Cloud and Azure, sent them to the attacker and uploaded them to a public repository named Shai-Hulud. It then signed in to npm as the developer and published infected versions of their other packages, which spread it further. GitHub removed the packages. A second version, which GitHub described in December 2025, also registered infected machines as self-hosted runners and had what GitHub called "destructive functionality".
On December 9, 2025, npm revoked every classic token, limited write tokens to 90 days and made 2FA mandatory for publishing.
An infected version arrives through a dependency update.
DEP-4 A cooldown keeps it out while it's new. DEP-3 Exact pins mean it only arrives in a pull request.
Its install script collects every token it can find, on a laptop or in CI.
ACC-2 A fine-grained token only reaches the repositories and permissions it was given, and it expires. CI-7 A read-only workflow token can't push code or publish anything. SEC-4 With trusted publishing, CI holds no publishing token for the script to find.
It publishes as the developer and keeps whatever access it was given.
ACC-3 CISA's advice included removing the GitHub Apps and OAuth apps you don't need. It also recommended branch protection (BR-1), secret scanning (CI-3) and Dependabot security updates (CI-2).
Sources: CISA's alert, GitHub, September 2025, GitHub, December 2025, npm's token changes.
tj-actions/changed-files, a GitHub Action, March 2025
tj-actions/changed-files was used by over 23,000 repositories. In March 2025, several of its version tags were changed to point to a malicious commit. Workflows that used those tags ran code that read secrets from the runner's memory and printed them in the workflow log, where anyone could read them in a public repository. CISA says an earlier compromise of another action, reviewdog/action-setup, may have made it possible.
Someone with access moves the action's published tags to a new commit.
BR-4 REL-3 For anyone who publishes an action, a tag ruleset or immutable releases stop a published tag from moving.
Every workflow that names the action by tag runs the new code on its next run.
CI-10 A workflow pinned to a commit SHA keeps running the commit it was pinned to.
The code reads the secrets in the job.
CI-7 REL-2 If the job only has a read-only token and no publishing secrets, that's all the code can read.
Sources: GitHub advisory GHSA-mrrh-fwg8-r2c3 (CVE-2025-30066), CISA's alert.
Ultralytics, Nx and TanStack, 2024 to 2026
In December 2024, malicious releases of the Python package ultralytics (8.3.41 and 8.3.42) came out of the project's own release workflow, after an attacker got into its GitHub Actions workflows and poisoned the Actions cache used in the build. Two more (8.3.45 and 8.3.46) were uploaded with a PyPI API token that the workflow could still reach, left over from before the project moved to Trusted Publishing. PyPI's advice was to avoid pull_request_target and shared caches, use Trusted Publishing, and revoke tokens you don't use.
In August 2025, a workflow in the Nx project that checked pull request titles ran on pull_request_target and put the title straight into a shell command. A pull request with a crafted title ran commands with a read and write GitHub token. With it, the attacker pushed a branch that changed a script, started the publish workflow and took its npm token. Malicious versions were live for 4 hours on August 26. Their install script searched the machine for secrets, tried to use local AI tools such as Claude and Gemini, and uploaded what it found to a public GitHub repository.
In May 2026, a TanStack workflow that measured bundle size ran on pull_request_target and built the pull request's code. That code saved a poisoned package store into the Actions cache, under the key the release workflow restores on every push to main. When the release workflow next ran, the malware read its short-lived publishing token from the runner's memory and published 84 versions of 42 packages to npm through trusted publishing. "No npm tokens were stolen," TanStack's postmortem says. An outside researcher reported it 26 minutes after the first publish, and npm had removed all of them within about four and a half hours.
A workflow runs a stranger's pull request with the repository's own access.
CI-9 Never run a pull request's code in a
pull_request_targetworkflow. CI-8 Keep text like a pull request's title out ofrun:lines.The pull request's code reaches the release, through a token, a script or a shared cache.
CI-7 With a read-only default token, Nx's title-check workflow would have had nothing to push a branch with. REL-2 A release environment keeps publishing secrets away from other workflows.
The release goes out with the project's own credentials.
SEC-4 Trusted publishing leaves no token to steal. Ultralytics' second pair of releases used a token left over from before the move. It can't help once untrusted code runs inside the release job, which is what happened at TanStack. DEP-4 For projects that use these packages, a 7-day cooldown would have kept out Nx's and TanStack's versions, which were gone within hours.
Sources: PyPI's analysis of the Ultralytics attack, Nx's postmortem, TanStack's postmortem.
xz-utils, 2024
The release tarballs of xz-utils 5.6.0 and 5.6.1 contained a backdoor (CVE-2024-3094). The project's original maintainer wrote that they were created and signed by Jia Tan, and that the backdoor's files in the repository were harmless without the trigger code, which "was never included in the Git repository". So reading the repository wouldn't have shown the backdoor, because only the release files had all of it.
A release file is made by hand, outside CI.
REL-1 When a workflow builds the release from main and attests it, the release is the code in the repository, and anyone can check that with
gh attestation verify.Reviewers read the repository, and users install the release.
The 2026 sweep found 84 Marketplace apps whose release code differs from their repository.
Sources: CVE-2024-3094, the maintainer's page on the backdoor.
event-stream, 2018
npm's report says an attacker, "posing as a maintainer", took over maintainership of the event-stream package, and on September 9, 2018, added a new dependency, flatmap-stream, in version 3.3.6. Its code was written for one app, the Copay bitcoin wallet, and harvested account details and private keys from wallets holding more than 100 bitcoin or 1,000 bitcoin cash. Copay shipped it in versions 5.0.2 to 5.1.0. npm's security team heard about it on November 26, more than two months later.
A package changes hands.
DEP-2 Check who maintains a package before you add it. DEP-6 Replace packages nobody looks after. ACC-6 For your own project, plan who takes over if you step away.
A new dependency arrives in an update.
DEP-3 With exact pins, it only arrives in a pull request, where the new dependency is in the diff.
Source: npm's report.
# Organizations An organization owns repositories the way your own account does, but it can have several owners and one set of security settings that every new repository starts with. Source: https://ha-barkley.github.io/security/controls/organizations/ From HASC, the Home Assistant Security Controls for integrations, cards and apps. A community catalog, not an official Home Assistant or Open Home Foundation project. Each control has an ID, cited as HASC-CI-4, and a level from 1 to 3. "Level marker" means anyone can check the control from outside the project, and levels are graded on those controls only. > **From the 2026 sweep.** 307 of the 4,424 accounts that publish Marketplace apps (6.9%) are organizations. Among the 137 accounts with five or more apps, 17 are. The [Marketplace report](https://ha-barkley.github.io/marketplace/2026/accounts-and-reach/) has more on this. These steps apply only if your project is in an organization. A project on a personal account can reach every level without one. ## When an organization helps - More than one person works on the project. - You publish several apps and want them all to start with the same settings. - You might hand the project over one day. Changing who's in an organization is easier than transferring every repository. If you maintain one app on your own, you don't need one. Start with [Your GitHub account](https://ha-barkley.github.io/security/controls/account/) instead. ## What you gain and what it costs On the free plan, an organization gives you: - Several owners, each with their own login, so nobody shares a password or a token. - Two-factor login required for everyone in it. - One security configuration that new repositories get automatically. - One Actions policy for every repository, such as which actions may run and whether they must be pinned. - Default community files, such as a security policy, from a single `.github` repository. It has costs too. - Rules for main and tags are still set in each repository. Organization-wide rulesets need a paid plan (Team or Enterprise). - Moving an existing repository in has side effects. GitHub redirects the old address, but container images on ghcr.io don't follow, and the default security configuration isn't applied to a repository you move in. - It's one more thing to protect. An owner can change or delete every repository in the organization. ## Controls Do these in order, and finish the first five before you create or move any repositories into the organization. The default security configuration only reaches repositories created after you set it. ### ORG-1: Secure your own account first, then create the organization from it *Level 1* Settings → Organizations → New organization, on the free plan. Whoever holds an owner's login controls the organization, so do the steps in [Your GitHub account](https://ha-barkley.github.io/security/controls/account/) before this one. ### ORG-2: Require two-factor login for everyone *Level 1* In the organization's Settings → Authentication security, turn on the two-factor requirement. GitHub removes anyone who doesn't have it, and you can add them back once they've set it up. ### ORG-3: Decide who the owners are *Level 1* If you work alone, one owner is fine, but losing your login then means losing the organization. Keep your recovery codes offline and set up a second way to sign in. It also helps to write down who could take over. If others work with you, make two people you trust owners and everyone else a member. ### ORG-4: Limit what members can do *Level 1* In the organization's Settings, open Member privileges. - Base permission: *Read*, which is the default. Give write access per repository instead. - Repository creation: untick *Public* and *Private*, so only owners create repositories. Members can create both by default. - Admin repository permissions: untick *Repository deletion and transfer*, so only owners can delete or move a repository. - Pages creation: untick *Public*, so only owners can publish a website under the organization's name. ### ORG-5: Create a security configuration for every repository, new ones included *Level 1* In the organization's Settings, open Advanced Security → Configurations → New configuration. Most features start enabled. Change these: - Name: your organization's name followed by "Baseline", such as "my-org Baseline". - Dependabot alerts → Security updates: *Enabled*. - Dependabot alerts → Malware alerts: *Enabled*. - Policy → Use as default for newly created repositories: *Public*. - Policy → Enforce configuration: keep *Enforce for repository owners*, so nobody can turn a feature off in one repository. If several people have write access, also set Bypass privileges and each Prevent direct alert dismissals, so one person can't push a secret or dismiss an alert alone. Leave the rest as it starts. Choose Save configuration. Saving doesn't apply it to the repositories you already have, so apply it next: 1. On the Configurations page, choose the pencil beside your new configuration. 2. Set Apply to: *All repositories*, and check that Allow repository owners to modify features is *Off*. 3. Choose Review, then Save and enable. These features are free for public repositories. On a paid plan with GitHub Advanced Security, private repositories are billed per active committer, and the review screen shows how many licenses it would use. Choose *All* for new repositories only if you mean to pay for them. A repository you move in later needs the configuration applied by hand. ### ORG-6: Set an Actions policy *Level 2* Settings → Actions → General. - Allow only actions created by GitHub, plus the ones you list, such as `home-assistant/*` and `hacs/*`. - Turn on *Require actions to be pinned to a full-length commit SHA*. Workflows that use a tag or a branch, like `@v7` or `@main`, then fail, so pin them first and let Dependabot keep the SHAs current. - Under Workflow permissions, choose read-only access, so a workflow without its own `permissions` block can't write. - Untick *Allow GitHub Actions to create and approve pull requests*. ### ORG-7: If the organization holds several apps, add a public `.github` repository with default community files *Level 1* A `SECURITY.md` and `.github/ISSUE_TEMPLATE/config.yml` there show on every repository that doesn't have its own, and that `SECURITY.md` counts as each of those repositories' security policy for level 1. Use the files from [Security policy](https://ha-barkley.github.io/security/controls/security-policy/) and [Repository basics](https://ha-barkley.github.io/security/controls/repository/), with the organization's name in place of a single repository. Some tools only read a repository's own files, so the template below carries a copy too. ### ORG-8: If the organization holds several apps, start new ones from a template repository *Level 2* Add the files every new app should start with, then tick Settings → General → Template repository. - `SECURITY.md`, issue forms and a `.gitignore` with secret patterns - `.github/dependabot.yml` with a 7-day cooldown - The security workflow from [Checks in CI](https://ha-barkley.github.io/security/controls/ci/), with actions pinned by SHA - The release workflow from [Releases](https://ha-barkley.github.io/security/controls/releases/) A template only copies files. Each new repository still needs its own rulesets for main and tags. Set them up once, export them (Settings → Rules → Rulesets, then Export on each ruleset), and import them into the next repository with New ruleset → Import a ruleset. The bypass list isn't exported, so add it again. ### ORG-9: If you move an existing repository in *Level 1* **If you move an existing repository in,** check what depends on its old address. GitHub redirects links, clones and the Marketplace's entry, but only until someone creates a repository with the old name. Container images on ghcr.io keep their old path, so update the image name in your app's config. Then apply the security configuration to the repository. ### Check it worked Create a test repository from your template. Its Settings → Advanced Security page should show the organization's configuration, with Dependabot alerts, secret scanning, push protection, private reporting and CodeQL turned on. Its Security and quality tab should show the security policy while you're signed out. Delete the test repository afterwards.