Skip to main content

More Info:

Access to validating or mutating webhook configurations can be abused to escalate privileges or disrupt cluster operations. It should be limited to trusted administrators only.

Risk Level

High

Address

Security

Compliance Standards

  • CIS AKS

Triage and Remediation

Remediation

Manual Steps

  1. List all Roles/ClusterRoles with webhook configuration permissions
    Run on: any machine with kubectl access
  2. Inspect the exact permissions on each identified Role/ClusterRole
    Run on: any machine with kubectl access
    For each ClusterRole name from step 1:
    For each namespaced Role from step 1:
    Review rules for verbs like create, update, patch, or delete on validatingwebhookconfigurations or mutatingwebhookconfigurations. Flag any Role/ClusterRole not strictly needed for trusted cluster administration.
  3. Identify who is bound to these Roles/ClusterRoles
    Run on: any machine with kubectl access
    For each ClusterRole:
    For each Role:
    Then inspect each binding to see which users/groups/serviceaccounts have access:
  4. Decide required vs. unnecessary access
    • Classify each subject (user, group, serviceaccount) as:
      • Trusted administrator requiring webhook configuration management, or
      • Application/operator component needing only read access (if any), or
      • Unnecessary recipient of webhook configuration write access.
    • For non-admin components that must manage their own webhooks, prefer narrowly scoped Roles limited to their specific webhooks rather than broad cluster-wide permissions.
  5. Adjust RBAC to remove or narrow write access
    Run on: any machine with kubectl access
    a) To remove an unnecessary binding entirely:
    b) To narrow a Role/ClusterRole (e.g., drop write verbs or webhook resources), edit it:
    In the editor, remove create, update, patch, delete verbs or remove validatingwebhookconfigurations / mutatingwebhookconfigurations from resources for any non-admin use. Save to apply.
  6. Verify resulting access is limited to trusted administrators
    Run on: any machine with kubectl access
    Re-run the discovery and manually confirm bindings:
    For the remaining Roles/ClusterRoles, confirm via their RoleBindings/ClusterRoleBindings that only trusted administrator identities retain write access to webhook configuration objects.
What to look for
  • Output is a list of ClusterRole names.
  • Potential problems:
    • Generic or broad roles like cluster-admin (expected but high‑risk) and any custom roles with non-admin names (e.g. dev-team, ci-runner, viewer-plus) that appear here.
    • Any role clearly intended for application workloads, CI/CD, or non-ops users.

What to look for
  • Problematic if:
    • resources includes validatingwebhookconfigurations and verbs includes powerful verbs (create, update, patch, delete, deletecollection, or *).
    • apiGroups is admissionregistration.k8s.io with broad wildcard usage:
      • resources: ["*"] or verbs: ["*"].
  • Acceptable only for tightly controlled admin/cluster-operations roles.

What to look for
  • In most clusters, this should return no results.
  • Any Role here is suspicious, especially in application namespaces (e.g. default, dev, staging, prod).

What to look for
  • Same criteria as validating webhooks: strong verbs on mutatingwebhookconfigurations or wildcard rules in admissionregistration.k8s.io.

What to look for
  • Again, expected result is usually no Roles.
  • Any Role in non-admin namespaces indicates a likely problem.

What to look for
  • Problematic if:
    • ServiceAccounts used by apps/CI/CD pipelines are bound.
    • End-user groups (e.g. devs, qa, viewers) are bound.
  • Prefer only tightly controlled admin groups or ops service accounts.

What to look for
  • Any non-admin users or application service accounts bound to these Roles are likely misconfigured.

Interpreting problems overall
  • A finding exists when:
    • Any non-admin or broad/shared roles provide create, update, patch, delete, deletecollection, or * on:
      • validatingwebhookconfigurations
      • mutatingwebhookconfigurations
    • And those roles are bound to:
      • Application/CI service accounts,
      • General developer/QA/user groups,
      • Or any subjects beyond a small, trusted administrative set.
Deciding which roles/subjects must retain this access and how to scope or remove it is a policy decision and must be done manually.
Interpretation guidance (what indicates a problem):
  • Any Role/ClusterRole listed with:
    • RESOURCES including validatingwebhookconfigurations or mutatingwebhookconfigurations, and
    • VERBS including create, update, patch, or delete
  • Especially problematic if the associated (Cluster)RoleBindings show:
    • system:authenticated, system:serviceaccounts, or broad groups rather than a small set of named admin users/groups.
  • Acceptable patterns typically:
    • Are limited to a small, clearly-admin ClusterRole (e.g. cluster-admin in some environments) bound only to a trusted admin group, or
    • Are used by tightly-controlled CI/CD or operator service accounts with a justified need.