实现示例type Ref = { host: string; namespace: string; name: string; tag: string } const allowHosts = new Set<string>(['gcr.io','us-docker.pkg.dev','*.ecr.amazonaws.com','azurecr.io']) function hostAllowed(h: string): boolean { if (allowHosts.has(h)) return true; if (/\.ecr\.amazonaws\.com$/.test(h)) return true; return false } function validRef(r: Ref): boolean { return hostAllowed(r.host) && !!r.namespace && !!r.name && !!r.tag } 审计与运行治理审计来源主机与命名空间;异常阻断并输出修复建议。白名单变更需审批与归档。

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部
1.932818s