# Checklist

Pick the level you're aiming for and what you publish, and this page lists your steps in order.

Source: https://ha-barkley.github.io/security/checklist/

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.

## Level 1 · Basics

Lock your account and give people a private way to report problems. GitHub's free checks then watch every change.

### Lock your account

- [ ] [ACC-1](https://ha-barkley.github.io/security/controls/account/#acc-1): Turn on two-factor login with a passkey or a security key. *Level 1*
- [ ] [ACC-2](https://ha-barkley.github.io/security/controls/account/#acc-2): Replace classic personal access tokens with fine-grained ones. *Level 1*
- [ ] [ACC-3](https://ha-barkley.github.io/security/controls/account/#acc-3): Review what can act for you. *Level 1*

### Set up the organization

*Only for projects in a GitHub organization*

- [ ] [ORG-1](https://ha-barkley.github.io/security/controls/organizations/#org-1): Secure your own account first, then create the organization from it. *Level 1*
- [ ] [ORG-2](https://ha-barkley.github.io/security/controls/organizations/#org-2): Require two-factor login for everyone. *Level 1*
- [ ] [ORG-3](https://ha-barkley.github.io/security/controls/organizations/#org-3): Decide who the owners are. *Level 1*
- [ ] [ORG-4](https://ha-barkley.github.io/security/controls/organizations/#org-4): Limit what members can do. *Level 1*
- [ ] [ORG-5](https://ha-barkley.github.io/security/controls/organizations/#org-5): Create a security configuration for every repository, new ones included. *Level 1*
- [ ] [ORG-7](https://ha-barkley.github.io/security/controls/organizations/#org-7): If the organization holds several apps, add a public `.github` repository with default community files. *Level 1*
- [ ] [ORG-9](https://ha-barkley.github.io/security/controls/organizations/#org-9): If you move an existing repository in. *Level 1*

### Give people a private way to report problems

- [ ] [POL-1](https://ha-barkley.github.io/security/controls/security-policy/#pol-1): Turn on private vulnerability reporting. *Level 1*
- [ ] [POL-2](https://ha-barkley.github.io/security/controls/security-policy/#pol-2): Add a SECURITY.md. *Level 1 · Level marker*
- [ ] [REPO-2](https://ha-barkley.github.io/security/controls/repository/#repo-2): Turn off blank issues and link the private report. *Level 1*
- [ ] [POL-4](https://ha-barkley.github.io/security/controls/security-policy/#pol-4): When a report comes in. *Level 1*

### Turn on GitHub's checks

- [ ] [CI-1](https://ha-barkley.github.io/security/controls/ci/#ci-1): Turn on CodeQL default setup. *Level 1 (or a security workflow) · Level marker*
- [ ] [CI-4](https://ha-barkley.github.io/security/controls/ci/#ci-4): Add a security workflow. *Level 1 (or CodeQL) · Level marker*
- [ ] [CI-2](https://ha-barkley.github.io/security/controls/ci/#ci-2): Turn on Dependabot alerts and security updates. *Level 1 · Level marker*
- [ ] [CI-3](https://ha-barkley.github.io/security/controls/ci/#ci-3): Turn on secret scanning and push protection. *Level 1*
- [ ] [CI-5](https://ha-barkley.github.io/security/controls/ci/#ci-5): Validate against Home Assistant's own rules. *Level 1 · Applies to integrations and cards*
- [ ] [CI-6](https://ha-barkley.github.io/security/controls/ci/#ci-6): Optional: catch problems before you commit. *Level 1 · optional*

### Keep your workflows safe

- [ ] [CI-7](https://ha-barkley.github.io/security/controls/ci/#ci-7): Give workflows read-only tokens. *Level 1*
- [ ] [CI-8](https://ha-barkley.github.io/security/controls/ci/#ci-8): Keep untrusted text out of `run:` lines. *Level 1*
- [ ] [CI-9](https://ha-barkley.github.io/security/controls/ci/#ci-9): Never run a pull request's code in a `pull_request_target` workflow. *Level 1*

### Keep secrets out

- [ ] [REPO-3](https://ha-barkley.github.io/security/controls/repository/#repo-3): Add a .gitignore. *Level 1*
- [ ] [SEC-1](https://ha-barkley.github.io/security/controls/secrets/#sec-1): Ask users for credentials in the config flow. *Level 1 · Applies to integrations*
- [ ] [SEC-2](https://ha-barkley.github.io/security/controls/secrets/#sec-2): Redact diagnostics and keep secrets out of logs. *Level 1 · Applies to integrations*
- [ ] [SEC-5](https://ha-barkley.github.io/security/controls/secrets/#sec-5): If a secret leaks, revoke it first. *Level 1*

### Keep dependencies few and pinned

- [ ] [DEP-1](https://ha-barkley.github.io/security/controls/dependencies/#dep-1): Use what Home Assistant already ships first. *Level 1 · Applies to integrations*
- [ ] [DEP-2](https://ha-barkley.github.io/security/controls/dependencies/#dep-2): Check a package before you add it. *Level 1*
- [ ] [DEP-3](https://ha-barkley.github.io/security/controls/dependencies/#dep-3): Pin exact versions. *Level 1*
- [ ] [DEP-4](https://ha-barkley.github.io/security/controls/dependencies/#dep-4): Wait at least 7 days before taking a new release. *Level 1*
- [ ] [DEP-5](https://ha-barkley.github.io/security/controls/dependencies/#dep-5): Check for known vulnerabilities in CI. *Level 1*

### Build it safely

- [ ] [INT-1](https://ha-barkley.github.io/security/controls/integrations/#int-1): Never fetch code at run time. *Level 1 · Applies to integrations*
- [ ] [INT-2](https://ha-barkley.github.io/security/controls/integrations/#int-2): Keep the login on every page you add. *Level 1 · Applies to integrations*
- [ ] [INT-3](https://ha-barkley.github.io/security/controls/integrations/#int-3): Save settings and state with the storage helper, and never with pickle. *Level 1 · Applies to integrations*
- [ ] [INT-4](https://ha-barkley.github.io/security/controls/integrations/#int-4): Use Home Assistant's shared web session. *Level 1 · Applies to integrations*
- [ ] [INT-5](https://ha-barkley.github.io/security/controls/integrations/#int-5): Avoid the calls that turn data into code. *Level 1 · Applies to integrations*
- [ ] [INT-6](https://ha-barkley.github.io/security/controls/integrations/#int-6): Send each credential only to its own service. *Level 1 · Applies to integrations*
- [ ] [CARD-1](https://ha-barkley.github.io/security/controls/cards/#card-1): Bundle your libraries into the card. *Level 1 · Applies to cards*
- [ ] [CARD-2](https://ha-barkley.github.io/security/controls/cards/#card-2): Keep the login token where it is. *Level 1 · Applies to cards*
- [ ] [CARD-3](https://ha-barkley.github.io/security/controls/cards/#card-3): Render with Lit templates, not innerHTML. *Level 1 · Applies to cards*
- [ ] [APP-1](https://ha-barkley.github.io/security/controls/apps/#app-1): Ask only for the access the app uses. *Level 1 · Applies to apps*
- [ ] [APP-2](https://ha-barkley.github.io/security/controls/apps/#app-2): Use ingress instead of open ports. *Level 1 · Applies to apps*

### Tell users what to expect

- [ ] [REPO-1](https://ha-barkley.github.io/security/controls/repository/#repo-1): Add a bug report form. *Level 1*
- [ ] [REPO-5](https://ha-barkley.github.io/security/controls/repository/#repo-5): List the servers your app talks to. *Level 1*

## Level 2 · Checks that block

Make main the only way in, so every change passes your checks before it reaches anyone.

### Protect main

- [ ] [BR-1](https://ha-barkley.github.io/security/controls/branches-and-tags/#br-1): Add a branch ruleset for main. *Level 2 · Level marker*
- [ ] [BR-3](https://ha-barkley.github.io/security/controls/branches-and-tags/#br-3): Keep the bypass list short. *Level 2*

### Make the checks block

- [ ] [GATE-1](https://ha-barkley.github.io/security/controls/blocking-checks/#gate-1): For CodeQL, require code scanning results. *Level 2 (or a required check) · Level marker*
- [ ] [GATE-2](https://ha-barkley.github.io/security/controls/blocking-checks/#gate-2): Require your other checks by job name. *Level 2 (or code scanning) · Level marker*
- [ ] [GATE-3](https://ha-barkley.github.io/security/controls/blocking-checks/#gate-3): Make sure each check can fail. *Level 2 · Level marker*

### Lock down your workflows

- [ ] [CI-10](https://ha-barkley.github.io/security/controls/ci/#ci-10): Pin actions to a full commit SHA. *Level 2*
- [ ] [CI-11](https://ha-barkley.github.io/security/controls/ci/#ci-11): Don't leave the token behind after checkout. *Level 2*
- [ ] [CI-12](https://ha-barkley.github.io/security/controls/ci/#ci-12): Use a GitHub App token instead of a personal access token. *Level 2*
- [ ] [CI-13](https://ha-barkley.github.io/security/controls/ci/#ci-13): Check your workflows with zizmor. *Level 2*

### Send signed changes through pull requests

- [ ] [GATE-4](https://ha-barkley.github.io/security/controls/blocking-checks/#gate-4): Work through pull requests, even alone. *Level 2 · Level marker*
- [ ] [ACC-4](https://ha-barkley.github.io/security/controls/account/#acc-4): Sign your commits. *Level 2 · Level marker*
- [ ] [ACC-5](https://ha-barkley.github.io/security/controls/account/#acc-5): Then turn on vigilant mode. *Level 2*

### Harden your build and your app

- [ ] [SEC-4](https://ha-barkley.github.io/security/controls/secrets/#sec-4): In CI, prefer no secret at all. *Level 2*
- [ ] [DEP-6](https://ha-barkley.github.io/security/controls/dependencies/#dep-6): Replace dead packages. *Level 2*
- [ ] [CARD-4](https://ha-barkley.github.io/security/controls/cards/#card-4): Keep build tools current. *Level 2 · Applies to cards*
- [ ] [APP-3](https://ha-barkley.github.io/security/controls/apps/#app-3): Keep AppArmor on. *Level 2 · Applies to apps*
- [ ] [APP-4](https://ha-barkley.github.io/security/controls/apps/#app-4): Build on Home Assistant's base images. *Level 2 · Applies to apps*

### Plan for the long run

- [ ] [ACC-6](https://ha-barkley.github.io/security/controls/account/#acc-6): Give the project a second maintainer, or at least a plan. *Level 2*
- [ ] [REPO-4](https://ha-barkley.github.io/security/controls/repository/#repo-4): Close issues with the fix. *Level 2*

### Share settings across the organization

*Only for projects in a GitHub organization*

- [ ] [ORG-6](https://ha-barkley.github.io/security/controls/organizations/#org-6): Set an Actions policy. *Level 2*
- [ ] [ORG-8](https://ha-barkley.github.io/security/controls/organizations/#org-8): If the organization holds several apps, start new ones from a template repository. *Level 2*

## Level 3 · Releases people can check

Build releases in CI from main and lock them, so what people install matches the code anyone can read.

### Build releases in CI

- [ ] [REL-1](https://ha-barkley.github.io/security/controls/releases/#rel-1): Build and publish releases from a workflow. *Level 3 · Level marker*
- [ ] [REL-2](https://ha-barkley.github.io/security/controls/releases/#rel-2): Keep publishing secrets in a release environment. *Level 3*
- [ ] [REL-4](https://ha-barkley.github.io/security/controls/releases/#rel-4): Don't commit build output you also release. *Level 3*

### Lock published releases

- [ ] [BR-4](https://ha-barkley.github.io/security/controls/branches-and-tags/#br-4): Add a tag ruleset for your release tags. *Level 3 (or immutable releases) · Level marker*
- [ ] [REL-3](https://ha-barkley.github.io/security/controls/releases/#rel-3): Turn on immutable releases. *Level 3 (or a tag ruleset) · Level marker*
