Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review and Restrict Kubernetes Resource Permissions #129

Open
amanpruthi opened this issue May 20, 2024 · 0 comments
Open

Review and Restrict Kubernetes Resource Permissions #129

amanpruthi opened this issue May 20, 2024 · 0 comments
Assignees

Comments

@amanpruthi
Copy link
Contributor

We have received concerns regarding the breadth of permissions granted to certain Kubernetes resources within our clusters. To enhance security and ensure the principle of least privilege, we need to evaluate and adjust these permissions to be strictly necessary for the operational requirements of our applications.

Objectives:

  • Audit Current Permissions: Conduct a thorough review of all Kubernetes resources to identify and document current permissions in the github issue.
  • Define Necessary Permissions: Establish the minimal permissions required for each resource to function effectively.
  • Implement Namespace Scoping: Where applicable, adjust permissions to limit their scope to specific namespaces, reducing the potential impact of compromised resources.
  • Update Documentation: Ensure that all changes and the rationale behind permissions levels are well-documented.

Outcomes

he permissions of Kubernetes resources will be minimized to what is essential for their operation, enhancing our cluster's security posture. Namespace-specific scoping will be applied where beneficial, providing an additional layer of containment and control.

Examples:

{{- if .Values.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: {{ include "console.fullname" . }}
  namespace: {{ $.Release.Namespace }}
  labels:
    {{- include "wandb.commonLabels" . | nindent 4 }}
    {{- include "console.commonLabels" . | nindent 4 }}
    {{- include "console.labels" . | nindent 4 }}
    {{- if .Values.clusterRole.labels -}}
    {{-   toYaml .Values.clusterRole.labels | nindent 4 }}
    {{- end }}
  annotations:
    {{- if .Values.clusterRole.annotations -}}
    {{-   toYaml .Values.clusterRole.annotations | nindent 4 }}
    {{- end }}
rules:
  # We can scope these permissions down later
  - apiGroups: ["*"]
    resources: ["*"]
    verbs: ["*"]
{{- end }}
clusterRole:
  rules:
    - apiGroups: ["*"]
      resources: ["*"]
      verbs: ["*"]
  • Can we maybe parameterize these permissions so we can scope them to specfic namespace

Operator

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 a pull request may close this issue.

2 participants