Skip to content

lookout audit rbac

RBAC over-permission posture: bindings that grant cluster-admin, or a role whose rules are cluster-admin under another name, and Roles/ClusterRoles whose rules use * for verbs or resources. Judges a binding by the rules of the role it points at, not by the role’s name. Objects the platform reconciles (the bootstrap defaults, addon-manager Reconcile objects) are counted, not reported. —namespace judges that namespace’s Roles and RoleBindings; ClusterRoles and ClusterRoleBindings are judged under -A. scanned counts bindings and roles examined.

MCP tool: k8s_audit_rbac (MCP profile: audit)

Terminal window
lookout audit rbac [flags]
FlagTypeDefaultMeaning
--skip-system-namespacesbool—skip system namespaces matching the active posture policy’s system_namespaces patterns
--per-workloadbool—emit one finding per affected workload instead of one summary finding per holder object
--policystring—path to a YAML posture policy file
--profilestring—built-in posture profile: default|strict|onboarding|gke-autopilot
--onlystring—comma-separated check kind or kind/reason globs to run exclusively
--skipstring—comma-separated check kind or kind/reason globs to skip
--min-severitystring—minimum finding severity to emit: info|warning|critical
--setstring—comma-separated check parameter overrides (<kind>.<param>=<val>)
FlagTypeDefaultMeaning
--namespacestring—limit the scan to one namespace
-Abool—scan all namespaces
--workloadstring—target one workload as <Kind>/<namespace>/<name>, e.g. Deployment/prod/api
--sinceduration—how far back to look (0 = command default)
--formatstringlogfmtoutput format: logfmt|json (one record per line either way)
--timeoutduration10sabort the invocation after this long (exit 1)
--kubeconfigstring—path to a kubeconfig file, instead of $KUBECONFIG / ~/.kube/config
--kubeconfig-dirstring—directory of kubeconfig files to fan out across (mutually exclusive with —kubeconfig); each finding is stamped with cluster=<label> and the summary reports clusters=<n>
--contextstring—kubeconfig context to read, instead of its current-context. Selects a cluster for THIS invocation only — nothing is written back — so concurrent invocations can target different clusters. Reported as context=<name> in the summary line
--contextsstring—comma-separated kubeconfig contexts to fan out across, or ’*’ for every context in the selected kubeconfig(s) (mutually exclusive with —context); each finding is stamped with cluster=<label> and the summary reports clusters=<n>
--concurrencyint4maximum concurrent cluster executions when fanning out with —contexts or —kubeconfig-dir
--google-authstring—how Google Cloud and GKE DNS requests authenticate: auto (default: honors LOOKOUT_GOOGLE_AUTH, CORE_AGENT_GOOGLE_AUTH, MAST_GOOGLE_AUTH), adc, or injected (static placeholder bearer token, zero GCE metadata lookups)
--exemptionsstring—path to a git-reviewed exemption file (YAML); covered findings are ANNOTATED with their reason and expiry and counted as exempt=<n> in the summary, never dropped

Every kind= this command can emit, and the severities it carries them at. Nothing else appears in its output; a kind absent from a run means the check looked and found nothing. See the finding-kind glossary for the whole vocabulary.

KindSeverityClaim
audit.cluster_admin_bindingwarning, infothe binding grants a full-wildcard role (cluster-admin, or one with the same rule) to its subjects; warning for a ClusterRoleBinding, info for a RoleBinding, which confines it to one namespace
audit.wildcard_rbacwarning, infothe role has a rule using * for verbs or resources; warning for a full wildcard that something binds, info for an unbound one and for the narrower wildcards
audit.exec_attach_grantwarning, infothe binding grants pods/exec, pods/attach, or pods/portforward to its subjects; warning for exec or attach, info for portforward
audit.impersonate_escalate_grantwarningthe binding grants impersonate on identities or bind/escalate on RBAC roles to its subjects
read.unavailableinfoa resource this command reads was refused (RBAC forbidden, e.g. Nodes, Secrets or RBAC objects under the built-in view role) or is not served, so the checks that need it did not run and their silence is not a clean bill; everything else was still verified. The message names the refused verb and resource, whether it is cluster-scoped, whether the built-in view role grants it, and the grant that fixes it; resource= carries the refused resource as resource[.group] — an explicit degradation record, never silence

Beyond the shared envelope fields (kind, severity, namespace, kind_of_object, name, reason, message, fingerprint, exempt_reason, exempt_expires):

FieldMeaning
rolethe role the binding points at, as Kind/name
subjectssubjects the binding grants the role to
subject_namesthose subjects as Kind:name (ServiceAccounts as ServiceAccount:namespace/name), sorted and capped at 8
rulesrules in the role, aggregated or not
wildcard_rulesrules in the role that use * for verbs or resources
verbsthe verbs of the broadest wildcard rule, comma-joined
resourcesthe resources of the broadest wildcard rule, comma-joined
api_groupsthe apiGroups of the broadest wildcard rule, comma-joined, with the core group written as core
bindingsRoleBindings and ClusterRoleBindings pointing at the role; 0 means it grants nothing today
workloadsworkloads in scope running as a bound ServiceAccount subject; omitted when no running workload uses the bound ServiceAccount
workload_namestheir Kind/name, sorted and capped at 8
platform_managedsummary note: bindings and roles left out because the platform reconciles them (kubernetes.io/bootstrapping=rbac-defaults, or addonmanager.kubernetes.io/mode=Reconcile)
aggregated_rolessummary note: aggregated ClusterRoles left out of audit.wildcard_rbac, whose rules come from the roles that are judged; omitted when there are none or ClusterRoles are out of scope
skipped_system_namespacessummary note: distinct system namespaces skipped under --skip-system-namespaces
resourceread.unavailable: the resource that could not be read, as resource[.group]

Output: one finding per line (logfmt; —format=json for one JSON object per line), keys in fixed order; healthy resources emit nothing. The final line is always the summary: scanned= findings= elapsed= — findings=0 with a summary present means “scanned and healthy”; a stream without a summary line is void. Exit 0 data, 1 runtime error (diagnostics on stderr only), 2 usage.

Terminal window
lookout audit rbac -A
lookout audit rbac --namespace=prod
lookout audit rbac -A --exemptions=exemptions.yaml --format=json