rbacaudit

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "rbac-audit"

Name is the registry key for this scanner.

Variables

This section is empty.

Functions

func NewScanner

func NewScanner() scanner.Scanner

NewScanner returns a scanner that audits RBAC for over-permissive configurations. Counters increment per binding (not per subject) so a single binding with N subjects no longer inflates the total by a factor of N.

Types

type Data

type Data struct {
	// WildcardRules is the number of RBAC rules using "*" for resources, verbs, or apiGroups.
	WildcardRules int `json:"wildcard_rules"`
	// ClusterAdminBindings is the number of bindings to the cluster-admin role by non-system principals.
	ClusterAdminBindings int `json:"cluster_admin_bindings"`
	// DefaultSABindings is the number of bindings that grant permissions to a "default" service account.
	DefaultSABindings int `json:"default_sa_bindings"`
	// AutomountTokenPods is the number of pods with automounted service account tokens.
	AutomountTokenPods int `json:"automount_token_pods"`
	// RoleBindingsAudited is the number of namespaced RoleBindings audited.
	RoleBindingsAudited int `json:"role_bindings_audited"`
	// RiskBindings lists the most concerning bindings.
	RiskBindings []RiskBinding `json:"risk_bindings"`
}

Data holds RBAC audit results for one cluster.

type RiskBinding

type RiskBinding struct {
	// Kind is ClusterRoleBinding or RoleBinding.
	Kind string `json:"kind"`
	// Name is the binding name.
	Name string `json:"name"`
	// Namespace is empty for cluster-scoped bindings.
	Namespace string `json:"namespace,omitempty"`
	// RoleRef is the role being bound.
	RoleRef string `json:"role_ref"`
	// Subjects describes who gets the permissions.
	Subjects []string `json:"subjects"`
	// Risks lists the specific concerns.
	Risks []string `json:"risks"`
}

RiskBinding describes a ClusterRoleBinding or RoleBinding with concerning permissions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL