doorcheck 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. doorcheck-0.1.0a1/LICENSE +201 -0
  2. doorcheck-0.1.0a1/PKG-INFO +157 -0
  3. doorcheck-0.1.0a1/README.md +140 -0
  4. doorcheck-0.1.0a1/pyproject.toml +193 -0
  5. doorcheck-0.1.0a1/pyproject.toml.orig +175 -0
  6. doorcheck-0.1.0a1/src/doorcheck/__init__.py +1 -0
  7. doorcheck-0.1.0a1/src/doorcheck/__main__.py +6 -0
  8. doorcheck-0.1.0a1/src/doorcheck/adapters/__init__.py +26 -0
  9. doorcheck-0.1.0a1/src/doorcheck/adapters/base.py +183 -0
  10. doorcheck-0.1.0a1/src/doorcheck/adapters/guarddog.py +173 -0
  11. doorcheck-0.1.0a1/src/doorcheck/adapters/osv.py +86 -0
  12. doorcheck-0.1.0a1/src/doorcheck/adapters/process.py +69 -0
  13. doorcheck-0.1.0a1/src/doorcheck/adapters/registry.py +62 -0
  14. doorcheck-0.1.0a1/src/doorcheck/adapters/semgrep.py +145 -0
  15. doorcheck-0.1.0a1/src/doorcheck/adapters/zizmor.py +84 -0
  16. doorcheck-0.1.0a1/src/doorcheck/capabilities/__init__.py +6 -0
  17. doorcheck-0.1.0a1/src/doorcheck/capabilities/call_arguments.py +40 -0
  18. doorcheck-0.1.0a1/src/doorcheck/capabilities/call_bindings.py +138 -0
  19. doorcheck-0.1.0a1/src/doorcheck/capabilities/calls.py +71 -0
  20. doorcheck-0.1.0a1/src/doorcheck/capabilities/frontend.py +23 -0
  21. doorcheck-0.1.0a1/src/doorcheck/capabilities/http_values.py +78 -0
  22. doorcheck-0.1.0a1/src/doorcheck/capabilities/model.py +82 -0
  23. doorcheck-0.1.0a1/src/doorcheck/capabilities/panels.py +39 -0
  24. doorcheck-0.1.0a1/src/doorcheck/capabilities/python_code.py +704 -0
  25. doorcheck-0.1.0a1/src/doorcheck/capabilities/python_scopes.py +47 -0
  26. doorcheck-0.1.0a1/src/doorcheck/capabilities/scan.py +198 -0
  27. doorcheck-0.1.0a1/src/doorcheck/capabilities/source_text.py +44 -0
  28. doorcheck-0.1.0a1/src/doorcheck/capabilities/static_paths.py +29 -0
  29. doorcheck-0.1.0a1/src/doorcheck/capabilities/webhooks.py +34 -0
  30. doorcheck-0.1.0a1/src/doorcheck/checks.py +57 -0
  31. doorcheck-0.1.0a1/src/doorcheck/cli.py +144 -0
  32. doorcheck-0.1.0a1/src/doorcheck/cli_compare.py +77 -0
  33. doorcheck-0.1.0a1/src/doorcheck/cli_hosts.py +86 -0
  34. doorcheck-0.1.0a1/src/doorcheck/cli_output.py +80 -0
  35. doorcheck-0.1.0a1/src/doorcheck/cli_report.py +55 -0
  36. doorcheck-0.1.0a1/src/doorcheck/cli_scan.py +84 -0
  37. doorcheck-0.1.0a1/src/doorcheck/comparison.py +160 -0
  38. doorcheck-0.1.0a1/src/doorcheck/dependencies.py +131 -0
  39. doorcheck-0.1.0a1/src/doorcheck/errors.py +15 -0
  40. doorcheck-0.1.0a1/src/doorcheck/fetch/__init__.py +12 -0
  41. doorcheck-0.1.0a1/src/doorcheck/fetch/archive.py +182 -0
  42. doorcheck-0.1.0a1/src/doorcheck/fetch/errors.py +13 -0
  43. doorcheck-0.1.0a1/src/doorcheck/fetch/installed.py +137 -0
  44. doorcheck-0.1.0a1/src/doorcheck/fetch/marketplace.py +51 -0
  45. doorcheck-0.1.0a1/src/doorcheck/fetch/transport.py +32 -0
  46. doorcheck-0.1.0a1/src/doorcheck/findings.py +140 -0
  47. doorcheck-0.1.0a1/src/doorcheck/hosts.py +71 -0
  48. doorcheck-0.1.0a1/src/doorcheck/https.py +89 -0
  49. doorcheck-0.1.0a1/src/doorcheck/messages/__init__.py +126 -0
  50. doorcheck-0.1.0a1/src/doorcheck/messages/en.json +248 -0
  51. doorcheck-0.1.0a1/src/doorcheck/messages/glossaries.py +46 -0
  52. doorcheck-0.1.0a1/src/doorcheck/messages/locales.json +326 -0
  53. doorcheck-0.1.0a1/src/doorcheck/messages/localization.py +177 -0
  54. doorcheck-0.1.0a1/src/doorcheck/messages/shipped-locales.json +1 -0
  55. doorcheck-0.1.0a1/src/doorcheck/messages/source-hashes.json +248 -0
  56. doorcheck-0.1.0a1/src/doorcheck/messages/translation-context.json +19 -0
  57. doorcheck-0.1.0a1/src/doorcheck/presentation/__init__.py +1 -0
  58. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/dark_icon.png +0 -0
  59. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/dark_icon@2x.png +0 -0
  60. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/dark_logo.png +0 -0
  61. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/dark_logo@2x.png +0 -0
  62. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/icon.png +0 -0
  63. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/icon@2x.png +0 -0
  64. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/logo.png +0 -0
  65. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/logo.svg +1 -0
  66. doorcheck-0.1.0a1/src/doorcheck/presentation/brand/logo@2x.png +0 -0
  67. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/info.svg +1 -0
  68. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/mark.svg +1 -0
  69. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/none.svg +1 -0
  70. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/notice.svg +1 -0
  71. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/review.svg +1 -0
  72. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/serious.svg +1 -0
  73. doorcheck-0.1.0a1/src/doorcheck/presentation/icons/unavailable.svg +1 -0
  74. doorcheck-0.1.0a1/src/doorcheck/presentation/tokens.css +60 -0
  75. doorcheck-0.1.0a1/src/doorcheck/presentation/tokens.json +87 -0
  76. doorcheck-0.1.0a1/src/doorcheck/py.typed +0 -0
  77. doorcheck-0.1.0a1/src/doorcheck/pypi.py +70 -0
  78. doorcheck-0.1.0a1/src/doorcheck/report.py +206 -0
  79. doorcheck-0.1.0a1/src/doorcheck/requirements.py +105 -0
  80. doorcheck-0.1.0a1/src/doorcheck/revocation.py +240 -0
  81. doorcheck-0.1.0a1/src/doorcheck/rules/__init__.py +6 -0
  82. doorcheck-0.1.0a1/src/doorcheck/rules/file_view.py +367 -0
  83. doorcheck-0.1.0a1/src/doorcheck/rules/helpers.py +253 -0
  84. doorcheck-0.1.0a1/src/doorcheck/rules/path_flow.py +96 -0
  85. doorcheck-0.1.0a1/src/doorcheck/rules/project.py +216 -0
  86. doorcheck-0.1.0a1/src/doorcheck/rules/scan.py +109 -0
  87. doorcheck-0.1.0a1/src/doorcheck/rules/source.py +49 -0
  88. doorcheck-0.1.0a1/src/doorcheck/sarif.py +116 -0
  89. doorcheck-0.1.0a1/src/doorcheck/schemas/comparison-v1.schema.json +59 -0
  90. doorcheck-0.1.0a1/src/doorcheck/schemas/host-summary-v1.schema.json +152 -0
  91. doorcheck-0.1.0a1/src/doorcheck/schemas/report-v1.schema.json +302 -0
  92. doorcheck-0.1.0a1/src/doorcheck/text.py +34 -0
  93. doorcheck-0.1.0a1/src/doorcheck/tree.py +68 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: doorcheck
3
+ Version: 0.1.0a1
4
+ Summary: See what a Home Assistant integration can do before you let it in.
5
+ Author: nimbleengineer21
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: Programming Language :: Python :: 3.14
11
+ Classifier: Topic :: Security
12
+ Requires-Dist: packaging>=23.1
13
+ Requires-Python: >=3.13.2
14
+ Project-URL: Source, https://github.com/nimbleengineer21/doorcheck
15
+ Project-URL: Security, https://github.com/nimbleengineer21/doorcheck/security/policy
16
+ Description-Content-Type: text/markdown
17
+
18
+ # Doorcheck
19
+
20
+ See what a Home Assistant integration can do before you let it in.
21
+
22
+ > **v0.1 core milestone.** The Python core is available for development.
23
+ > Local-folder and explicit commit/tag GitHub integration scans are available in the current source.
24
+ > The Home Assistant integration and dashboard-card scanning are still being built.
25
+ > The [HA development preview](docs/home-assistant-development.md) provides read-only
26
+ > inventory, explicit static scans with [saved results](docs/ha-baselines.md) and
27
+ > framework tests; it does not raise alerts.
28
+
29
+ Doorcheck will scan Home Assistant custom integrations and dashboard cards, report
30
+ what each one can do (the programs it runs, the hosts it contacts, the files it
31
+ touches) and what changed between versions, and check your own setup for common
32
+ exposures. It reports observations with evidence. It never declares anything safe:
33
+ a scan that finds nothing means these checks found nothing, not that the code is
34
+ safe, and anything a check couldn't cover is listed rather than skipped.
35
+
36
+ Doorcheck is not affiliated with Home Assistant or the Open Home Foundation.
37
+
38
+ ## What this milestone includes
39
+
40
+ - Neutral Python capability observations, manifest requirements and scan coverage gaps.
41
+ - [Webhook registration observations](docs/webhooks.md) with explicit local-only argument facts.
42
+ - Versioned JSON reports and SARIF export.
43
+ - An offline [host-evidence summary command and API](docs/host-summary.md), retaining source evidence and coverage.
44
+ - An offline [report comparison command and API](docs/comparison.md) for added/removed observations.
45
+ - A [scan command for local folders and GitHub integrations at explicit commits or tags](docs/cli.md) with explicit coverage and exit codes.
46
+ - GitHub source/release fetching, archive validation and artifact fingerprints.
47
+ - Adapters for pinned external scanners; see [Scanning tools](docs/adapters.md).
48
+ - A pinned benchmark corpus and regression harness.
49
+ - Paired [inert adversarial models and benign examples](docs/adversarial-fixtures.md).
50
+ - Shared [presentation tokens, state icons and brand assets](docs/presentation.md).
51
+
52
+ This is an early library interface. A capability is an observation of source,
53
+ not proof of runtime behavior. Dependency snapshots cover direct packages, not
54
+ Home Assistant's full constrained installation. External tools have bounded
55
+ execution and output; they are not sandboxed from the filesystem or network.
56
+
57
+ ## Scan an integration
58
+
59
+ From a checkout with Python 3.13.2 or newer and uv 0.13.4 or newer:
60
+
61
+ ```sh
62
+ uv sync --locked
63
+ uv run doorcheck scan /path/to/integration
64
+ uv run doorcheck scan /path/to/integration --json
65
+ uv run doorcheck scan --repo OWNER/REPO --commit FULL_SHA
66
+ uv run doorcheck scan --repo OWNER/REPO --tag TAG
67
+ ```
68
+
69
+ The command runs the source capability reader and one Python file-read rule.
70
+ Add `--semgrep-rule /path/to/trusted-rules.yaml` to also run an already-installed,
71
+ pinned Semgrep with explicit local rules. Dependency advisory checks are not run. See the
72
+ [CLI guide](docs/cli.md) for coverage, SARIF and exit codes.
73
+
74
+ ## Try the Python core
75
+
76
+ Use Python 3.13.2 or newer on Linux or macOS. From a checkout:
77
+
78
+ ```sh
79
+ uv sync --locked
80
+ uv run python
81
+ ```
82
+
83
+ ```python
84
+ from pathlib import Path
85
+ from doorcheck.capabilities import scan
86
+ from doorcheck.messages import render, render_capability
87
+ from doorcheck.text import display_safe
88
+
89
+ result = scan(Path("/path/to/integration"))
90
+ for capability in result.capabilities:
91
+ print(
92
+ render_capability(capability),
93
+ display_safe(capability.location.path),
94
+ capability.location.line,
95
+ )
96
+ for problem in result.problems:
97
+ print(render(problem.key, problem.params))
98
+ ```
99
+
100
+ The capability reader does not import or execute the scanned Python. Problem
101
+ keys expose coverage gaps; the [shared English catalog](docs/messages.md)
102
+ provides explanations for capabilities, findings and scan problems. External
103
+ scanners are separate executables, not installed by this example.
104
+
105
+ ## Install
106
+
107
+ Version 0.1.0a1 is the first pre-release. [Install the pre-release](docs/install.md)
108
+ describes the HACS steps and the PyPI package. The integration checks daily for
109
+ [withdrawn versions](docs/ha-status.md) and shows them in Repairs; you can turn this off.
110
+
111
+ ## Supported versions
112
+
113
+ The Home Assistant integration supports Home Assistant 2025.11 and newer, which
114
+ means Python 3.13.2 or newer. It installs the scanning engine from PyPI, pinned to
115
+ an exact version.
116
+
117
+ ## Development
118
+
119
+ ```sh
120
+ # Use uv 0.13.4 or newer.
121
+ uv sync --locked
122
+ uv run pytest # tests, with coverage
123
+ uv run ruff check . # lint; `uv run ruff format .` to format
124
+ uv run mypy # types
125
+ uv run lint-imports # layer contracts
126
+ uv run mutmut run # mutation tests; `uv run mutmut browse` to see survivors
127
+ ```
128
+
129
+ [CONTRIBUTING.md](CONTRIBUTING.md) has the rest, including what a pull request
130
+ needs. [Localization](docs/localization.md) describes locale coverage, offline
131
+ freshness checks, and the bounded DeepL refresh workflow.
132
+
133
+ ## Maintenance
134
+
135
+ Doorcheck has one maintainer. If it goes quiet for more than 60 days with no
136
+ word, treat it as unmaintained: don't rely on its results for new releases of
137
+ anything, and expect no security fixes. Results it publishes will carry an
138
+ expiry date, so they go stale on their own rather than looking current.
139
+
140
+ ## Security
141
+
142
+ Please report vulnerabilities in Doorcheck privately; see [SECURITY.md](SECURITY.md).
143
+ How Doorcheck handles problems it finds in other people's projects is in
144
+ [DISCLOSURE.md](DISCLOSURE.md).
145
+
146
+ ## License
147
+
148
+ [Apache-2.0](LICENSE)
149
+
150
+ The initial [Home Assistant path rule](docs/rules.md) traces catch-all route values
151
+ to file reads in explicitly unauthenticated views. It has a deliberately limited
152
+ flow model; see its measured catches and blind spots before using its results.
153
+
154
+ [HTTP request observations](docs/http-observations.md) distinguish recognized
155
+ Python HTTP calls from host-name mentions. They record an initial static URL
156
+ authority when one is known and leave runtime destinations unresolved. They
157
+ carry no severity and do not establish that network traffic occurred.
@@ -0,0 +1,140 @@
1
+ # Doorcheck
2
+
3
+ See what a Home Assistant integration can do before you let it in.
4
+
5
+ > **v0.1 core milestone.** The Python core is available for development.
6
+ > Local-folder and explicit commit/tag GitHub integration scans are available in the current source.
7
+ > The Home Assistant integration and dashboard-card scanning are still being built.
8
+ > The [HA development preview](docs/home-assistant-development.md) provides read-only
9
+ > inventory, explicit static scans with [saved results](docs/ha-baselines.md) and
10
+ > framework tests; it does not raise alerts.
11
+
12
+ Doorcheck will scan Home Assistant custom integrations and dashboard cards, report
13
+ what each one can do (the programs it runs, the hosts it contacts, the files it
14
+ touches) and what changed between versions, and check your own setup for common
15
+ exposures. It reports observations with evidence. It never declares anything safe:
16
+ a scan that finds nothing means these checks found nothing, not that the code is
17
+ safe, and anything a check couldn't cover is listed rather than skipped.
18
+
19
+ Doorcheck is not affiliated with Home Assistant or the Open Home Foundation.
20
+
21
+ ## What this milestone includes
22
+
23
+ - Neutral Python capability observations, manifest requirements and scan coverage gaps.
24
+ - [Webhook registration observations](docs/webhooks.md) with explicit local-only argument facts.
25
+ - Versioned JSON reports and SARIF export.
26
+ - An offline [host-evidence summary command and API](docs/host-summary.md), retaining source evidence and coverage.
27
+ - An offline [report comparison command and API](docs/comparison.md) for added/removed observations.
28
+ - A [scan command for local folders and GitHub integrations at explicit commits or tags](docs/cli.md) with explicit coverage and exit codes.
29
+ - GitHub source/release fetching, archive validation and artifact fingerprints.
30
+ - Adapters for pinned external scanners; see [Scanning tools](docs/adapters.md).
31
+ - A pinned benchmark corpus and regression harness.
32
+ - Paired [inert adversarial models and benign examples](docs/adversarial-fixtures.md).
33
+ - Shared [presentation tokens, state icons and brand assets](docs/presentation.md).
34
+
35
+ This is an early library interface. A capability is an observation of source,
36
+ not proof of runtime behavior. Dependency snapshots cover direct packages, not
37
+ Home Assistant's full constrained installation. External tools have bounded
38
+ execution and output; they are not sandboxed from the filesystem or network.
39
+
40
+ ## Scan an integration
41
+
42
+ From a checkout with Python 3.13.2 or newer and uv 0.13.4 or newer:
43
+
44
+ ```sh
45
+ uv sync --locked
46
+ uv run doorcheck scan /path/to/integration
47
+ uv run doorcheck scan /path/to/integration --json
48
+ uv run doorcheck scan --repo OWNER/REPO --commit FULL_SHA
49
+ uv run doorcheck scan --repo OWNER/REPO --tag TAG
50
+ ```
51
+
52
+ The command runs the source capability reader and one Python file-read rule.
53
+ Add `--semgrep-rule /path/to/trusted-rules.yaml` to also run an already-installed,
54
+ pinned Semgrep with explicit local rules. Dependency advisory checks are not run. See the
55
+ [CLI guide](docs/cli.md) for coverage, SARIF and exit codes.
56
+
57
+ ## Try the Python core
58
+
59
+ Use Python 3.13.2 or newer on Linux or macOS. From a checkout:
60
+
61
+ ```sh
62
+ uv sync --locked
63
+ uv run python
64
+ ```
65
+
66
+ ```python
67
+ from pathlib import Path
68
+ from doorcheck.capabilities import scan
69
+ from doorcheck.messages import render, render_capability
70
+ from doorcheck.text import display_safe
71
+
72
+ result = scan(Path("/path/to/integration"))
73
+ for capability in result.capabilities:
74
+ print(
75
+ render_capability(capability),
76
+ display_safe(capability.location.path),
77
+ capability.location.line,
78
+ )
79
+ for problem in result.problems:
80
+ print(render(problem.key, problem.params))
81
+ ```
82
+
83
+ The capability reader does not import or execute the scanned Python. Problem
84
+ keys expose coverage gaps; the [shared English catalog](docs/messages.md)
85
+ provides explanations for capabilities, findings and scan problems. External
86
+ scanners are separate executables, not installed by this example.
87
+
88
+ ## Install
89
+
90
+ Version 0.1.0a1 is the first pre-release. [Install the pre-release](docs/install.md)
91
+ describes the HACS steps and the PyPI package. The integration checks daily for
92
+ [withdrawn versions](docs/ha-status.md) and shows them in Repairs; you can turn this off.
93
+
94
+ ## Supported versions
95
+
96
+ The Home Assistant integration supports Home Assistant 2025.11 and newer, which
97
+ means Python 3.13.2 or newer. It installs the scanning engine from PyPI, pinned to
98
+ an exact version.
99
+
100
+ ## Development
101
+
102
+ ```sh
103
+ # Use uv 0.13.4 or newer.
104
+ uv sync --locked
105
+ uv run pytest # tests, with coverage
106
+ uv run ruff check . # lint; `uv run ruff format .` to format
107
+ uv run mypy # types
108
+ uv run lint-imports # layer contracts
109
+ uv run mutmut run # mutation tests; `uv run mutmut browse` to see survivors
110
+ ```
111
+
112
+ [CONTRIBUTING.md](CONTRIBUTING.md) has the rest, including what a pull request
113
+ needs. [Localization](docs/localization.md) describes locale coverage, offline
114
+ freshness checks, and the bounded DeepL refresh workflow.
115
+
116
+ ## Maintenance
117
+
118
+ Doorcheck has one maintainer. If it goes quiet for more than 60 days with no
119
+ word, treat it as unmaintained: don't rely on its results for new releases of
120
+ anything, and expect no security fixes. Results it publishes will carry an
121
+ expiry date, so they go stale on their own rather than looking current.
122
+
123
+ ## Security
124
+
125
+ Please report vulnerabilities in Doorcheck privately; see [SECURITY.md](SECURITY.md).
126
+ How Doorcheck handles problems it finds in other people's projects is in
127
+ [DISCLOSURE.md](DISCLOSURE.md).
128
+
129
+ ## License
130
+
131
+ [Apache-2.0](LICENSE)
132
+
133
+ The initial [Home Assistant path rule](docs/rules.md) traces catch-all route values
134
+ to file reads in explicitly unauthenticated views. It has a deliberately limited
135
+ flow model; see its measured catches and blind spots before using its results.
136
+
137
+ [HTTP request observations](docs/http-observations.md) distinguish recognized
138
+ Python HTTP calls from host-name mentions. They record an initial static URL
139
+ authority when one is known and leave runtime destinations unresolved. They
140
+ carry no severity and do not establish that network traffic occurred.
@@ -0,0 +1,193 @@
1
+ [project]
2
+ name = "doorcheck"
3
+ version = "0.1.0a1"
4
+ description = "See what a Home Assistant integration can do before you let it in."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ license-files = ["LICENSE"]
8
+ requires-python = ">=3.13.2"
9
+ dependencies = ["packaging>=23.1"]
10
+ classifiers = [
11
+ "Development Status :: 3 - Alpha",
12
+ "Programming Language :: Python :: 3.13",
13
+ "Programming Language :: Python :: 3.14",
14
+ "Topic :: Security",
15
+ ]
16
+
17
+ [[project.authors]]
18
+ name = "nimbleengineer21"
19
+
20
+ [project.scripts]
21
+ doorcheck = "doorcheck.cli:entrypoint"
22
+
23
+ [project.entry-points."doorcheck.adapters"]
24
+ guarddog = "doorcheck.adapters.guarddog:GuardDog"
25
+ guarddog-dependencies = "doorcheck.adapters.guarddog:GuardDogDependencies"
26
+ osv-scanner = "doorcheck.adapters.osv:OsvScanner"
27
+ semgrep = "doorcheck.adapters.semgrep:Semgrep"
28
+ zizmor = "doorcheck.adapters.zizmor:Zizmor"
29
+
30
+ [project.urls]
31
+ Source = "https://github.com/nimbleengineer21/doorcheck"
32
+ Security = "https://github.com/nimbleengineer21/doorcheck/security/policy"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "commitizen==4.19.3",
37
+ "complexipy==8.3.0",
38
+ "cryptography==50.0.1",
39
+ "import-linter==2.15",
40
+ "jsonschema==4.26.0",
41
+ "mutmut==3.8.1",
42
+ "mypy==2.4.0",
43
+ "pip-audit==2.10.1",
44
+ "playwright==1.64.1",
45
+ "pytest==9.2.0",
46
+ "pytest-cov==7.1.0",
47
+ "resvg-py==0.5.0",
48
+ "ruff==0.17.3",
49
+ ]
50
+
51
+ [build-system]
52
+ requires = ["uv_build==0.13.6"]
53
+ build-backend = "uv_build"
54
+
55
+ [tool.uv]
56
+ exclude-newer = "3 days"
57
+
58
+ [tool.uv.build-backend]
59
+ source-exclude = [
60
+ "tests",
61
+ "tools",
62
+ ".github",
63
+ "ha",
64
+ "custom_components",
65
+ ]
66
+
67
+ [tool.ruff]
68
+ target-version = "py313"
69
+ line-length = 100
70
+ extend-exclude = ["tests/fixtures"]
71
+
72
+ [tool.ruff.lint]
73
+ select = [
74
+ "E",
75
+ "W",
76
+ "F",
77
+ "I",
78
+ "B",
79
+ "UP",
80
+ "S",
81
+ "SIM",
82
+ "RUF",
83
+ "ERA",
84
+ "PTH",
85
+ ]
86
+
87
+ [tool.ruff.lint.per-file-ignores]
88
+ "tests/**" = ["S101"]
89
+
90
+ [tool.mypy]
91
+ strict = true
92
+ files = [
93
+ "src",
94
+ "tools",
95
+ ]
96
+
97
+ [tool.pytest.ini_options]
98
+ testpaths = ["tests"]
99
+ pythonpath = ["."]
100
+ addopts = "--strict-markers --cov --cov-branch --cov-report=term-missing"
101
+
102
+ [tool.coverage.run]
103
+ source = [
104
+ "src/doorcheck",
105
+ "tools",
106
+ ]
107
+
108
+ [tool.coverage.report]
109
+ fail_under = 90
110
+ exclude_also = ["if __name__ == .__main__.:"]
111
+
112
+ [tool.importlinter]
113
+ root_packages = ["doorcheck"]
114
+ include_external_packages = true
115
+
116
+ [[tool.importlinter.contracts]]
117
+ name = "The engine never depends on Home Assistant"
118
+ type = "forbidden"
119
+ source_modules = ["doorcheck"]
120
+ forbidden_modules = ["homeassistant"]
121
+
122
+ [[tool.importlinter.contracts]]
123
+ name = "Each layer builds only on the layers below it"
124
+ type = "layers"
125
+ layers = [
126
+ "doorcheck.cli",
127
+ "doorcheck.cli_compare | doorcheck.cli_hosts | doorcheck.cli_scan",
128
+ "doorcheck.cli_output | doorcheck.comparison | doorcheck.hosts | doorcheck.cli_report",
129
+ "doorcheck.messages | doorcheck.sarif | doorcheck.fetch",
130
+ "doorcheck.report",
131
+ "doorcheck.rules",
132
+ "doorcheck.capabilities | doorcheck.adapters",
133
+ "doorcheck.dependencies",
134
+ "doorcheck.pypi",
135
+ "doorcheck.checks | doorcheck.requirements | doorcheck.https",
136
+ "doorcheck.findings | doorcheck.errors | doorcheck.tree | doorcheck.text | doorcheck.presentation | doorcheck.revocation",
137
+ ]
138
+
139
+ [[tool.importlinter.contracts]]
140
+ name = "Only the adapters run other programs"
141
+ type = "forbidden"
142
+ source_modules = [
143
+ "doorcheck.capabilities",
144
+ "doorcheck.cli_compare",
145
+ "doorcheck.cli_hosts",
146
+ "doorcheck.cli_report",
147
+ "doorcheck.hosts",
148
+ "doorcheck.comparison",
149
+ "doorcheck.checks",
150
+ "doorcheck.dependencies",
151
+ "doorcheck.errors",
152
+ "doorcheck.fetch",
153
+ "doorcheck.findings",
154
+ "doorcheck.https",
155
+ "doorcheck.messages",
156
+ "doorcheck.presentation",
157
+ "doorcheck.pypi",
158
+ "doorcheck.report",
159
+ "doorcheck.rules",
160
+ "doorcheck.requirements",
161
+ "doorcheck.revocation",
162
+ "doorcheck.sarif",
163
+ "doorcheck.text",
164
+ "doorcheck.tree",
165
+ ]
166
+ forbidden_modules = [
167
+ "subprocess",
168
+ "doorcheck.adapters",
169
+ ]
170
+
171
+ [tool.commitizen]
172
+ name = "cz_conventional_commits"
173
+ tag_format = "v$version"
174
+ version_provider = "pep621"
175
+
176
+ [tool.mutmut]
177
+ source_paths = [
178
+ "src/doorcheck/",
179
+ "tools/",
180
+ ]
181
+ pytest_add_cli_args_test_selection = ["tests/"]
182
+ also_copy = [
183
+ "benchmark/",
184
+ "tools/templates/",
185
+ "tools/visual-check.js",
186
+ "docs/",
187
+ ".github/workflows/",
188
+ "custom_components/doorcheck/",
189
+ "hacs.json",
190
+ "ha/acceptance/",
191
+ "ha/pyproject.toml",
192
+ ]
193
+ pytest_add_cli_args = ["--no-cov"]