feat: 发现处置状态扩展为 8 个
在 待处理/误报/忽略/已处理 基础上新增: - in_progress 处理中(已受理、修复/验证中) - confirmed 已确认(真实漏洞未修复) - duplicate 重复 - risk_accepted 风险接受(确认存在但业务接受) 改动:db 常量 + ValidFindingStatus 白名单、schema 注释、status.ts 色板/文案、 types.ts 联合类型、两处下拉的 FINDING_STATUSES(下拉与状态筛选自动带出)。 状态无 CHECK 约束,旧库无需迁移。
This commit is contained in:
1 parent
58a277e2d1
commit
7b3eec2166
6 files changed
+34
-8
No files matched your search
+7
-2
@@ -26,15 +26,20 @@ type DBFinding struct {
|
||||
// Finding triage states (findings.status).
|
||||
const (
|
||||
FindingPending = "pending" // 待处理
|
||||
FindingInProgress = "in_progress" // 处理中
|
||||
FindingConfirmed = "confirmed" // 已确认(真实漏洞,未修复)
|
||||
FindingResolved = "resolved" // 已处理(已修复)
|
||||
FindingFalsePositive = "false_positive" // 误报
|
||||
FindingIgnored = "ignored" // 忽略
|
||||
FindingResolved = "resolved" // 已处理
|
||||
FindingDuplicate = "duplicate" // 重复
|
||||
FindingRiskAccepted = "risk_accepted" // 风险接受
|
||||
)
|
||||
|
||||
// ValidFindingStatus reports whether s is a known triage state.
|
||||
func ValidFindingStatus(s string) bool {
|
||||
switch s {
|
||||
case FindingPending, FindingFalsePositive, FindingIgnored, FindingResolved:
|
||||
case FindingPending, FindingInProgress, FindingConfirmed, FindingResolved,
|
||||
FindingFalsePositive, FindingIgnored, FindingDuplicate, FindingRiskAccepted:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
+2
-1
@@ -545,7 +545,8 @@ CREATE TABLE IF NOT EXISTS findings (
|
||||
evidence TEXT NOT NULL DEFAULT '',
|
||||
worker TEXT NOT NULL DEFAULT '',
|
||||
asset_ids JSONB NOT NULL DEFAULT '[]',
|
||||
-- 处置状态:pending 待处理 / false_positive 误报 / ignored 忽略 / resolved 已处理。
|
||||
-- 处置状态:pending 待处理 / in_progress 处理中 / confirmed 已确认 / resolved 已处理 /
|
||||
-- false_positive 误报 / ignored 忽略 / duplicate 重复 / risk_accepted 风险接受。
|
||||
-- 取值不加 CHECK:旧库靠下面的 ALTER 补列,CHECK 无法回填,统一由 server 侧白名单校验。
|
||||
status TEXT NOT NULL DEFAULT 'pending',
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
|
||||
Reference in new issue
Block a user