主要改动: - 固定 Go 1.25.5 与 CI 校验并更新扫描流程 - 升级 quic-go、x/crypto、req 等依赖并通过 govulncheck - 强化 JWT 校验、TLS 配置与 xlsx 动态加载 - 新增审计豁免清单与校验脚本
1.9 KiB
1.9 KiB
Dependency Security
This document describes how dependency and toolchain security is managed in this repo.
Go Toolchain Policy (Pinned to 1.25.5)
The Go toolchain is pinned to 1.25.5 to address known security issues.
Locations that MUST stay aligned:
backend/go.mod:go 1.25.5andtoolchain go1.25.5Dockerfile:GOLANG_IMAGE=golang:1.25.5-alpine- Workflows: use
go-version-file: backend/go.modand verifygo1.25.5
Update process:
- Change
backend/go.mod(go + toolchain) to the new patch version. - Update
DockerfileGOLANG_IMAGE to the same patch version. - Update workflows if needed and keep the
go versioncheck in place. - Run
govulncheckand the CI security scan workflow.
Security Scans
Automated scans run via .github/workflows/security-scan.yml:
govulncheckfor Go dependenciesgosecfor static security issuespnpm auditfor frontend production dependencies
Policy:
- High/Critical findings fail the build unless explicitly exempted.
- Exemptions must include mitigation and an expiry date.
Audit Exceptions
Exception list location: .github/audit-exceptions.yml
Required fields:
packageadvisory(GHSA ID or advisory URL from pnpm audit)severitymitigationexpires_on(recommended <= 90 days)
Process:
- Add an exception with mitigation details and an expiry date.
- Ensure the exception is reviewed before expiry.
- Remove the exception when the dependency is upgraded or replaced.
Frontend xlsx Mitigation (Plan A)
Current mitigation:
- Use dynamic import so
xlsxonly loads during export. - Keep export access restricted and data scope limited.
Rollback Guidance
If a change causes issues:
- Go: revert
backend/go.modandDockerfileto the previous version. - Frontend: revert the dynamic import change if needed.
- CI: remove exception entries and re-run scans to confirm status.