场景 108 · Codex Use Case

在 GitHub Cloud 中自动审查安全风险

连接仓库并配置 Codex Security Review 的审阅触发条件。

SecurityEngineering
Automate security reviews in GitHub CloudSecurityEngineering

原文核对:2026-11-10 · 中文正文 · 英文提示词与演示

场景定位

连接仓库并配置 Codex Security Review 的审阅触发条件。

难度
中级
时间跨度
30 分钟

适合用于

  • 希望在现有 GitHub PR 流程中获得安全反馈的开发者。
  • 需要对拟合入代码建立一致审查流程的应用安全团队。
  • 需要为认证、授权、支付等敏感路径定制报告阈值的仓库维护者。

在 GitHub Cloud 中自动运行安全审查,最快的方式是使用 ChatGPT 中的 Security Review。它与组织内 Codex Code Review 共用产品入口,设置地址为 https://chatgpt.com/codex/cloud/settings/code-review。

Codex Security Review 会结合 PR 差异、仓库上下文以及配置的威胁模型或安全指引,比常规 Code Review 更深入地评估安全风险。

Code Review 与 Security Review 的区别

Code Review 面向组织内的软件开发者,进行广泛的工程质量审查,例如“此改动会破坏产品或引入严重工程问题吗?”它检查控制流错误、数据损坏或丢失、兼容性回归以及 API 行为错误等。

Codex Security 则对同一 PR 的安全风险进行专门、深入的评估,适用于负责漏洞修复的开发者,以及保障 CI/CD 和源代码安全的应用安全工程师。它检查认证和授权绕过、跨租户访问、注入、不安全解析和敏感数据泄露等。

配置安全审查

安全审查提供两类报告设置。自动审查报告决定自动运行时向 PR 发布哪些发现,默认阈值为 High,即仅发布 High 和 Critical 发现。

手动审查设置决定有人明确请求 Security Review 后发布哪些发现,默认阈值为 Medium,即发布 Medium、High 和 Critical 发现。

配置后,发布的漏洞发现会显示在 PR 中。

Security finding posted on a GitHub pull request.

自动报告阈值应匹配团队能够持续调查的范围。针对特定问题开展调查时,可以通过手动审查设置展示更细的相关信息。

设置路径覆盖规则

基于路径的覆盖规则可以改变发布到 GitHub PR 的最低严重程度。仓库各处风险不同,可为关键路径定制阈值,例如:

  • 为认证、授权、支付、密码学、CI 工作流或基础设施降低报告阈值。
  • 对风险较低或噪声较多的区域保持更高阈值。

在所选仓库的 Codex Cloud 设置中修改路径覆盖规则。下方示例为 src/** 配置了 Low 及以上的自动审查报告,而 GitHub 工作流或依赖变更则从 Medium 开始报告。

Path overrides for source files, workflows, and dependencies.
展开英文原文对照

Connect a repository and configure review triggers with Codex Security Review.

The fastest way to automate security reviews in GitHub Cloud is through the Security Review feature within ChatGPT. This is available through the same product surface as Codex Code Reviews available within your organization at https://chatgpt.com/codex/cloud/settings/code-review.

Codex Security Review goes deeper than Code Review on security-specific risks by analyzing the pull request diff, supporting repository context, and configured threat models or security guidance.

Difference between Code Review and Security Review

Code Review is a broad engineering review that assesses code quality. For example, Code Review asks: “Could this change break the product or introduce a serious engineering problem?” It reviews issues such as incorrect control flow, data corruption or loss, compatibility regressions, or incorrect API behavior. The intended users for Code Review are software developers within the organization.

Codex Security is a specialized, deeper assessment of security risks in the same PR changes. Security Review is for both software developers responsible for remediating vulnerabilities, as well as application security engineers responsible for securing CI/CD pipelines and source code. It assesses issues such as authentication and authorization bypasses, cross-tenant access, injection and unsafe parsing, or sensitive data exposure.

Configure security reviews

There are two options for configuring security reviews. The auto-review reporting determines which findings Codex posts to the PR when Security Review runs automatically. It is defaulted to High, so only High and Critical findings are posted.

The option for manual review controls which findings Codex posts after someone explicitly requests a Security Review. It is defaulted to Medium, so Medium, High, and Critical findings are posted.

When configured, posted vulnerabilities will surface within the PR.

Security finding posted on a GitHub pull request.

It’s best to choose automatic reporting thresholds around what the team is prepared to investigate consistently. For a targeted investigation, use the manual review settings to surface the additional detail relevant to that question.

Set path overrides

Path-based reporting overrides the minimum severity published to the Github PR. Given that a repository’s risk is rarely uniform, this feature can tailor the risk threshold for more critical path, such as:

  • Lowering the threshold for authentication, authorization, payments, cryptography, CI workflows, of infrastructure.
  • Keeping a higher threshold for lower-risk or especially noisy areas.

You can modify the path overrides within the Codex Cloud settings for the selected repo. In this example below, we have established that src/** should have auto reviews for low vulnerabilities or higher. Changes to GitHub workflows or dependencies will enforce reporting for medium vulnerabilities.

Path overrides for source files, workflows, and dependencies.