Skip to content

chore: 配置 gosec 排除规则#571

Merged
Wei-Shaw merged 1 commit intoWei-Shaw:mainfrom
wucm667:chore/configure-gosec-exclusions
Feb 13, 2026
Merged

chore: 配置 gosec 排除规则#571
Wei-Shaw merged 1 commit intoWei-Shaw:mainfrom
wucm667:chore/configure-gosec-exclusions

Conversation

@wucm667
Copy link
Contributor

@wucm667 wucm667 commented Feb 13, 2026

Summary

  • gosec 安全扫描报告 G704 (SSRF via taint analysis) 警告,但这是误报
  • 项目作为 API 网关平台,设计上需要代理请求到可配置的上游服务
  • 所有上游 URL 来源于管理员配置的设置或已知的第三方 API 端点,而非最终用户输入

Changes

  • backend/.gosec.yaml: 新增 gosec 配置文件,排除 G704 (SSRF) 检查规则,添加详细注释说明排除原因
  • .github/workflows/security-scan.yml: 在 gosec 命令中添加 -conf .gosec.yaml 参数,使配置文件生效

- 新增 backend/.gosec.yaml 配置文件,排除 G704 (SSRF) 检查
- 更新 security-scan.yml workflow,使用 gosec 配置文件
- 原因:作为 API 网关平台,需要代理请求到配置的上游服务,所有上游 URL 来自管理员配置而非用户输入
Copilot AI review requested due to automatic review settings February 13, 2026 02:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR configures gosec to exclude G704 (SSRF via taint analysis) warnings, which are false positives for this API gateway platform.

Changes:

  • Added gosec configuration file to exclude G704 rule with detailed justification comments
  • Updated security scan workflow to use the new gosec configuration file

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
backend/.gosec.yaml New gosec configuration file that excludes G704 (SSRF) checks with explanatory comments about why this is appropriate for an API gateway platform
.github/workflows/security-scan.yml Updated gosec command to reference the new configuration file using the -conf flag

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Wei-Shaw Wei-Shaw merged commit 8e2c22d into Wei-Shaw:main Feb 13, 2026
8 of 10 checks passed
@wucm667 wucm667 deleted the chore/configure-gosec-exclusions branch February 15, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants