fix: Remove permissions that don't exist#2571
Open
mikebryant wants to merge 1 commit intosysdiglabs:mainfrom
Open
fix: Remove permissions that don't exist#2571mikebryant wants to merge 1 commit intosysdiglabs:mainfrom
mikebryant wants to merge 1 commit intosysdiglabs:mainfrom
Conversation
Contributor
|
Hi @mikebryant. Thanks for your PR. After inspecting your changes someone with write access to this repo needs |
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.
96ff1e0 to
23872c6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We're using ArgoCD Service Account Impersonation to deploy. This relies on Privilege escalation prevention
Currently I'm getting errors like:
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
feat(agent,node-analyzer,sysdig-deploy):)