{"about":{"applies_to":"The kinds of project the control applies to.","id":"Cite a control by its id, such as HASC-CI-4. IDs are never reused. A dropped control stays in this list with withdrawn set to true, level null, and replaced_by listing the controls that cover it now.","level":"Each level needs everything in the levels below it.","level_marker":"True when anyone can check the control from outside the project. A level is graded on these controls only.","when":"A walk-through step or phase with when applies only for those answers, written question:answer. Any one of them is enough. Empty means always.","why":"What goes wrong without the control, with a real incident where one fits. Empty for controls not written up yet."},"controls":[{"applies_to":["integration","card","app"],"family":"ACC","id":"HASC-ACC-1","key":"acc-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Turn on two-factor login with a passkey or a security key","url":"https://ha-barkley.github.io/security/controls/account/#acc-1","why":"A common way to take over an account is a page that looks like a real login. A password and an authenticator code work on any site you type them into, and a lookalike can pass them straight on to the real one. A passkey or security key only works on the site it was made for. In 2025, phishing like this was used to publish malware from maintainers' accounts on both PyPI and npm (how it happened).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ACC","id":"HASC-ACC-2","key":"acc-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Replace classic personal access tokens with fine-grained ones","url":"https://ha-barkley.github.io/security/controls/account/#acc-2","why":"A token works for anyone who has a copy, with no password or 2FA, and copies end up in CI secrets, .env files and old laptops. A classic token can act on every repository you can reach and never expires. A fine-grained one only reaches the repository and permissions you gave it, until its expiry date. The Shai-Hulud worm collected tokens like these from developers' machines and CI in 2025 (how it happened).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ACC","id":"HASC-ACC-3","key":"acc-3","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Review what can act for you","url":"https://ha-barkley.github.io/security/controls/account/#acc-3","why":"Every OAuth app, GitHub App, SSH key and signed-in session can act for you without your password, and each is another way into your account. Some were probably added years ago for something you no longer use. After the Shai-Hulud worm, CISA's advice included removing the GitHub Apps and OAuth apps you don't need (how it happened).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ACC","id":"HASC-ACC-4","key":"acc-4","level":2,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Sign your commits","url":"https://ha-barkley.github.io/security/controls/account/#acc-4","why":"Git lets anyone put any name and email on a commit. A signature can't be made without your key, so signed commits let people tell your work from a commit pushed with a stolen token or written to look like yours. In 2021, two malicious commits were pushed to PHP's source code in the names of two of its core developers (PHP's announcement).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ACC","id":"HASC-ACC-5","key":"acc-5","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Then turn on vigilant mode","url":"https://ha-barkley.github.io/security/controls/account/#acc-5","why":"Signing only helps if an unsigned commit in your name stands out. Without vigilant mode, GitHub shows an unsigned commit with no label, like most commits. With it on, an unsigned commit in your name shows \"Unverified\".","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ACC","id":"HASC-ACC-6","key":"acc-6","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Give the project a second maintainer, or at least a plan","url":"https://ha-barkley.github.io/security/controls/account/#acc-6","why":"When one person can publish, nobody notices an odd release from that account, and nobody can step in if that person loses access or moves on. If its maintainer leaves without a plan, a project can pass to whoever asks for it. In 2018, someone posing as a maintainer took over the event-stream package on npm and added code that stole from bitcoin wallets (how it happened).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"BR","id":"HASC-BR-1","key":"br-1","level":2,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Add a branch ruleset for main","url":"https://ha-barkley.github.io/security/controls/branches-and-tags/#br-1","why":"","withdrawn":false},{"applies_to":[],"family":"BR","id":"HASC-BR-2","key":"br-2","level":null,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":["HASC-GATE-1","HASC-GATE-2"],"title":"Require your checks to pass","url":"https://ha-barkley.github.io/security/controls/branches-and-tags/#br-2","why":"","withdrawn":true},{"applies_to":["integration","card","app"],"family":"BR","id":"HASC-BR-3","key":"br-3","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep the bypass list short","url":"https://ha-barkley.github.io/security/controls/branches-and-tags/#br-3","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"BR","id":"HASC-BR-4","key":"br-4","level":3,"level_marker":true,"level_note":"or immutable releases","organizations_only":false,"replaced_by":[],"title":"Add a tag ruleset for your release tags","url":"https://ha-barkley.github.io/security/controls/branches-and-tags/#br-4","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-1","key":"ci-1","level":1,"level_marker":true,"level_note":"or a security workflow","organizations_only":false,"replaced_by":[],"title":"Turn on CodeQL default setup","url":"https://ha-barkley.github.io/security/controls/ci/#ci-1","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-2","key":"ci-2","level":1,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Turn on Dependabot alerts and security updates","url":"https://ha-barkley.github.io/security/controls/ci/#ci-2","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-3","key":"ci-3","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Turn on secret scanning and push protection","url":"https://ha-barkley.github.io/security/controls/ci/#ci-3","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-4","key":"ci-4","level":1,"level_marker":true,"level_note":"or CodeQL","organizations_only":false,"replaced_by":[],"title":"Add a security workflow","url":"https://ha-barkley.github.io/security/controls/ci/#ci-4","why":"","withdrawn":false},{"applies_to":["integration","card"],"family":"CI","id":"HASC-CI-5","key":"ci-5","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Validate against Home Assistant's own rules","url":"https://ha-barkley.github.io/security/controls/ci/#ci-5","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-6","key":"ci-6","level":1,"level_marker":false,"level_note":"optional","organizations_only":false,"replaced_by":[],"title":"Optional: catch problems before you commit","url":"https://ha-barkley.github.io/security/controls/ci/#ci-6","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-7","key":"ci-7","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Give workflows read-only tokens","url":"https://ha-barkley.github.io/security/controls/ci/#ci-7","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-8","key":"ci-8","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep untrusted text out of run: lines","url":"https://ha-barkley.github.io/security/controls/ci/#ci-8","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-9","key":"ci-9","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Never run a pull request's code in a pull_request_target workflow","url":"https://ha-barkley.github.io/security/controls/ci/#ci-9","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-10","key":"ci-10","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Pin actions to a full commit SHA","url":"https://ha-barkley.github.io/security/controls/ci/#ci-10","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-11","key":"ci-11","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Don't leave the token behind after checkout","url":"https://ha-barkley.github.io/security/controls/ci/#ci-11","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-12","key":"ci-12","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Use a GitHub App token instead of a personal access token","url":"https://ha-barkley.github.io/security/controls/ci/#ci-12","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"CI","id":"HASC-CI-13","key":"ci-13","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Check your workflows with zizmor","url":"https://ha-barkley.github.io/security/controls/ci/#ci-13","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"GATE","id":"HASC-GATE-1","key":"gate-1","level":2,"level_marker":true,"level_note":"or a required check","organizations_only":false,"replaced_by":[],"title":"For CodeQL, require code scanning results","url":"https://ha-barkley.github.io/security/controls/blocking-checks/#gate-1","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"GATE","id":"HASC-GATE-2","key":"gate-2","level":2,"level_marker":true,"level_note":"or code scanning","organizations_only":false,"replaced_by":[],"title":"Require your other checks by job name","url":"https://ha-barkley.github.io/security/controls/blocking-checks/#gate-2","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"GATE","id":"HASC-GATE-3","key":"gate-3","level":2,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Make sure each check can fail","url":"https://ha-barkley.github.io/security/controls/blocking-checks/#gate-3","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"GATE","id":"HASC-GATE-4","key":"gate-4","level":2,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Work through pull requests, even alone","url":"https://ha-barkley.github.io/security/controls/blocking-checks/#gate-4","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"POL","id":"HASC-POL-1","key":"pol-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Turn on private vulnerability reporting","url":"https://ha-barkley.github.io/security/controls/security-policy/#pol-1","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"POL","id":"HASC-POL-2","key":"pol-2","level":1,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Add a SECURITY.md","url":"https://ha-barkley.github.io/security/controls/security-policy/#pol-2","why":"","withdrawn":false},{"applies_to":[],"family":"POL","id":"HASC-POL-3","key":"pol-3","level":null,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":["HASC-REPO-2"],"title":"Point the issue form there too","url":"https://ha-barkley.github.io/security/controls/security-policy/#pol-3","why":"","withdrawn":true},{"applies_to":["integration","card","app"],"family":"POL","id":"HASC-POL-4","key":"pol-4","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"When a report comes in","url":"https://ha-barkley.github.io/security/controls/security-policy/#pol-4","why":"","withdrawn":false},{"applies_to":["integration"],"family":"SEC","id":"HASC-SEC-1","key":"sec-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Ask users for credentials in the config flow","url":"https://ha-barkley.github.io/security/controls/secrets/#sec-1","why":"","withdrawn":false},{"applies_to":["integration"],"family":"SEC","id":"HASC-SEC-2","key":"sec-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Redact diagnostics and keep secrets out of logs","url":"https://ha-barkley.github.io/security/controls/secrets/#sec-2","why":"","withdrawn":false},{"applies_to":[],"family":"SEC","id":"HASC-SEC-3","key":"sec-3","level":null,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":["HASC-REPO-3","HASC-CI-3"],"title":"Ignore local secret files","url":"https://ha-barkley.github.io/security/controls/secrets/#sec-3","why":"","withdrawn":true},{"applies_to":["integration","card","app"],"family":"SEC","id":"HASC-SEC-4","key":"sec-4","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"In CI, prefer no secret at all","url":"https://ha-barkley.github.io/security/controls/secrets/#sec-4","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"SEC","id":"HASC-SEC-5","key":"sec-5","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"If a secret leaks, revoke it first","url":"https://ha-barkley.github.io/security/controls/secrets/#sec-5","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REPO","id":"HASC-REPO-1","key":"repo-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Add a bug report form","url":"https://ha-barkley.github.io/security/controls/repository/#repo-1","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REPO","id":"HASC-REPO-2","key":"repo-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Turn off blank issues and link the private report","url":"https://ha-barkley.github.io/security/controls/repository/#repo-2","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REPO","id":"HASC-REPO-3","key":"repo-3","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Add a .gitignore","url":"https://ha-barkley.github.io/security/controls/repository/#repo-3","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REPO","id":"HASC-REPO-4","key":"repo-4","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Close issues with the fix","url":"https://ha-barkley.github.io/security/controls/repository/#repo-4","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REPO","id":"HASC-REPO-5","key":"repo-5","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"List the servers your app talks to","url":"https://ha-barkley.github.io/security/controls/repository/#repo-5","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REL","id":"HASC-REL-1","key":"rel-1","level":3,"level_marker":true,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Build and publish releases from a workflow","url":"https://ha-barkley.github.io/security/controls/releases/#rel-1","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REL","id":"HASC-REL-2","key":"rel-2","level":3,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep publishing secrets in a release environment","url":"https://ha-barkley.github.io/security/controls/releases/#rel-2","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REL","id":"HASC-REL-3","key":"rel-3","level":3,"level_marker":true,"level_note":"or a tag ruleset","organizations_only":false,"replaced_by":[],"title":"Turn on immutable releases","url":"https://ha-barkley.github.io/security/controls/releases/#rel-3","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"REL","id":"HASC-REL-4","key":"rel-4","level":3,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Don't commit build output you also release","url":"https://ha-barkley.github.io/security/controls/releases/#rel-4","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-1","key":"org-1","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"Secure your own account first, then create the organization from it","url":"https://ha-barkley.github.io/security/controls/organizations/#org-1","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-2","key":"org-2","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"Require two-factor login for everyone","url":"https://ha-barkley.github.io/security/controls/organizations/#org-2","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-3","key":"org-3","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"Decide who the owners are","url":"https://ha-barkley.github.io/security/controls/organizations/#org-3","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-4","key":"org-4","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"Limit what members can do","url":"https://ha-barkley.github.io/security/controls/organizations/#org-4","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-5","key":"org-5","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"Create a security configuration for every repository, new ones included","url":"https://ha-barkley.github.io/security/controls/organizations/#org-5","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-6","key":"org-6","level":2,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"Set an Actions policy","url":"https://ha-barkley.github.io/security/controls/organizations/#org-6","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-7","key":"org-7","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"If the organization holds several apps, add a public .github repository with default community files","url":"https://ha-barkley.github.io/security/controls/organizations/#org-7","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-8","key":"org-8","level":2,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"If the organization holds several apps, start new ones from a template repository","url":"https://ha-barkley.github.io/security/controls/organizations/#org-8","why":"","withdrawn":false},{"applies_to":["integration","card","app"],"family":"ORG","id":"HASC-ORG-9","key":"org-9","level":1,"level_marker":false,"level_note":"","organizations_only":true,"replaced_by":[],"title":"If you move an existing repository in","url":"https://ha-barkley.github.io/security/controls/organizations/#org-9","why":"","withdrawn":false},{"applies_to":["integration"],"family":"INT","id":"HASC-INT-1","key":"int-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Never fetch code at run time","url":"https://ha-barkley.github.io/security/controls/integrations/#int-1","why":"","withdrawn":false},{"applies_to":["integration"],"family":"INT","id":"HASC-INT-2","key":"int-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep the login on every page you add","url":"https://ha-barkley.github.io/security/controls/integrations/#int-2","why":"","withdrawn":false},{"applies_to":["integration"],"family":"INT","id":"HASC-INT-3","key":"int-3","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Save settings and state with the storage helper, and never with pickle","url":"https://ha-barkley.github.io/security/controls/integrations/#int-3","why":"","withdrawn":false},{"applies_to":["integration"],"family":"INT","id":"HASC-INT-4","key":"int-4","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Use Home Assistant's shared web session","url":"https://ha-barkley.github.io/security/controls/integrations/#int-4","why":"","withdrawn":false},{"applies_to":["integration"],"family":"INT","id":"HASC-INT-5","key":"int-5","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Avoid the calls that turn data into code","url":"https://ha-barkley.github.io/security/controls/integrations/#int-5","why":"","withdrawn":false},{"applies_to":["integration"],"family":"INT","id":"HASC-INT-6","key":"int-6","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Send each credential only to its own service","url":"https://ha-barkley.github.io/security/controls/integrations/#int-6","why":"","withdrawn":false},{"applies_to":["card"],"family":"CARD","id":"HASC-CARD-1","key":"card-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Bundle your libraries into the card","url":"https://ha-barkley.github.io/security/controls/cards/#card-1","why":"","withdrawn":false},{"applies_to":["card"],"family":"CARD","id":"HASC-CARD-2","key":"card-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep the login token where it is","url":"https://ha-barkley.github.io/security/controls/cards/#card-2","why":"","withdrawn":false},{"applies_to":["card"],"family":"CARD","id":"HASC-CARD-3","key":"card-3","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Render with Lit templates, not innerHTML","url":"https://ha-barkley.github.io/security/controls/cards/#card-3","why":"","withdrawn":false},{"applies_to":["card"],"family":"CARD","id":"HASC-CARD-4","key":"card-4","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep build tools current","url":"https://ha-barkley.github.io/security/controls/cards/#card-4","why":"","withdrawn":false},{"applies_to":["integration"],"family":"DEP","id":"HASC-DEP-1","key":"dep-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Use what Home Assistant already ships first","url":"https://ha-barkley.github.io/security/controls/dependencies/#dep-1","why":"Each package you add is code from more people you have to trust, and one more account that can be taken over. Home Assistant already ships and updates the common ones, so using them doesn't add anyone new for your users to trust.","withdrawn":false},{"applies_to":["integration","card","app"],"family":"DEP","id":"HASC-DEP-2","key":"dep-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Check a package before you add it","url":"https://ha-barkley.github.io/security/controls/dependencies/#dep-2","why":"Some packages are published under a name one letter away from a popular one, so that a typo installs them. Others change hands without anyone noticing. In 2018, someone posing as a maintainer took over event-stream and added code aimed at one bitcoin wallet app (how it happened).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"DEP","id":"HASC-DEP-3","key":"dep-3","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Pin exact versions","url":"https://ha-barkley.github.io/security/controls/dependencies/#dep-3","why":"With a range such as \u003e=2.0, every new install takes whatever was published last, including a version published from a stolen account an hour ago. With an exact pin, a new version only reaches your users after you merge a pull request for it (phished logins, Shai-Hulud).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"DEP","id":"HASC-DEP-4","key":"dep-4","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Wait at least 7 days before taking a new release","url":"https://ha-barkley.github.io/security/controls/dependencies/#dep-4","why":"Malicious versions are usually found and removed fast. npm removed the September 2025 phishing versions the same day, and TanStack's within about four and a half hours. With a 7-day cooldown, Dependabot only offers a release once it has been public for a week, so versions like these have been removed before it offers them (how it happened).","withdrawn":false},{"applies_to":["integration","card","app"],"family":"DEP","id":"HASC-DEP-5","key":"dep-5","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Check for known vulnerabilities in CI","url":"https://ha-barkley.github.io/security/controls/dependencies/#dep-5","why":"Most vulnerable code in an app is an old version of a library that already has a fix. A check in CI tells you when a package you use gets an advisory, before a user reports it.","withdrawn":false},{"applies_to":["integration","card","app"],"family":"DEP","id":"HASC-DEP-6","key":"dep-6","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Replace dead packages","url":"https://ha-barkley.github.io/security/controls/dependencies/#dep-6","why":"A package nobody maintains gets no security fixes, and nobody is watching when it changes hands.","withdrawn":false},{"applies_to":["app"],"family":"APP","id":"HASC-APP-1","key":"app-1","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Ask only for the access the app uses","url":"https://ha-barkley.github.io/security/controls/apps/#app-1","why":"","withdrawn":false},{"applies_to":["app"],"family":"APP","id":"HASC-APP-2","key":"app-2","level":1,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Use ingress instead of open ports","url":"https://ha-barkley.github.io/security/controls/apps/#app-2","why":"","withdrawn":false},{"applies_to":["app"],"family":"APP","id":"HASC-APP-3","key":"app-3","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Keep AppArmor on","url":"https://ha-barkley.github.io/security/controls/apps/#app-3","why":"","withdrawn":false},{"applies_to":["app"],"family":"APP","id":"HASC-APP-4","key":"app-4","level":2,"level_marker":false,"level_note":"","organizations_only":false,"replaced_by":[],"title":"Build on Home Assistant's base images","url":"https://ha-barkley.github.io/security/controls/apps/#app-4","why":"","withdrawn":false}],"families":[{"code":"ACC","markdown":"https://ha-barkley.github.io/security/controls/account/index.md","title":"Your GitHub account","url":"https://ha-barkley.github.io/security/controls/account/"},{"code":"BR","markdown":"https://ha-barkley.github.io/security/controls/branches-and-tags/index.md","title":"Branch and tag protection","url":"https://ha-barkley.github.io/security/controls/branches-and-tags/"},{"code":"CI","markdown":"https://ha-barkley.github.io/security/controls/ci/index.md","title":"Checks in CI","url":"https://ha-barkley.github.io/security/controls/ci/"},{"code":"GATE","markdown":"https://ha-barkley.github.io/security/controls/blocking-checks/index.md","title":"Checks that block","url":"https://ha-barkley.github.io/security/controls/blocking-checks/"},{"code":"POL","markdown":"https://ha-barkley.github.io/security/controls/security-policy/index.md","title":"Security policy","url":"https://ha-barkley.github.io/security/controls/security-policy/"},{"code":"SEC","markdown":"https://ha-barkley.github.io/security/controls/secrets/index.md","title":"Secrets","url":"https://ha-barkley.github.io/security/controls/secrets/"},{"code":"REPO","markdown":"https://ha-barkley.github.io/security/controls/repository/index.md","title":"Repository basics","url":"https://ha-barkley.github.io/security/controls/repository/"},{"code":"REL","markdown":"https://ha-barkley.github.io/security/controls/releases/index.md","title":"Releases","url":"https://ha-barkley.github.io/security/controls/releases/"},{"code":"ORG","markdown":"https://ha-barkley.github.io/security/controls/organizations/index.md","title":"Organizations","url":"https://ha-barkley.github.io/security/controls/organizations/"},{"code":"INT","markdown":"https://ha-barkley.github.io/security/controls/integrations/index.md","title":"Integrations","url":"https://ha-barkley.github.io/security/controls/integrations/"},{"code":"CARD","markdown":"https://ha-barkley.github.io/security/controls/cards/index.md","title":"Dashboard cards","url":"https://ha-barkley.github.io/security/controls/cards/"},{"code":"DEP","markdown":"https://ha-barkley.github.io/security/controls/dependencies/index.md","title":"Dependencies","url":"https://ha-barkley.github.io/security/controls/dependencies/"},{"code":"APP","markdown":"https://ha-barkley.github.io/security/controls/apps/index.md","title":"Apps (add-ons)","url":"https://ha-barkley.github.io/security/controls/apps/"}],"levels":[{"goal":"Lock your account and give people a private way to report problems. GitHub's free checks then watch every change.","level":1,"title":"Basics"},{"goal":"Make main the only way in, so every change passes your checks before it reaches anyone.","level":2,"title":"Checks that block"},{"goal":"Build releases in CI from main and lock them, so what people install matches the code anyone can read.","level":3,"title":"Releases people can check"}],"name":"HASC: Home Assistant Security Controls for integrations, cards and apps","note":"A community catalog, not an official Home Assistant or Open Home Foundation project.","schema":1,"status":"draft","url":"https://ha-barkley.github.io/security/controls/","version":"0.1","walk_throughs":[{"markdown":"https://ha-barkley.github.io/security/walk-throughs/new-organization/index.md","phases":[{"steps":[{"control":"HASC-ACC-1","level":1,"when":[]},{"control":"HASC-ACC-2","level":1,"when":[]},{"control":"HASC-ACC-3","level":1,"when":[]}],"title":"Secure your own account first","when":[]},{"steps":[{"control":"HASC-ORG-1","level":1,"when":[]},{"control":"HASC-ORG-2","level":1,"when":[]},{"control":"HASC-ORG-3","level":1,"when":[]},{"control":"HASC-ORG-4","level":1,"when":[]}],"title":"Create the organization","when":[]},{"steps":[{"control":"HASC-ORG-5","level":1,"when":[]},{"control":"HASC-ORG-6","level":2,"when":[]},{"level":2,"title":"Plan to pin actions in every workflow","when":[]}],"title":"Set what every new repository gets","when":[]},{"steps":[{"control":"HASC-ORG-7","level":1,"when":[]},{"control":"HASC-ORG-8","level":2,"when":[]}],"title":"Share files across your apps","when":["size:several"]},{"steps":[{"control":"HASC-ORG-9","level":1,"when":[]}],"title":"Move your repositories in","when":["moving:yes"]},{"steps":[{"level":1,"title":"Create a test repository and look at its settings","when":[]}],"title":"Check it worked","when":[]}],"questions":[{"id":"size","options":[{"label":"One","value":"one"},{"label":"Several apps","value":"several"}],"question":"How many repositories will it hold?"},{"id":"moving","options":[{"label":"No","value":"no"},{"label":"Yes","value":"yes"}],"question":"Are you moving repositories in from your own account?"}],"title":"Secure a new organization","url":"https://ha-barkley.github.io/security/walk-throughs/new-organization/"},{"markdown":"https://ha-barkley.github.io/security/walk-throughs/new-project/index.md","phases":[{"steps":[{"control":"HASC-ACC-1","level":1,"when":[]},{"control":"HASC-ACC-4","level":2,"when":[]},{"control":"HASC-ACC-5","level":2,"when":[]}],"title":"Before you create the repository","when":[]},{"steps":[{"control":"HASC-REPO-3","level":1,"when":[]},{"control":"HASC-POL-2","level":1,"when":[]},{"control":"HASC-REPO-2","level":1,"when":[]},{"control":"HASC-REPO-1","level":1,"when":[]}],"title":"Start with these files","when":[]},{"steps":[{"control":"HASC-POL-1","level":1,"when":[]},{"control":"HASC-CI-1","level":1,"when":[]},{"control":"HASC-CI-3","level":1,"when":[]},{"control":"HASC-CI-2","level":1,"when":[]},{"control":"HASC-DEP-4","level":1,"when":[]}],"title":"Turn on GitHub's checks","when":["home:personal"]},{"steps":[{"control":"HASC-POL-1","level":1,"when":[]},{"control":"HASC-CI-1","level":1,"when":[]},{"control":"HASC-CI-3","level":1,"when":[]},{"control":"HASC-CI-2","level":1,"when":[]},{"control":"HASC-DEP-4","level":1,"when":[]}],"title":"Check what your organization turned on","when":["home:org"]},{"steps":[{"control":"HASC-CI-7","level":1,"when":[]},{"control":"HASC-CI-8","level":1,"when":[]},{"control":"HASC-CI-9","level":1,"when":[]},{"control":"HASC-CI-10","level":2,"when":["home:personal"]},{"control":"HASC-CI-10","level":2,"when":["home:org"]},{"control":"HASC-CI-11","level":2,"when":[]},{"control":"HASC-CI-4","level":1,"when":["kind:integration","kind:card"]},{"control":"HASC-CI-4","level":1,"when":["kind:app"]},{"control":"HASC-DEP-5","level":1,"when":[]},{"control":"HASC-CI-5","level":1,"when":["kind:integration","kind:card"]},{"control":"HASC-CI-5","level":1,"when":["kind:app"]},{"control":"HASC-CI-13","level":2,"when":[]},{"control":"HASC-CI-12","level":2,"when":[]}],"title":"Add your workflows","when":[]},{"steps":[{"control":"HASC-INT-1","level":1,"when":[]},{"control":"HASC-INT-2","level":1,"when":[]},{"control":"HASC-INT-3","level":1,"when":[]},{"control":"HASC-INT-4","level":1,"when":[]},{"control":"HASC-INT-5","level":1,"when":[]},{"control":"HASC-INT-6","level":1,"when":[]},{"control":"HASC-SEC-1","level":1,"when":[]},{"control":"HASC-SEC-2","level":1,"when":[]}],"title":"Write the integration safely","when":["kind:integration"]},{"steps":[{"control":"HASC-CARD-1","level":1,"when":[]},{"control":"HASC-CARD-2","level":1,"when":[]},{"control":"HASC-CARD-3","level":1,"when":[]},{"control":"HASC-CARD-4","level":2,"when":[]}],"title":"Write the card safely","when":["kind:card"]},{"steps":[{"control":"HASC-APP-1","level":1,"when":[]},{"control":"HASC-APP-2","level":1,"when":[]},{"control":"HASC-APP-3","level":2,"when":[]},{"control":"HASC-APP-4","level":2,"when":[]}],"title":"Write the app safely","when":["kind:app"]},{"steps":[{"control":"HASC-DEP-1","level":1,"when":["kind:integration"]},{"control":"HASC-DEP-2","level":1,"when":[]},{"control":"HASC-DEP-3","level":1,"when":[]}],"title":"Choose dependencies carefully","when":[]},{"steps":[{"control":"HASC-BR-1","level":2,"when":[]},{"control":"HASC-GATE-1","level":2,"when":[]},{"control":"HASC-GATE-2","level":2,"when":[]},{"control":"HASC-GATE-3","level":2,"when":[]},{"control":"HASC-BR-3","level":2,"when":[]},{"control":"HASC-GATE-4","level":2,"when":[]}],"title":"Protect main","when":[]},{"steps":[{"control":"HASC-BR-4","level":3,"when":[]},{"control":"HASC-REL-3","level":3,"when":[]},{"control":"HASC-REL-1","level":3,"when":["kind:integration","kind:card"]},{"control":"HASC-REL-1","level":3,"when":["kind:app"]},{"control":"HASC-REL-4","level":3,"when":["kind:card"]},{"control":"HASC-REL-2","level":3,"when":[]},{"control":"HASC-SEC-4","level":2,"when":[]},{"level":3,"title":"Publish your first release from a tag on main","when":[]}],"title":"Set up releases before the first one","when":[]},{"steps":[{"control":"HASC-REPO-5","level":1,"when":[]},{"control":"HASC-ACC-6","level":2,"when":[]}],"title":"Tell people what to expect","when":[]},{"steps":[{"control":"HASC-POL-4","level":1,"when":[]},{"control":"HASC-REPO-4","level":2,"when":[]},{"control":"HASC-DEP-6","level":2,"when":[]}],"title":"Once people use it","when":[]}],"questions":[{"id":"kind","options":[{"label":"An integration","value":"integration"},{"label":"A dashboard card","value":"card"},{"label":"An app (add-on)","value":"app"}],"question":"What are you building?"},{"id":"home","options":[{"label":"My own account","value":"personal"},{"label":"An organization with a security configuration","value":"org"}],"question":"Where will the repository live?"}],"title":"Secure a new project","url":"https://ha-barkley.github.io/security/walk-throughs/new-project/"},{"markdown":"https://ha-barkley.github.io/security/walk-throughs/existing-project/index.md","phases":[{"steps":[{"level":1,"title":"Apply your organization's configuration to this repository","when":["home:org"]},{"control":"HASC-POL-1","level":1,"when":["home:personal"]},{"control":"HASC-CI-1","level":1,"when":["home:personal"]},{"control":"HASC-CI-3","level":1,"when":["home:personal"]},{"control":"HASC-CI-2","level":1,"when":[]},{"control":"HASC-DEP-4","level":1,"when":[]}],"title":"Turn on the checks that only report","when":[]},{"steps":[{"control":"HASC-POL-2","level":1,"when":[]},{"control":"HASC-REPO-2","level":1,"when":[]},{"control":"HASC-REPO-1","level":1,"when":[]},{"control":"HASC-REPO-5","level":1,"when":[]},{"control":"HASC-REPO-3","level":1,"when":[]}],"title":"Add the files people look for","when":[]},{"steps":[{"control":"HASC-SEC-5","level":1,"when":[]},{"level":1,"title":"Work through the other alerts","when":[]},{"control":"HASC-DEP-3","level":1,"when":[]},{"control":"HASC-DEP-1","level":1,"when":["kind:integration"]},{"control":"HASC-DEP-2","level":1,"when":[]},{"control":"HASC-DEP-6","level":2,"when":[]}],"title":"Fix what the checks find","when":[]},{"steps":[{"control":"HASC-INT-1","level":1,"when":[]},{"control":"HASC-INT-2","level":1,"when":[]},{"control":"HASC-INT-3","level":1,"when":[]},{"control":"HASC-INT-4","level":1,"when":[]},{"control":"HASC-INT-5","level":1,"when":[]},{"control":"HASC-INT-6","level":1,"when":[]},{"control":"HASC-SEC-1","level":1,"when":[]},{"control":"HASC-SEC-2","level":1,"when":[]}],"title":"Review the integration's code","when":["kind:integration"]},{"steps":[{"control":"HASC-CARD-1","level":1,"when":[]},{"control":"HASC-CARD-2","level":1,"when":[]},{"control":"HASC-CARD-3","level":1,"when":[]},{"control":"HASC-CARD-4","level":2,"when":[]}],"title":"Review the card's code","when":["kind:card"]},{"steps":[{"control":"HASC-APP-1","level":1,"when":[]},{"control":"HASC-APP-2","level":1,"when":[]},{"control":"HASC-APP-3","level":2,"when":[]},{"control":"HASC-APP-4","level":2,"when":[]}],"title":"Review the app's config","when":["kind:app"]},{"steps":[{"control":"HASC-CI-7","level":1,"when":[]},{"control":"HASC-CI-8","level":1,"when":[]},{"control":"HASC-CI-9","level":1,"when":[]},{"control":"HASC-CI-10","level":2,"when":[]},{"control":"HASC-CI-11","level":2,"when":[]},{"control":"HASC-CI-4","level":1,"when":["kind:integration","kind:card"]},{"control":"HASC-CI-4","level":1,"when":["kind:app"]},{"control":"HASC-DEP-5","level":1,"when":[]},{"control":"HASC-CI-5","level":1,"when":["kind:integration","kind:card"]},{"control":"HASC-CI-5","level":1,"when":["kind:app"]},{"control":"HASC-CI-13","level":2,"when":[]},{"control":"HASC-CI-12","level":2,"when":[]}],"title":"Make your workflows safe","when":[]},{"steps":[{"control":"HASC-GATE-3","level":2,"when":[]},{"control":"HASC-BR-1","level":2,"when":[]},{"control":"HASC-GATE-2","level":2,"when":[]},{"control":"HASC-GATE-1","level":2,"when":[]},{"control":"HASC-BR-3","level":2,"when":[]},{"control":"HASC-GATE-4","level":2,"when":[]}],"title":"Make the checks block","when":[]},{"steps":[{"control":"HASC-REL-1","level":3,"when":[]},{"control":"HASC-REL-4","level":3,"when":["kind:card"]},{"control":"HASC-REL-2","level":3,"when":[]},{"control":"HASC-SEC-4","level":2,"when":[]},{"control":"HASC-BR-4","level":3,"when":[]},{"control":"HASC-REL-3","level":3,"when":[]}],"title":"Release from CI","when":[]},{"steps":[{"control":"HASC-POL-4","level":1,"when":[]},{"control":"HASC-REPO-4","level":2,"when":[]},{"control":"HASC-ACC-4","level":2,"when":[]},{"control":"HASC-ACC-5","level":2,"when":[]},{"control":"HASC-ACC-6","level":2,"when":[]}],"title":"Plan for the long run","when":[]}],"questions":[{"id":"kind","options":[{"label":"An integration","value":"integration"},{"label":"A dashboard card","value":"card"},{"label":"An app (add-on)","value":"app"}],"question":"What is it?"},{"id":"home","options":[{"label":"My own account","value":"personal"},{"label":"An organization with a security configuration","value":"org"}],"question":"Where does the repository live?"}],"title":"Secure an existing project","url":"https://ha-barkley.github.io/security/walk-throughs/existing-project/"},{"markdown":"https://ha-barkley.github.io/security/runbooks/index.md","phases":[{"steps":[{"level":1,"title":"Accept the report as a draft advisory","when":[]},{"control":"HASC-POL-4","level":1,"when":[]}],"title":"Look at the report","when":["what:report"]},{"steps":[{"control":"HASC-POL-1","level":1,"when":[]},{"control":"HASC-POL-2","level":1,"when":[]},{"control":"HASC-REPO-2","level":1,"when":[]}],"title":"Afterwards","when":["what:report"]},{"steps":[{"level":1,"title":"Change your password and check your email addresses","when":[]},{"control":"HASC-ACC-1","level":1,"when":[]},{"control":"HASC-ACC-3","level":1,"when":[]},{"control":"HASC-ACC-2","level":1,"when":[]}],"title":"Lock them out","when":["what:account"]},{"steps":[{"level":1,"title":"Read your security log","when":[]},{"level":1,"title":"Check every repository you can write to","when":[]},{"level":1,"title":"Replace the repositories' secrets","when":[]}],"title":"Find out what was done","when":["what:account"]},{"steps":[{"control":"HASC-ACC-4","level":2,"when":[]},{"control":"HASC-ACC-5","level":2,"when":[]},{"control":"HASC-SEC-4","level":2,"when":[]}],"title":"Afterwards","when":["what:account"]},{"steps":[{"control":"HASC-SEC-5","level":1,"when":[]},{"level":1,"title":"Check what it was used for","when":[]},{"level":1,"title":"Find out how it got out","when":[]}],"title":"Revoke it","when":["what:secret"]},{"steps":[{"control":"HASC-REPO-3","level":1,"when":[]},{"control":"HASC-CI-3","level":1,"when":[]},{"control":"HASC-ACC-2","level":1,"when":[]},{"control":"HASC-SEC-4","level":2,"when":[]}],"title":"Afterwards","when":["what:secret"]},{"steps":[{"level":1,"title":"Work out which versions are bad","when":[]},{"level":1,"title":"Delete the bad releases","when":[]},{"level":1,"title":"Release a fixed version with a higher number","when":[]},{"level":1,"title":"Tell your users","when":[]}],"title":"Take it down","when":["what:release"]},{"steps":[{"control":"HASC-REL-1","level":3,"when":[]},{"control":"HASC-BR-4","level":3,"when":[]},{"control":"HASC-REL-3","level":3,"when":[]},{"control":"HASC-SEC-4","level":2,"when":[]}],"title":"Afterwards","when":["what:release"]}],"questions":[{"id":"what","options":[{"label":"Someone reported a vulnerability","value":"report"},{"label":"Someone got into my GitHub account","value":"account"},{"label":"A token or key leaked","value":"secret"},{"label":"A bad release went out","value":"release"}],"question":"What happened?"}],"title":"Runbooks","url":"https://ha-barkley.github.io/security/runbooks/"}]}