dsh-vigil 0.0.1
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.
- package/LICENSE +201 -0
- package/README.md +188 -0
- package/client.js +4652 -0
- package/cordis.patch.yml +7 -0
- package/docs/DETAIL.md +66 -0
- package/icon.png +0 -0
- package/illustrations/notice.png +0 -0
- package/illustrations/warning.png +0 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +75 -0
- package/rules/audit.yaml +130 -0
- package/rules/manifest.json +7 -0
- package/rules/sentinel.yaml +289 -0
- package/src/alert-route.js +194 -0
- package/src/approval.js +398 -0
- package/src/artwork-route.js +87 -0
- package/src/audit/ast.js +213 -0
- package/src/audit/install-scan.js +127 -0
- package/src/audit/lexer.js +307 -0
- package/src/audit/narrative.js +320 -0
- package/src/audit/rules.js +1440 -0
- package/src/audit/scan.js +880 -0
- package/src/audit-clear-route.js +89 -0
- package/src/audit-feed.js +265 -0
- package/src/audit-log.js +887 -0
- package/src/config-schema.js +194 -0
- package/src/config.js +580 -0
- package/src/delete/command-kinds.js +46 -0
- package/src/delete/lex.js +46 -0
- package/src/delete/parser-posix.js +1427 -0
- package/src/delete/parser-pwsh.js +1729 -0
- package/src/delete/parser.js +2082 -0
- package/src/delete/policy.js +680 -0
- package/src/delete/quarantine.js +417 -0
- package/src/index.js +1134 -0
- package/src/install-scan-route.js +58 -0
- package/src/install-watch.js +389 -0
- package/src/integrity.js +509 -0
- package/src/live-config.js +88 -0
- package/src/quarantine-route.js +74 -0
- package/src/quarantine-view.js +44 -0
- package/src/rules/pack.js +423 -0
- package/src/rules/update.js +341 -0
- package/src/rules/yaml.js +186 -0
- package/src/sage-action-route.js +63 -0
- package/src/sage-provision.js +716 -0
- package/src/sentinel/guard.js +392 -0
- package/src/sentinel/hook.js +546 -0
- package/src/sentinel/rules.js +488 -0
- package/src/sentinel/sage-load.js +79 -0
- package/src/sentinel/sage.js +550 -0
- package/src/tools.js +727 -0
- package/src/update-check.js +339 -0
- package/src/util.js +400 -0
- package/threats/README.md +25 -0
package/LICENSE
ADDED
|
@@ -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 2026 dsh-vigil contributors
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/dsh-vigil-banner.webp" alt="DSH VIGIL — DeepSeek Harness Guardian" width="100%" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">DSH VIGIL · 守夜人</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>让插件风险看得见,让危险操作停得住,让误删数据有机会恢复。</strong>
|
|
9
|
+
<br />
|
|
10
|
+
DeepSeek Harness 插件的安装审计、运行时守护与可恢复隔离工具。
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://github.com/DusklitSakura/dsh-vigil/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache--2.0-3B82F6?style=flat-square" alt="Apache-2.0 License" /></a>
|
|
15
|
+
<img src="https://img.shields.io/badge/Node.js-%E2%89%A520-2563EB?style=flat-square" alt="Node.js >=20" />
|
|
16
|
+
<img src="https://img.shields.io/badge/DeepSeek%20Harness-Plugin-0F2D5C?style=flat-square" alt="DeepSeek Harness Plugin" />
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="#功能一览">功能</a> ·
|
|
21
|
+
<a href="#安装">安装</a> ·
|
|
22
|
+
<a href="#快速上手">快速上手</a> ·
|
|
23
|
+
<a href="#安全边界与已知限制">安全边界</a> ·
|
|
24
|
+
<a href="#文档">文档</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 为什么需要 VIGIL?
|
|
30
|
+
|
|
31
|
+
插件可能读取凭证、向外发送数据、修改配置,或触发大规模删除。`dsh-vigil` 在 DeepSeek Harness 的工具执行链中增加审计与决策层:对插件目录进行静态审计,按安装来源补充安装 / 更新审计,在运行时评估高风险操作,并将部分被拒绝的删除转入隔离区,同时留下可校验的审计记录。
|
|
32
|
+
|
|
33
|
+
> **设计原则:先审计、再决策;能阻止时明确阻止,能恢复时保留恢复路径;做不到的事情明确说明。**
|
|
34
|
+
|
|
35
|
+
## 功能一览
|
|
36
|
+
|
|
37
|
+
<table>
|
|
38
|
+
<tr>
|
|
39
|
+
<td width="33%" valign="top">
|
|
40
|
+
<h3>🔎 安装前静态审计</h3>
|
|
41
|
+
<p>通过 <code>vigil_scan</code> 检查插件目录,覆盖凭证访问、数据外发、动态执行、配置篡改、供应链与 DSH 特有攻击面;并纳入安装 / 更新审计流程。</p>
|
|
42
|
+
<p><sub>只读扫描,不执行被审计代码;可选 Acorn AST 别名分析。</sub></p>
|
|
43
|
+
</td>
|
|
44
|
+
<td width="33%" valign="top">
|
|
45
|
+
<h3>🛡️ 运行时语义守卫</h3>
|
|
46
|
+
<p>在 <code>tools/pre-execute</code> 上评估危险调用,对凭证外发、可疑主机、编码命令、远程动态执行及高危操作按规则放行、询问或拒绝。</p>
|
|
47
|
+
<p><sub>内置规则可独立工作;Sage 为可选引擎。</sub></p>
|
|
48
|
+
</td>
|
|
49
|
+
<td width="33%" valign="top">
|
|
50
|
+
<h3>📦 可恢复隔离区</h3>
|
|
51
|
+
<p>对满足条件的、目标明确的删除操作,在拒绝后尝试移入隔离区,提供列表、恢复、过期清理与明确确认的永久清空。</p>
|
|
52
|
+
<p><sub>通配符或变量目标只拒绝,不会擅自移动。</sub></p>
|
|
53
|
+
</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td width="33%" valign="top">
|
|
57
|
+
<h3>🧭 删除规模感知</h3>
|
|
58
|
+
<p>规范化路径并按 critical / high / medium 保护根分级,结合单次与会话累计阈值判断删除风险。</p>
|
|
59
|
+
<p><sub>系统破坏默认拒绝;数据破坏默认询问。</sub></p>
|
|
60
|
+
</td>
|
|
61
|
+
<td width="33%" valign="top">
|
|
62
|
+
<h3>🧾 哈希链审计</h3>
|
|
63
|
+
<p>记录关键决策,支持尾部查看、完整性校验以及 JSON / CSV 导出;可选 HMAC 锚定用于增强链头一致性检查。</p>
|
|
64
|
+
<p><sub>日志写入属于尽力而为,不是不可篡改存储。</sub></p>
|
|
65
|
+
</td>
|
|
66
|
+
<td width="33%" valign="top">
|
|
67
|
+
<h3>🪞 自保护与完整性检查</h3>
|
|
68
|
+
<p>保护插件自身目录与状态目录,结合文件基线、金丝雀、心跳及可选 Ed25519 签名检测异常替换。</p>
|
|
69
|
+
<p><sub>完整性检查用于发现替换,不会阻止同权限攻击者替换文件。</sub></p>
|
|
70
|
+
</td>
|
|
71
|
+
</tr>
|
|
72
|
+
</table>
|
|
73
|
+
|
|
74
|
+
### 工作方式
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
插件安装 / 更新
|
|
78
|
+
│
|
|
79
|
+
▼
|
|
80
|
+
静态审计 ── 高危命中或覆盖不足 ──► 提示 / 询问
|
|
81
|
+
│
|
|
82
|
+
▼
|
|
83
|
+
工具调用进入 pre-execute
|
|
84
|
+
│
|
|
85
|
+
▼
|
|
86
|
+
规则评估(内置规则 + 可选 Sage)
|
|
87
|
+
│
|
|
88
|
+
├── allow:继续执行
|
|
89
|
+
├── ask:请求审批
|
|
90
|
+
└── deny:拒绝;符合条件时转入隔离区
|
|
91
|
+
│
|
|
92
|
+
▼
|
|
93
|
+
审计记录 / 状态检查
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## 安装
|
|
97
|
+
|
|
98
|
+
### 推荐:通过 DSH 插件管理器从 GitHub 安装
|
|
99
|
+
|
|
100
|
+
1. 打开 DeepSeek Harness 的 **Plugins → Add plugin**。
|
|
101
|
+
2. 输入固定提交的安装规格:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
github:DusklitSakura/dsh-vigil#<40 位 commit SHA>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
3. 将 `<40 位 commit SHA>` 替换为仓库中目标提交的完整 40 位 SHA。固定提交可避免分支内容变化带来的不确定性,也便于后续由 DSH 管理更新。
|
|
108
|
+
4. 安装完成后新开一个会话生效(或等待 Harness HMR 激活)。设置页位于 **Settings → 守夜人**。
|
|
109
|
+
|
|
110
|
+
如果当前会话提供 `plugin_manager`,也可以调用 `install_bundle`,并将 `target` 设置为同一个 GitHub 安装规格。
|
|
111
|
+
|
|
112
|
+
> **安装审计时机:** 本地路径安装在执行前同步扫描并询问;GitHub / registry / tarball 安装无法在下载前扫描,会在插件管理器完成安装/更新后立即触发后台静态审计(`plugin-manager/changed`),并保留约 60 秒的兜底差分;扫描完成后弹出审计结果。首次启动只建立基线,不会把已有插件全部重新报告。
|
|
113
|
+
|
|
114
|
+
### 依赖与构建
|
|
115
|
+
|
|
116
|
+
- **Node.js:** `>=20`。
|
|
117
|
+
- **无需构建步骤,也没有安装脚本。** `src/` 与 `client.js` 是实际加载文件。
|
|
118
|
+
- 通过 Plugins 从 GitHub / npm / tarball 安装时,DSH / pnpm 会自动管理 `@deepseek-ai/schemastery` 与 `acorn`,普通用户不需要手动安装依赖。
|
|
119
|
+
- 缺少 `schemastery` 时插件仍可挂载,但不会显示设置页;缺少 `acorn` 时静态审计会退化为纯正则分析,AST 别名分析跳过。
|
|
120
|
+
|
|
121
|
+
### 本地开发安装注意事项
|
|
122
|
+
|
|
123
|
+
不要把正在使用的 Git 仓库直接通过本地目录 `link:` 安装进 profile,尤其是在 Windows 环境。卸载或更新时,清理操作可能沿 junction/link 触碰源目录。需要调试时,请使用一次性副本,并参考[安装与恢复说明](docs/install.md)。
|
|
124
|
+
|
|
125
|
+
## 快速上手
|
|
126
|
+
|
|
127
|
+
安装后可从 **Settings → 守夜人** 查看状态与配置。设置页支持宽松 / 标准 / 严格预设;修改会自动保存并即时生效。
|
|
128
|
+
|
|
129
|
+
| 工具 | 用途 |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `vigil_scan` | 对指定插件目录执行只读静态审计 |
|
|
132
|
+
| `vigil_status` | 查看模式、保护根、会话累计、隔离区、Sage、完整性与最近决策 |
|
|
133
|
+
| `vigil_quarantine` | `list` / `restore` / `expire` / `purge`;`purge` 需要 `confirm=true` |
|
|
134
|
+
| `vigil_audit` | `tail` / `verify` / `json` / `csv`,查看与校验审计链 |
|
|
135
|
+
| `vigil_integrity` | `status` / `check` / `rebaseline` |
|
|
136
|
+
| `vigil_sage` | 查看、安装或更新可选 Sage 引擎 |
|
|
137
|
+
| `vigil_doctor` | 检查钩子、自保护、路由、审批、隔离区、完整性、规则包与配置 |
|
|
138
|
+
| `vigil_rules` | 查看、校验、锁定或更新规则包 |
|
|
139
|
+
|
|
140
|
+
### 紧急停用
|
|
141
|
+
|
|
142
|
+
如需紧急绕过守卫,可使用以下任一方式:
|
|
143
|
+
|
|
144
|
+
- 创建空文件:`%USERPROFILE%\.dsh\vigil\DISABLED`
|
|
145
|
+
- 设置环境变量:`DSH_VIGIL_DISABLED=1`
|
|
146
|
+
|
|
147
|
+
停机开关会在每次工具调用前重新读取,无需重启。启用后拦截跳过,但仍会记录 `pre-execute-bypass`。请只在排障或恢复需要时使用。
|
|
148
|
+
|
|
149
|
+
## 安全边界与已知限制
|
|
150
|
+
|
|
151
|
+
`dsh-vigil` **不是安全边界**。它与 Harness 宿主进程共享真实权限;拥有同等权限的攻击者可以直接替换插件文件或删除状态,届时防护可能失效。自完整性检查的作用是让部分替换变得可见,而不是阻止替换。
|
|
152
|
+
|
|
153
|
+
使用前也请了解这些边界:
|
|
154
|
+
|
|
155
|
+
- 静态扫描无法预知所有运行时行为;变量拼接、加密载荷或后续下载执行的代码可能无法被完整还原。
|
|
156
|
+
- 删除防护有覆盖范围限制;某些脚本内部或语言运行时中的删除行为不在完整覆盖范围内。
|
|
157
|
+
- `ask` 需要 Harness 提供可用的审批通道;页面离线或没有人及时审批时,请求可能超时并按拒绝处理。
|
|
158
|
+
- Sage 是可选的第三方引擎。启用时会下载并在宿主进程内加载第三方代码,请先阅读相关说明与信任边界。
|
|
159
|
+
- 审计日志属于尽力而为;发生写入失败时,决策可能继续执行并留下警告。
|
|
160
|
+
|
|
161
|
+
完整限制列表请阅读[已知限制](docs/limitations.md),不要将功能概览替代安全评估。
|
|
162
|
+
|
|
163
|
+
## 文档
|
|
164
|
+
|
|
165
|
+
| 文档 | 内容 |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| [安装、更新与卸载](docs/install.md) | GitHub 固定提交安装、更新、停用与本地安装风险 |
|
|
168
|
+
| [配置参考](docs/configuration.md) | 全部配置字段、默认值与保护根分级 |
|
|
169
|
+
| [设置页说明](docs/settings.md) | 设置、规则包更新、对话内审计与审批 |
|
|
170
|
+
| [行为与决策流](docs/behavior.md) | 决策过程、删除隔离边界与规模计量限制 |
|
|
171
|
+
| [工具清单](docs/tools.md) | 工具名称、参数与输出等级 |
|
|
172
|
+
| [插件详情页说明](docs/DETAIL.md) | 插件详情页安装/审计说明(分发详情页引用) |
|
|
173
|
+
| [测试与验证](docs/testing.md) | 测试分层、覆盖率基线、发版检查单 |
|
|
174
|
+
| [已知限制](docs/limitations.md) | 适用边界与不可覆盖场景 |
|
|
175
|
+
| [架构说明](docs/ARCHITECTURE.md) | 模块结构与关键不变量 |
|
|
176
|
+
| [开发说明](docs/development.md) | 模块地图、测试与状态目录 |
|
|
177
|
+
| [验证记录](docs/verification.md) | 测试及实机验证记录 |
|
|
178
|
+
|
|
179
|
+
## 许可证
|
|
180
|
+
|
|
181
|
+
本项目代码采用 [Apache License 2.0](LICENSE)。第三方依赖与可选 Sage 引擎的许可和署名信息,以各自上游项目为准。
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
<p align="center">
|
|
186
|
+
<strong>DSH VIGIL</strong><br />
|
|
187
|
+
<sub>Stay alert. Make risk visible. Keep recovery possible.</sub>
|
|
188
|
+
</p>
|