unbridled-41 opened a new issue, #4281:
URL: https://github.com/apache/rocketmq-dashboard/issues/4281

   ## Problem / Evidence
   
   `GET /api/k8s-certs`(`K8sCertController.listCerts` → 
`K8sCertService.listCerts`)对**任意已认证用户(包括 reader 角色)**返回每张证书的 `keyPem`(TLS 私钥 
PEM):
   
   - `AuthInterceptor.requiresAdmin` 对 GET 放行除 `isAdminOnlyGetPath` 
白名单外的全部路径;`/api/k8s-certs` 不在白名单内。该白名单的注释写明设计意图是"Read endpoints stay open to 
readers, except credential views that expose 
secrets"——同类密钥回显端点(`/api/acl/users/{id}/credentials`、`/api/cloud-credentials/{id}/credentials`)都被管理员门控。
   - 证书页前端对私钥字段的说明是"仅保存,不会在页面展示或返回"(`web/src/pages/cluster/certs.tsx` 私钥表单项 
extra 文案),列表渲染也不读取 `keyPem`——响应中携带私钥是纯暴露。
   - `K8sCertService.listCerts` 直接返回 `refreshExpirationState` 映射结果,包含存储的 
`keyPem`(create/update 响应也带,但那两个 POST 是管理员专用;GET 列表才是读者可达面)。
   
   回归测试(先红):`K8sCertServiceTest.listCertsShouldNotExposeTheStoredPrivateKey` 
在未修复代码上失败(keyPem 非 null)。
   
   ## Impact
   
   持有 reader 角色的账号可通过一次 GET 枚举全部 K8s 证书私钥(集群 TLS 凭据),无审计事件;与拦截器自身声明的密钥门控策略不一致。
   
   ## Expected behavior
   
   证书清单接口不应回传私钥 PEM;私钥仅由 create/update(管理员专用 POST)写入。
   
   ## Related work
   
   - `AuthInterceptor.isAdminOnlyGetPath` 对 
`/api/acl/users/`、`/api/cloud-credentials/` 两类凭据回显路径的管理员门控(同一意图的既有实现)。
   - #3399(开放)处理 ACL 明文密钥日志泄漏——同属密钥暴露面,但载体与端点不同。
   
   ## PR
   
   Fix incoming.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to