# Apps (add-ons)

An app runs in its own container, but its config file decides how much of the host and of Home Assistant it can reach. Home Assistant shows users a security rating built from those settings.

Source: https://ha-barkley.github.io/security/controls/apps/

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.

These steps apply only if you publish an app (add-on).

## Controls

### APP-1: Ask only for the access the app uses

*Level 1 · Applies to apps*

Leave out `privileged`, `full_access`, `host_network`, `host_pid` and `docker_api` unless the app can't work without them, and say why in the README when it does.

`config.yaml`

```
name: Example
version: "1.0.0"
slug: example
arch: [aarch64, amd64]
ingress: true
ingress_port: 8099
homeassistant_api: true   # only if the app calls Home Assistant's API
# Leave these out unless the app can't work without them:
# privileged, full_access, host_network, host_pid, docker_api
```

### APP-2: Use ingress instead of open ports

*Level 1 · Applies to apps*

Ingress puts the app's web page behind Home Assistant's login. An open port is reachable by anything on the network.

### APP-3: Keep AppArmor on

*Level 2 · Applies to apps*

**Keep AppArmor on** and ship a profile that allows only what the app does.

### APP-4: Build on Home Assistant's base images

*Level 2 · Applies to apps*

**Build on Home Assistant's base images,** pin their versions, rebuild when they update, and don't run as root inside the container when you don't need to.

### Check it worked

Install the app and open its page in Settings → Apps. The security rating should be as high as the app's job allows.

Barkley scans integrations and cards. It doesn't scan apps yet; these controls follow Home Assistant's developer documentation.
