BarkleyGitHub
HASC · draft
Markdown file

Home Assistant Security Controls

Security controls for Home Assistant integrations, cards and apps, each with an ID you can cite, such as HASC-CI-4.

A community catalog, not an official Home Assistant or Open Home Foundation project.

Each control belongs to a family and a level. "Anyone can check" means the control can be confirmed from outside the project, and those controls are what a level is graded on. Controls that apply only to one kind of project say so. The rest apply to all of them.

ACC Your GitHub account

IDControlLevelApplies toAnyone can check
ACC-1Turn on two-factor login with a passkey or a security key1AllNo
ACC-2Replace classic personal access tokens with fine-grained ones1AllNo
ACC-3Review what can act for you1AllNo
ACC-4Sign your commits2AllYes
ACC-5Then turn on vigilant mode2AllNo
ACC-6Give the project a second maintainer, or at least a plan2AllNo

BR Branch and tag protection

IDControlLevelApplies toAnyone can check
BR-1Add a branch ruleset for main2AllYes
BR-2Require your checks to pass. Withdrawn, covered by GATE-1 and GATE-2Withdrawn
BR-3Keep the bypass list short2AllNo
BR-4Add a tag ruleset for your release tags3 (or immutable releases)AllYes

CI Checks in CI

IDControlLevelApplies toAnyone can check
CI-1Turn on CodeQL default setup1 (or a security workflow)AllYes
CI-2Turn on Dependabot alerts and security updates1AllYes
CI-3Turn on secret scanning and push protection1AllNo
CI-4Add a security workflow1 (or CodeQL)AllYes
CI-5Validate against Home Assistant's own rules1Integrations, CardsNo
CI-6Optional: catch problems before you commit1 · optionalAllNo
CI-7Give workflows read-only tokens1AllNo
CI-8Keep untrusted text out of run: lines1AllNo
CI-9Never run a pull request's code in a pull_request_target workflow1AllNo
CI-10Pin actions to a full commit SHA2AllNo
CI-11Don't leave the token behind after checkout2AllNo
CI-12Use a GitHub App token instead of a personal access token2AllNo
CI-13Check your workflows with zizmor2AllNo

GATE Checks that block

IDControlLevelApplies toAnyone can check
GATE-1For CodeQL, require code scanning results2 (or a required check)AllYes
GATE-2Require your other checks by job name2 (or code scanning)AllYes
GATE-3Make sure each check can fail2AllYes
GATE-4Work through pull requests, even alone2AllYes

POL Security policy

IDControlLevelApplies toAnyone can check
POL-1Turn on private vulnerability reporting1AllNo
POL-2Add a SECURITY.md1AllYes
POL-3Point the issue form there too. Withdrawn, covered by REPO-2Withdrawn
POL-4When a report comes in1AllNo

SEC Secrets

IDControlLevelApplies toAnyone can check
SEC-1Ask users for credentials in the config flow1IntegrationsNo
SEC-2Redact diagnostics and keep secrets out of logs1IntegrationsNo
SEC-3Ignore local secret files. Withdrawn, covered by REPO-3 and CI-3Withdrawn
SEC-4In CI, prefer no secret at all2AllNo
SEC-5If a secret leaks, revoke it first1AllNo

REPO Repository basics

IDControlLevelApplies toAnyone can check
REPO-1Add a bug report form1AllNo
REPO-2Turn off blank issues and link the private report1AllNo
REPO-3Add a .gitignore1AllNo
REPO-4Close issues with the fix2AllNo
REPO-5List the servers your app talks to1AllNo

REL Releases

IDControlLevelApplies toAnyone can check
REL-1Build and publish releases from a workflow3AllYes
REL-2Keep publishing secrets in a release environment3AllNo
REL-3Turn on immutable releases3 (or a tag ruleset)AllYes
REL-4Don't commit build output you also release3AllNo

ORG Organizations

IDControlLevelApplies toAnyone can check
ORG-1Secure your own account first, then create the organization from it1AllNo
ORG-2Require two-factor login for everyone1AllNo
ORG-3Decide who the owners are1AllNo
ORG-4Limit what members can do1AllNo
ORG-5Create a security configuration for every repository, new ones included1AllNo
ORG-6Set an Actions policy2AllNo
ORG-7If the organization holds several apps, add a public .github repository with default community files1AllNo
ORG-8If the organization holds several apps, start new ones from a template repository2AllNo
ORG-9If you move an existing repository in1AllNo

INT Integrations

IDControlLevelApplies toAnyone can check
INT-1Never fetch code at run time1IntegrationsNo
INT-2Keep the login on every page you add1IntegrationsNo
INT-3Save settings and state with the storage helper, and never with pickle1IntegrationsNo
INT-4Use Home Assistant's shared web session1IntegrationsNo
INT-5Avoid the calls that turn data into code1IntegrationsNo
INT-6Send each credential only to its own service1IntegrationsNo

CARD Dashboard cards

IDControlLevelApplies toAnyone can check
CARD-1Bundle your libraries into the card1CardsNo
CARD-2Keep the login token where it is1CardsNo
CARD-3Render with Lit templates, not innerHTML1CardsNo
CARD-4Keep build tools current2CardsNo

DEP Dependencies

IDControlLevelApplies toAnyone can check
DEP-1Use what Home Assistant already ships first1IntegrationsNo
DEP-2Check a package before you add it1AllNo
DEP-3Pin exact versions1AllNo
DEP-4Wait at least 7 days before taking a new release1AllNo
DEP-5Check for known vulnerabilities in CI1AllNo
DEP-6Replace dead packages2AllNo

APP Apps (add-ons)

IDControlLevelApplies toAnyone can check
APP-1Ask only for the access the app uses1AppsNo
APP-2Use ingress instead of open ports1AppsNo
APP-3Keep AppArmor on2AppsNo
APP-4Build on Home Assistant's base images2AppsNo

71 controls in 13 families, plus 3 withdrawn.