百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

rbac-police

> 数据库
开源

通过使用 Rego 编写的策略评估 Kubernetes 身份的 RBAC 权限

353 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

通过使用 Rego 编写的策略评估 Kubernetes 身份的 RBAC 权限

rbac-police

Retrieve the RBAC permissions of Kubernetes identities - service accounts, pods, nodes, users and groups - and evaluate them using policies written in Rego.

The policy library includes over 20 policies that detect identities possessing risky permissions, each alerting on a different attack path.

Quick Start

  1. Clone the repository:

    bash
    git clone https://github.com/PaloAltoNetworks/rbac-police && cd rbac-police
  2. Either install rbac-police from a release:

    bash
    OS=linux  # OS=darwin
    ARCH=amd64  # ARCH=arm64
    LATEST_TAG=$(curl -s https://api.github.com/repos/PaloAltoNetworks/rbac-police/releases/latest | jq -r '.tag_name')
    curl -L -o rbac-police "https://github.com/PaloAltoNetworks/rbac-police/releases/download/${LATEST_TAG}/rbac-police_${LATEST_TAG}_${OS}_${ARCH}" && chmod +x rbac-police

    Or build it with Golang>=1.16:

    bash
    go build
  3. Connect kubectl to a Kubernetes cluster.

  4. Evaluate RBAC permissions and identify privilege escalation paths in your cluster using the default policy library:

    ./rbac-police eval lib/
  5. Inspect the permissions of violating principals and identify the Roles and ClusterRoles granting them risky privileges. See the Recommendations section here for remediation advice.

    ./rbac-police expand -z sa=production-ns:violating-sa

Usage

Set severity threshold

Only evaluate policies with a severity equal to or higher than a threshold.

./rbac-police eval lib/ -s High

Inspect the permissions of specific identities

./rbac-police expand -z sa=kube-system:metrics-server
./rbac-police expand -z [email protected]
./rbac-police expand # all identities

Discover protections

Improve accuracy by considering features gates and admission controllers that can protect against certain attacks. Note that NodeRestriction is identified by impersonating a node and dry-run creating a pod, which may be logged by some systems.

./rbac-police eval lib/ -w

Configure violation types

Control which identities are evaluated for violations, default are sa,node,combined (see policies.md for more information).

./rbac-police eval lib/ --violations sa,user
./rbac-police eval lib/ --violations all # sa,node,combined,user,group

Note that by default, rbac-police only looks into service accounts assigned to a pod. Use -a to include all service accounts.

Scope to a namespace

Only look into service accounts and pods from a certain namespace.

./rbac-police eval lib/ -n production

Only SAs that exist on all nodes

Only alert on service accounts that exist on all nodes. Useful for identifying violating DaemonSets.

./rbac-police eval lib/ --only-sas-on-all-nodes

Ignore control plane

Ignore control plane pods and nodes in clusters that host the control plane.

./rbac-police eval lib/ --ignore-controlplane

Collect once for multiple evaluations

./rbac-police collect -o rbacDb.json

./rbac-police eval lib/ rbacDb.json -s High
./rbac-police eval lib/ rbacDb.json -s Medium --only-sas-on-all-nodes
./rbac-police expand rbacDb.json -z sa=ns:violating-sa

Documentation

  • Policies
  • Eval command
  • Collect command
  • Expand command

Media Mentions

Radiohead:

rbac-police, I've given all I can. It's not enough...

N.W.A:

rbac-police comin' straight from the underground!

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gokuberneteskubernetes-rbackubernetes-securityprisma-cloud

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库