跳转至主要内容

Super Administrator

超级管理员(例如 root)是绕过常规策略、总是被允许的主体。在 匹配器 中加上 r.sub == "root" 这样的条件即可实现。示例:

[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

[policy_effect]
e = some(where (p.eft == allow))

[matchers]
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act || r.sub == "root"

当 (1) 匹配某条策略规则,或 (2) r.sub == "root" 时,匹配器允许请求。所以 root 永远不会被拒绝。同样的做法适用于 RBAC、ABAC 或带域的 RBAC:在匹配器中加上 || r.sub == "root"(或你的超级用户名)。

Comments are powered by giscus and GitHub Discussions. They load from giscus.app and GitHub only after you click the button below.