[SEC] 建立三项目独立机器身份与安全传输边界 #151
Closed
opened 2026-08-29 21:04:54 +08:00 by ila
·
5 comments
No Branch/Tag Specified
dev
feat/183-bell-contact-schedule
docs/171-coordination-e2e-wiki
feature/155-coordination-e2e
docs/168-sync-coordination-wiki
feature/154-coordination-deployment
docs/152-153-connectors
feature/153-event-evidence-connector
feature/152-brain-control
docs/151-machine-identity-acceptance
task/151-machine-identity
docs/150-contract-acceptance
docs/148-149-contract-acceptance
feature/149-runtime-status-contract
feature/150-event-evidence-contract
feature/148-source-config-contract
docs/8-mvp-acceptance
feature/145-sense-e2e-isolation-cleanup
feature/134-bell-independent-e2e
feature/142-bell-ui-shell-startup
feature/140-bell-minimal-admin-menu
feature/138-bell-production-captcha
feature/133-bell-alert-lifecycle
feature/132-bell-rule-alert
feature/131-bell-event-receipt
feature/16-brain-local-events
feature/15-brain-rules
feature/14-brain-vision
feature/13-brain-decode
feature/11-brain-input
main
feat/sense-79-ops-alerts
feat/sense-78-outbox
feat/77-sense-media-shards
feat/76-sense-edge-node-status
feat/75-sense-quota-capacity
feature/74-sense-operations
feature/73-sense-local-events
feature/72-sense-bulk-provisioning
feature/113-record-parallel-acceptance
feature/113-sync-parallel-implementation-docs
feature/71-sense-e2e-regression
feature/62-bell-goadmin-skeleton
feature/10-brain-python-cuda-skeleton
feature/108-sync-devharness
feature/90-sense-root-launcher
feature/106-supervisor-sense
fix/101-sense-layout-shell
feature/104-sense-login-30-days
docs/99-acceptance
feature/99-sense-app-config
feature/70-sense-windows-delivery
fix/95-sense-media-path-constraint
feature/97-sense-password-login
docs/92-acceptance
fix/92-sense-capabilities-jsonb
docs/69-acceptance
feature/69-sense-area
feature/68-sense-liveview
feature/67-sense-mediamtx-reconcile
feature/66-sense-onvif-admission
feature/65-sense-device-credential
feature/64-sense-auth-rbac-audit
feature/61-sense-goadmin-source-baseline
docs/acceptance-batch-20260814
coordination/58-finalize-branch-governance
explore
agent/codex/56-sense-device-edit-payload
agent/codex/54-sense-liveview-on-demand
agent/codex/51-sense-auto-liveview
agent/codex/50-sense-split-camera-credentials
agent/codex/48-sense-onvif-digest
agent/codex/46-sense-env-loader
agent/codex/44-sense-empty-navigation
agent/codex/42-sense-password-length-only
agent/codex/40-sense-password-min-6
agent/codex/37-sense-windows-package
agent/codex/36-bell-docs
agent/codex/9-bell-mvp
agent/codex/21-sense-mvp
agent/codex/28-current-prototypes
agent/codex/5-goadmin-baseline
agent/codex/3-go-admin-ui-reuse
agent/codex/1-collaboration-rules
No results found.
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ila/yovision#151
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
状态
已完成(2026-08-31,用户验收通过)
基本信息
contracts/machine-identity/v1/**、contracts/transport/v1/**目标
为三端 connector 建立按产品和实例隔离的机器身份、最小权限、传输认证、轮换/吊销与审计边界,禁止复用管理员密码、浏览器 JWT/Cookie 或共享数据库角色。
已确认安全设计门禁
非目标
不建立统一用户中心,不传递网页登录态,不共享摄像头凭据,不实现业务事件/配置字段,不修改 GoAdmin 登录机制,不接管操作系统账户。
精确 write_paths
contracts/machine-identity/v1/**contracts/transport/v1/**contracts/tests/machine-identity-v1/**Sense/server/app/sense/integration/machine_identity/**Brain/src/yovision_brain/integration/machine_identity/**Brain/pyproject.toml(仅增加并冻结 Ed25519 所需的cryptography==50.0.1运行依赖)Bell/server/app/bell/integration/machine_identity/**禁止写入:其他产品业务目录、其他
contracts/**、根级部署、真实配置、docs/**。验收标准
验证
威胁模型检查、三端单测/集成、错身份/重放/过期/轮换/吊销测试、秘密扫描、日志脱敏和契约兼容测试。
风险与回退
属于高风险安全修改。方案未确认不得编码;回退关闭跨项目 connector 并恢复三端独立运行,不降级为共享管理员身份或明文 token。
设计与文档影响
非 UI 任务,以安全架构和流程设计为确认门禁;完成后更新 Architecture、Business-Rules、Deployment/Operations、Troubleshooting 和配置边界 Wiki。
安全设计确认(2026-08-31)
用户明确回复:
确认 #151 安全设计。确认采用 v1 方案:
source-config:write;Brain→Senseruntime-status:write;Brain/Sense→Bellevents:ingest;Bell→Senseevidence:read。按工单既定 write_paths 开始实施。
实施前依赖检查(2026-08-31)
任务分支:
task/151-machine-identity,当前尚未修改产品代码。发现 Brain 的 CPython 3.11 冻结环境没有 Ed25519 实现,标准库也不提供 Ed25519 签名/验签;当前
cryptography和 PyNaCl 均未安装。自写或复制纯 Python 密码算法不满足生产安全与可维护性要求。建议把
Brain/pyproject.toml纳入精确 write_paths,仅增加并冻结cryptography==50.0.1运行依赖。该版本由 Python Cryptographic Authority 发布,支持 Python 3.11,并提供 Windows x86-64 wheel。其他依赖和工具链不变。这是依赖与写路径变化,已暂停实施并等待用户单独确认。
用户于 2026-08-31 明确回复:
确认 #151 增加 cryptography 依赖。现解除依赖门禁,按扩展后的 write_paths 增加并冻结cryptography==50.0.1,继续实施。实施完成,等待用户验收(2026-08-31)
最终差异
yovision.machine-identity/v1和yovision.transport/v1:Ed25519、5 分钟有效期、30 秒时钟偏差、请求方法/路径/正文摘要绑定、单次 jti、精确 audience/scope。cryptography==50.0.1;无自制密码算法。提交与 PR
009dc3cca0ad835cf10fec6b58c7436bd66315b0dev,当前可合并验证证据
go test ./...、go vet ./...:通过git diff --check:通过文档与未验证边界
有长期文档影响:Architecture、Business-Rules、Deployment/Operations、Troubleshooting 和验证 Wiki。实现分支遵守
docs/**禁止写入;用户验收后按 Wiki→在线回读→核心镜像独立 PR 闭环。未验证真实客户 PKI/网络、现场时钟漂移和 connector 重启;#152/#153 必须注入各产品独立的持久原子 replay store并完成重启/断网测试。本次未创建任务归档。
用户验收通过(2026-08-31 11:24 +08:00)
用户明确回复:
#151通过。合并与复核
009dc3cca0ad835cf10fec6b58c7436bd66315b006e0790f00910a36c8369d7063925cd3e8db17c6git diff --check:通过长期文档
已在线更新并回读:
41c2193b2f1edb37abe1e8994d65d022075490397a91edf3ca35ade3e254937c4a68b53d816a3eea54d720aa07d2c40684da3fc04378393c7f318a0475bf70f375f58356e968b45139b54fcae391d1e8771fdd92eb03e9dff7d3ae20b7cb89f1ca288959核心镜像提交:
ae9bd015c264d8378b13547b79aaa7f1fa6eaa69;PR #163 合并提交:cf00d73436e943849aa75a02a5d8b99a5f6b6171。镜像一致性检查通过。后续边界
#152/#153 的前置现已满足,但尚未实施;它们必须接入各产品独立持久 replay store并验证重启/断网,不得共享数据库。本次未创建任务归档。