跳转到正文
报告库
用途分类 / 开发辅助

Observability And Instrumentation Skill 安全审计

作者说它能做什么(原文)

Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

第三方安全检查结论

发现安全风险

已检查文件
1
发现的风险
2
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。未发现风险
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 2 项风险
中风险

示例直接信任并传播客户端提供的请求 ID

原文依据:3 处
发现了什么

中间件接受任意 `x-request-id`,随后把它写入日志上下文、响应头并按指南传播至下游;没有格式、长度、唯一性或可信来源检查。

为什么需要注意

能够发送请求的人可复用或伪造请求 ID,把无关事件混在同一查询结果中,误导事件调查;超长或异常值还可能在日志、队列元数据或下游请求头中放大处理问题。

该指南把相关 ID 设为强制项,示例会直接接受客户端提供的 `x-request-id`,再写入日志上下文和响应头,并要求跨下游边界传播。若应用照搬且未在别处验证,攻击者可提交超长、格式异常或重复的 ID,污染日志、误导请求关联,并把不可信值传给下游。这里是示例而非完整实现,因此不能断言验证一定缺失;用户可要求作者明确规定长度、字符集、可信边界及重新生成策略。

SKILL.md:79来自说明文档打开原文件
**Correlation IDs are mandatory.** Generate (or accept) a request ID at the system boundary and attach it to every log line, span, and outbound call. Without it, you cannot reconstruct a single request from interleaved logs:```typescript// Express: child logger per request, ID propagated downstreamapp.use((req, res, next) => {  req.id = req.headers['x-request-id'] ?? crypto.randomUUID();  req.log = logger.child({ requestId: req.id });  res.setHeader('x-request-id', req.id);  next();
查看另外 2 个位置
SKILL.md:104来自说明文档打开原文件
Both fields have to cross the same boundaries as the correlation ID — queue metadata, HTTP headers — or a worker re-derives the entry point and guesses. A field that merely correlates with an entry point is a hint, not an attribution: anything that can invoke the job can reproduce it.
SKILL.md:83来自说明文档打开原文件
// Express: child logger per request, ID propagated downstreamapp.use((req, res, next) => {  req.id = req.headers['x-request-id'] ?? crypto.randomUUID();  req.log = logger.child({ requestId: req.id });  res.setHeader('x-request-id', req.id);  next();});
低风险

临时降低告警阈值可能触发真实值班通知

原文依据:3 处
发现了什么

验证步骤要求逐一触发新告警,并建议临时降低阈值,但没有把该操作明确限制在隔离的测试环境或测试通知通道。

为什么需要注意

如果在生产告警规则上执行,可能制造误报、打扰值班人员,并暂时改变真实事件的告警行为。

指南要求测试触发每个新告警,并明确建议临时降低阈值,但该条没有将操作限定在预发布环境或测试通知通道。若对生产告警照做,真实值班人员可能收到误报,造成干扰、错误升级或告警疲劳。相邻的“在 staging 强制错误”仅修饰日志检查,不能清楚约束后面的告警操作。用户可要求作者规定只在隔离环境测试,或使用静默/测试接收者并提前通知值班人员。

SKILL.md:172来自说明文档打开原文件
### 7. Verify the telemetry itselfInstrumentation is code; it can be wrong. Before calling the work done, trigger the paths and look at the actual output:- Force an error in staging → find it in the logs by `requestId`, confirm fields are structured (not `[object Object]`)- Send test traffic → confirm metric series appear with the expected labels and sane values- Follow one request across services in the tracing UI → no broken spans- Fire each new alert once (lower the threshold temporarily) → confirm it reaches the right channel and the runbook link works
查看另外 2 个位置
SKILL.md:165来自说明文档打开原文件
Rules for every alert you create:1. **It must be actionable.** If the response is "ignore it, it self-heals", delete the alert.2. **It links to a runbook** — even three lines: what it means, first query to run, escalation path.3. **It has a threshold and duration** justified by the SLO or by historical data, not by a guess.4. Use two severities only: **page** (user-facing, act now) and **ticket** (degradation, act this week). A third tier becomes noise that trains people to ignore everything.
SKILL.md:174来自说明文档打开原文件
Instrumentation is code; it can be wrong. Before calling the work done, trigger the paths and look at the actual output:- Force an error in staging → find it in the logs by `requestId`, confirm fields are structured (not `[object Object]`)- Send test traffic → confirm metric series appear with the expected labels and sane values- Follow one request across services in the tracing UI → no broken spans- Fire each new alert once (lower the threshold temporarily) → confirm it reaches the right channel and the runbook link works
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

6 个说明模块

该 Skill 是一份可观测性实施指南,要求先定义值班人员需要回答的问题,再选择结构化日志、指标、追踪和告警;提供的代码均为示例,没有安装命令、文件修改脚本或遥测导出地址。

查看原文
SKILL.md:27来自说明文档打开原文件
### 1. Define "working" before instrumentingTelemetry without a question is noise. Before adding any instrumentation, write down 2–4 questions an on-call engineer will ask about this feature:
SKILL.md:42来自说明文档打开原文件
### 2. Pick the right signal for each question| Signal | Answers | Cost profile | Example ||---|---|---|---|| **Structured log** | "What happened in this specific case?" | Per-event; grows with traffic | `payment_failed` with provider error code || **Metric** | "How often / how fast, in aggregate?" | Fixed per series; cheap to query | p99 latency of provider calls || **Trace** | "Where did time go across services?" | Per-request; usually sampled | One slow checkout, broken down by hop |

它明确禁止把秘密、令牌、密码、完整个人信息或整个请求体写入日志,并要求通过允许列表选择字段和检查实际输出。这降低了遥测管道泄露敏感数据的风险,但是否落实取决于使用者生成的实现。

查看原文
SKILL.md:106来自说明文档打开原文件
**Never log secrets, tokens, passwords, or full PII.** This is a hard rule from the `security-and-hardening` skill — telemetry pipelines are a classic data-leak path. Allowlist fields; don't log whole request bodies.
SKILL.md:213来自说明文档打开原文件
- [ ] Every log sink written by more than one entry point carries an entry-point field, set where the run starts and propagated with the correlation ID rather than inferred downstream- [ ] No secrets, tokens, or unredacted PII in any log line (spot-check actual output)- [ ] RED metrics exist for every new endpoint and every external dependency, with bounded label sets

它建议启用 OpenTelemetry 的 HTTP、gRPC 和常见数据库客户端自动插桩,并跨 HTTP 与队列传递追踪上下文。这样会扩大被收集和传播的运行数据范围,具体字段及目的地取决于实际 SDK、插桩组件和后端配置;这些配置未包含在所给来源中。

查看原文
SKILL.md:136来自说明文档打开原文件
Use OpenTelemetry — it's the vendor-neutral standard, and auto-instrumentation covers HTTP, gRPC, and common DB clients with near-zero code:```typescript// tracing.ts — must be imported before anything elseimport { NodeSDK } from '@opentelemetry/sdk-node';import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';const sdk = new NodeSDK({  serviceName: 'checkout-service',  instrumentations: [getNodeAutoInstrumentations()],});sdk.start();```
SKILL.md:150来自说明文档打开原文件
Add manual spans only around meaningful internal units of work (e.g., `applyDiscounts`, `chargeProvider`) and attach the attributes on-call will filter by. Propagate context across every async boundary — HTTP headers, queue message metadata — or the trace dies at the gap. Sample head-based at a low rate by default; keep 100% of errors if your backend supports tail sampling.
从这里开始 · 工作说明SKILL.md
observability-and-instrumentation
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明

代码和说明中提到的操作

读取密钥或账号配置
SKILL.md:101来自说明文档打开原文件
// POST /jobs/:id/replay -> runLog('replay_endpoint', req.id)// CLI invocation        -> runLog('cli', process.env.RUN_ID ?? crypto.randomUUID())```
读取了多少行
221
文件校验值(用于核对版本)
952d058f971fecf46bb8e84d4fb9f45b1a36cf32fb794a799dca609535119ea6