Giter VIP home page Giter VIP logo

Comments (4)

vito-laurenza-zocdoc avatar vito-laurenza-zocdoc commented on August 23, 2024

I've tried adding a PSP similar to the one the csi driver optionally installs, but that doesn't help either.

from secrets-store-csi-driver-provider-aws.

vito-laurenza-zocdoc avatar vito-laurenza-zocdoc commented on August 23, 2024
$ diff -u <(curl -sL https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/r1/deployment/aws-provider-installer.yaml) ./aws-provider-installer.yaml
--- /dev/fd/63	2021-05-21 15:33:29.000000000 -0400
+++ ./aws-provider-installer.yaml	2021-05-21 15:33:21.000000000 -0400
@@ -1,3 +1,4 @@
+# source: https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/r1/deployment/aws-provider-installer.yaml
 # https://kubernetes.io/docs/reference/access-authn-authz/rbac
 apiVersion: v1
 kind: ServiceAccount
@@ -22,6 +23,11 @@
 - apiGroups: [""]
   resources: ["nodes"]
   verbs: ["get"]
+- apiGroups: ['policy']
+  resources: ['podsecuritypolicies']
+  verbs: ['use']
+  resourceNames:
+  - csi-secrets-store-provider-aws-psp
 ---
 apiVersion: rbac.authorization.k8s.io/v1
 kind: ClusterRoleBinding
@@ -36,6 +42,36 @@
   name: csi-secrets-store-provider-aws
   namespace: kube-system
 ---
+apiVersion: policy/v1beta1
+kind: PodSecurityPolicy
+metadata:
+  labels:
+    app: csi-secrets-store-provider-aws
+  name: csi-secrets-store-provider-aws-psp
+  namespace: kube-system
+spec:
+  allowPrivilegeEscalation: true
+  fsGroup:
+    ranges:
+    - max: 65535
+      min: 1
+    rule: MustRunAs
+  hostPorts:
+  - max: 65535
+    min: 0
+  privileged: true
+  runAsUser:
+    rule: RunAsAny
+  seLinux:
+    rule: RunAsAny
+  supplementalGroups:
+    ranges:
+    - max: 65535
+      min: 1
+    rule: MustRunAs
+  volumes:
+  - hostPath
+---
 apiVersion: apps/v1
 kind: DaemonSet
 metadata:
@@ -77,6 +113,7 @@
         - name: providervol
           hostPath:
             path: "/etc/kubernetes/secrets-store-csi-providers"
+            type: DirectoryOrCreate
         - name: mountpoint-dir
           hostPath:
             path: /var/lib/kubelet/pods

from secrets-store-csi-driver-provider-aws.

vito-laurenza-zocdoc avatar vito-laurenza-zocdoc commented on August 23, 2024

I was able to make this work (selinux was denying access to create the socket).

I think having issue #15 solved will provide a simpler way for folks to get this working in their various environments.

--- /dev/fd/63	2021-05-24 15:36:18.000000000 -0400
+++ ./aws-provider-installer.yaml	2021-05-24 15:36:16.000000000 -0400
@@ -1,3 +1,4 @@
+# source: https://raw.githubusercontent.com/aws/secrets-store-csi-driver-provider-aws/r1/deployment/aws-provider-installer.yaml
 # https://kubernetes.io/docs/reference/access-authn-authz/rbac
 apiVersion: v1
 kind: ServiceAccount
@@ -22,6 +23,11 @@
 - apiGroups: [""]
   resources: ["nodes"]
   verbs: ["get"]
+- apiGroups: ['policy']
+  resources: ['podsecuritypolicies']
+  verbs: ['use']
+  resourceNames:
+  - csi-secrets-store-provider-aws-psp
 ---
 apiVersion: rbac.authorization.k8s.io/v1
 kind: ClusterRoleBinding
@@ -36,6 +42,36 @@
   name: csi-secrets-store-provider-aws
   namespace: kube-system
 ---
+apiVersion: policy/v1beta1
+kind: PodSecurityPolicy
+metadata:
+  labels:
+    app: csi-secrets-store-provider-aws
+  name: csi-secrets-store-provider-aws-psp
+  namespace: kube-system
+spec:
+  allowPrivilegeEscalation: true
+  fsGroup:
+    ranges:
+    - max: 65535
+      min: 1
+    rule: MustRunAs
+  hostPorts:
+  - max: 65535
+    min: 0
+  privileged: true
+  runAsUser:
+    rule: RunAsAny
+  seLinux:
+    rule: RunAsAny
+  supplementalGroups:
+    ranges:
+    - max: 65535
+      min: 1
+    rule: MustRunAs
+  volumes:
+  - hostPath
+---
 apiVersion: apps/v1
 kind: DaemonSet
 metadata:
@@ -54,6 +90,7 @@
       labels:
         app: csi-secrets-store-provider-aws
     spec:
+      priorityClassName: system-node-critical
       serviceAccountName: csi-secrets-store-provider-aws
       hostNetwork: true
       containers:
@@ -73,10 +110,13 @@
             - name: mountpoint-dir
               mountPath: /var/lib/kubelet/pods
               mountPropagation: HostToContainer
+          securityContext:
+            privileged: true
       volumes:
         - name: providervol
           hostPath:
             path: "/etc/kubernetes/secrets-store-csi-providers"
+            type: DirectoryOrCreate
         - name: mountpoint-dir
           hostPath:
             path: /var/lib/kubelet/pods

from secrets-store-csi-driver-provider-aws.

pierluigilenoci avatar pierluigilenoci commented on August 23, 2024

@vito-laurenza-zocdoc why did you close the ticket? For me, it was still a meaningful report.

from secrets-store-csi-driver-provider-aws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.