Skip to content

fix: Remove permissions that don't exist#2571

Open
mikebryant wants to merge 1 commit intosysdiglabs:mainfrom
mikebryant:m/remove-nonsensical-permissions
Open

fix: Remove permissions that don't exist#2571
mikebryant wants to merge 1 commit intosysdiglabs:mainfrom
mikebryant:m/remove-nonsensical-permissions

Conversation

@mikebryant
Copy link
Copy Markdown
Contributor

We're using ArgoCD Service Account Impersonation to deploy. This relies on Privilege escalation prevention

Currently I'm getting errors like:

clusterroles.rbac.authorization.k8s.io "shield-cluster" is forbidden: user "system:serviceaccount:security-system:argocd-deployer" (groups=["system:serviceaccounts" "system:serviceaccounts:security-system" "system:authenticated"]) is attempting to grant RBAC permissions not currently held:
{APIGroups:[""], Resources:["clusterrolebindings"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["clusterroles"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["clusterversions"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["controllerrevisions"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["cronjobs"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["daemonsets"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["deployments"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["horizontalpodautoscalers"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["ingressclasses"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["ingresses"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["jobs"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["networkpolicies"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["pods"], Verbs:["delete"]}
{APIGroups:[""], Resources:["podsecuritypolicies"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["replicasets"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["rolebindings"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["roles"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["secrets"], Verbs:["get" "list" "watch" "get" "list" "watch" "get" "get" "list" "watch"]}
{APIGroups:[""], Resources:["statefulsets"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["storageclasses"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["volumeattachments"], Verbs:["get" "list" "watch"]}
...many more

This appears to be because the ClusterRoles are misconfigured to reference lots of permissions that do not actually exist.

This PR cleans those up by using the correct api groups to reference them.

In addition it removes some "*" grants, as per least-privilege best practice.

What this PR does / why we need it:

Checklist

  • Title of the PR starts with type and scope, (e.g. feat(agent,node-analyzer,sysdig-deploy):)
  • Chart Version bumped for the respective charts
  • Variables are documented in the README.md (or README.tpl in some charts)
  • Check GithubAction checks (like lint) to avoid merge-check stoppers
  • All test files are added in the tests folder of their respective chart and have a "_test" suffix

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

Hi @mikebryant. Thanks for your PR.

After inspecting your changes someone with write access to this repo needs
to approve and run the workflow.

We're using ArgoCD Service Account Impersonation to deploy. This relies on [Privilege escalation prevention](https://kubernetes.io/docs/reference/access-authn-authz/rbac/#privilege-escalation-prevention-and-bootstrapping)

Currently I'm getting errors like:
```
clusterroles.rbac.authorization.k8s.io "shield-cluster" is forbidden: user "system:serviceaccount:security-system:argocd-deployer" (groups=["system:serviceaccounts" "system:serviceaccounts:security-system" "system:authenticated"]) is attempting to grant RBAC permissions not currently held:
{APIGroups:[""], Resources:["clusterrolebindings"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["clusterroles"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["clusterversions"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["controllerrevisions"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["cronjobs"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["daemonsets"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["deployments"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["horizontalpodautoscalers"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["ingressclasses"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["ingresses"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["jobs"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["networkpolicies"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["pods"], Verbs:["delete"]}
{APIGroups:[""], Resources:["podsecuritypolicies"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["replicasets"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["rolebindings"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["roles"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["secrets"], Verbs:["get" "list" "watch" "get" "list" "watch" "get" "get" "list" "watch"]}
{APIGroups:[""], Resources:["statefulsets"], Verbs:["get" "list" "watch" "get" "list" "watch"]}
{APIGroups:[""], Resources:["storageclasses"], Verbs:["get" "list" "watch"]}
{APIGroups:[""], Resources:["volumeattachments"], Verbs:["get" "list" "watch"]}
...many more
```

This appears to be because the ClusterRoles are misconfigured to reference lots of permissions that do not actually exist.

This PR cleans those up by using the correct api groups to reference them.

In addition it removes some "*" grants, as per least-privilege best practice.
@mikebryant mikebryant force-pushed the m/remove-nonsensical-permissions branch from 96ff1e0 to 23872c6 Compare April 2, 2026 15:47
@mikebryant mikebryant marked this pull request as ready for review April 2, 2026 15:47
@mikebryant mikebryant requested a review from a team as a code owner April 2, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant