提示词库

网络安全提示词

防御性安全提示词:针对设计的威胁建模、安全代码审查,以及根据日志整理事件时间线。

提示词是英文的,即它们的编写和测试所用的语言。这些页面上的说明和指引已翻译。

  • threat modeling
  • stride
  • secure design
100/100 · 174 token

设计的威胁模型

根据系统描述构建 STRIDE 威胁模型,并为每个威胁给出缓解措施。

适用场景: 在构建之前审查设计,或为你负责的系统记录风险。

prompt
You are a security engineer threat-modeling a system the reader owns.

## Task
Produce a threat model for the system described below, using the STRIDE categories.

## Requirements
- Identify the trust boundaries before listing threats.
- List at least one threat for each STRIDE category that applies, and say which categories do not apply.
- Tie every threat to a component or data flow named in the description.
- Give one mitigation per threat and rate its priority as high, medium, or low.
- Describe threats at the design level; never include exploit techniques or attack steps.

## Output format
Return markdown with three sections: Trust boundaries (bulleted list), Threats (a table with the columns Category, Component, Threat, Mitigation, and Priority), and Assumptions (bulleted list).

## Input
<system>
{{system}}
</system>

变量

{{system}}
各组件、数据流、用户,以及数据存放的位置。

示例输入

system: a browser app calls a public API that writes to Postgres; uploads go to object storage; admins sign in with passwords.

示例输出

## Trust boundaries
- Internet to API

## Threats
| Category | Component | Threat | Mitigation | Priority |
|---|---|---|---|---|
| Spoofing | Admin sign-in | Stolen passwords grant admin access | Require multi-factor authentication | High |

仅为示意:为展示预期的形式而编写,并非由模型生成。

  • secure coding
  • owasp
  • code review
100/100 · 151 token

安全代码审查

审查代码中的注入、失效的访问控制,以及对密钥和输入的不安全处理。

适用场景: 审查处理用户输入、身份验证或敏感数据的变更。

prompt
You are an application security engineer reviewing code for vulnerabilities.

## Task
Review the code below for security vulnerabilities.

## Requirements
- Check for injection, missing authorization checks, unsafe deserialization, hard-coded secrets, and unvalidated input.
- Report only vulnerabilities you can point to in the code, quoting the line.
- Name the weakness class for each finding.
- Give the corrected code for every finding.
- Explain the impact in one sentence without writing an exploit.

## Output format
Return a markdown table with the columns Line, Weakness, Impact, and Corrected code, ordered by severity. If there are no findings, return the single line "No vulnerabilities found in the code provided."

## Input
<code>
{{code}}
</code>

变量

{{code}}
要审查的代码,并写明语言。

示例输入

code: a Node route that builds a SQL string with the id from the query string.

示例输出

| Line | Weakness | Impact | Corrected code |
|---|---|---|---|
| `db.query('SELECT * FROM users WHERE id = ' + req.query.id)` | SQL injection | A caller can read or change other rows | `db.query('SELECT id, name FROM users WHERE id = $1', [req.query.id])` |

仅为示意:为展示预期的形式而编写,并非由模型生成。

改成你的

修改需求以符合你的标准,然后检查结果。提示词分析器会在你输入时重新评分,优化器会在不丢失任何需求的前提下去掉冗词,安全扫描器会在你发送给模型之前标出密钥和个人数据。

更多类别