rbac

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package rbac is the engine module wrapper around internal/rbac. It projects identity/RBAC risks (over-permissive roles, exposed tokens, privilege- escalation paths, docker-group/socket exposure) into the unified Finding model. The heavy analysis lives in internal/rbac; this file only adapts the Risk values onto engine.Finding and wires the optional NHI feature to a target metadata flag so it stays off by default.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(args []string) int

Command runs `dsecrat rbac <path> [flags]`. It returns a process exit code: 0 success, 2 usage error, 1 analysis error.

func Register

func Register(r *engine.Registry)

Register adds the RBAC module to the registry. The master agent calls this from modules.Default() during integration, so this package never edits the shared registry file (parallel-safe wiring — see SHARED_CONTRACT §2).

Types

type Module

type Module struct{}

Module is the identity/RBAC analysis capability (CAPABILITY_SPEC domain 15, plus the Docker-side identity surface).

func New

func New() *Module

New returns an RBAC module.

func (*Module) Analyze

func (m *Module) Analyze(_ context.Context, t *engine.Target) ([]engine.Finding, error)

Analyze loads the cluster from the target, runs the analysis, and projects each Risk onto a Finding. When the target holds no RBAC objects, it returns nothing so generic filesystem scans stay quiet.

func (*Module) Description

func (m *Module) Description() string

func (*Module) Domains

func (m *Module) Domains() []string

func (*Module) Name

func (m *Module) Name() string

func (*Module) Supports

func (m *Module) Supports(t engine.TargetType) bool

Supports handles filesystem targets: a directory or file of Kubernetes RBAC JSON (and our DockerHost descriptor). There is no dedicated k8s/config target type yet — see NOTES.md for the proposed engine change; until then a filesystem target is the carrier, and non-RBAC inputs produce no findings.

Jump to

Keyboard shortcuts

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