实现示例type Vex = { cve: string; status: 'affected' | 'not_affected' | 'under_investigation' | 'fixed'; justification?: string; mitigations?: string[] } function validCve(id: string): boolean { const m = /^CVE-(\d{4})-(\d{4,})$/.exec(id); if (!m) return false; const y = parseInt(m[1],10); return y >= 1999 && y <= new Date().getFullYear() } function decide(v: Vex, policy: { allowIfNotAffected: boolean; allowIfMitigated: boolean }): 'block' | 'allow' { if (!validCve(v.cve)) return 'block' if (v.status === 'fixed') return 'allow' if (v.status === 'not_affected' && policy.allowIfNotAffected) return 'allow' if (v.status === 'affected' && policy.allowIfMitigated && v.mitigations && v.mitigations.length > 0) return 'allow' return 'block' } 审计与发布治理记录 VEX 状态、理由与缓解措施;不满足策略阻断发布并输出修复建议。VEX 变更需审批与归档。

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部