Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
charts: run the sam pods under the restricted Pod Security Standard
Tomas Tormoca94afaa8dac
diff --git a/charts/sam-mesh/templates/bootstrap-job.yaml b/charts/sam-mesh/templates/bootstrap-job.yamlindex e93e06ad..00a9da80 100644--- a/charts/sam-mesh/templates/bootstrap-job.yaml+++ b/charts/sam-mesh/templates/bootstrap-job.yaml@@ -49,10 +49,20 @@ spec:spec:serviceAccountName: {{ include "sam-mesh.fullname" . }}-bootstrap-sarestartPolicy: OnFailure+ securityContext:+ runAsNonRoot: true+ # curlimages/curl's USER is non-numeric; runAsNonRoot needs an explicit uid.+ runAsUser: 100+ seccompProfile:+ type: RuntimeDefaultcontainers:- name: bootstrapimage: curlimages/curl:8.6.0imagePullPolicy: {{ .Values.global.imagePullPolicy }}+ securityContext:+ allowPrivilegeEscalation: false+ capabilities:+ drop: ["ALL"]env:- name: NAMESPACEvalue: {{ .Release.Namespace | quote }}diff --git a/charts/sam-mesh/templates/console-deployment.yaml b/charts/sam-mesh/templates/console-deployment.yamlindex c3f22ce3..c65abf42 100644--- a/charts/sam-mesh/templates/console-deployment.yaml+++ b/charts/sam-mesh/templates/console-deployment.yaml@@ -15,10 +15,20 @@ spec:labels:app: {{ include "sam-mesh.fullname" . }}-consolespec:+ {{- with .Values.console.podSecurityContext }}+ securityContext:+ {{- toYaml . | nindent 8 }}+ {{- end }}initContainers:- name: wait-control-planeimage: curlimages/curl:8.6.0imagePullPolicy: {{ .Values.global.imagePullPolicy }}+ securityContext:+ # curlimages/curl's USER is non-numeric; runAsNonRoot needs an explicit uid.+ runAsUser: 100+ allowPrivilegeEscalation: false+ capabilities:+ drop: ["ALL"]command: ["/bin/sh", "-c"]args:- |@@ -32,6 +42,10 @@ spec:- name: sam-consoleimage: "{{ .Values.console.image.repository }}:{{ .Values.global.imageTag }}"imagePullPolicy: {{ .Values.global.imagePullPolicy }}+ {{- with .Values.console.securityContext }}+ securityContext:+ {{- toYaml . | nindent 10 }}+ {{- end }}env:- name: SAM_ADMIN_TOKENvalueFrom:diff --git a/charts/sam-mesh/templates/control-plane-deployment.yaml b/charts/sam-mesh/templates/control-plane-deployment.yamlindex 9897cc55..8c22c40a 100644--- a/charts/sam-mesh/templates/control-plane-deployment.yaml+++ b/charts/sam-mesh/templates/control-plane-deployment.yaml@@ -14,10 +14,18 @@ spec:labels:app: {{ include "sam-mesh.fullname" . }}-control-planespec:+ {{- with .Values.controlPlane.podSecurityContext }}+ securityContext:+ {{- toYaml . | nindent 8 }}+ {{- end }}containers:- name: sam-control-planeimage: "{{ .Values.controlPlane.image.repository }}:{{ .Values.global.imageTag }}"imagePullPolicy: {{ .Values.global.imagePullPolicy }}+ {{- with .Values.controlPlane.securityContext }}+ securityContext:+ {{- toYaml . | nindent 10 }}+ {{- end }}env:- name: DB_PASSWORDvalueFrom:diff --git a/charts/sam-mesh/templates/router-statefulset.yaml b/charts/sam-mesh/templates/router-statefulset.yamlindex f07b0fd4..c32c9ee1 100644--- a/charts/sam-mesh/templates/router-statefulset.yaml+++ b/charts/sam-mesh/templates/router-statefulset.yaml@@ -36,6 +36,12 @@ spec:- name: wait-control-planeimage: curlimages/curl:8.6.0imagePullPolicy: {{ .Values.global.imagePullPolicy }}+ securityContext:+ # curlimages/curl's USER is non-numeric; runAsNonRoot needs an explicit uid.+ runAsUser: 100+ allowPrivilegeEscalation: false+ capabilities:+ drop: ["ALL"]command: ["/bin/sh", "-c"]args:- |@@ -49,6 +55,10 @@ spec:- name: sam-routerimage: "{{ .Values.router.image.repository }}:{{ .Values.global.imageTag }}"imagePullPolicy: {{ .Values.global.imagePullPolicy }}+ {{- with .Values.router.securityContext }}+ securityContext:+ {{- toYaml . | nindent 10 }}+ {{- end }}ports:- containerPort: 4501name: p2p-tcpdiff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yamlindex 33e6217e..4b3a2db1 100644--- a/charts/sam-mesh/values.yaml+++ b/charts/sam-mesh/values.yaml@@ -45,6 +45,17 @@ controlPlane:# (comma-separated for more than one); the control plane refuses to start without one.oidcIssuer: ""allowedAudiences: "sam-mesh-audience,sam-control-plane-audience"+ podSecurityContext:+ runAsNonRoot: true+ # Dockerfiles say "USER nonroot" by name; runAsNonRoot needs the numeric uid.+ runAsUser: 65532+ runAsGroup: 65532+ seccompProfile:+ type: RuntimeDefault+ securityContext:+ allowPrivilegeEscalation: false+ capabilities:+ drop: ["ALL"]resources:requests:cpu: 100m@@ -84,8 +95,18 @@ router:enabled: truereplicaCount: 1podSecurityContext:+ runAsNonRoot: true+ # Dockerfiles say "USER nonroot" by name; runAsNonRoot needs the numeric uid.+ runAsUser: 65532+ runAsGroup: 65532+ seccompProfile:+ type: RuntimeDefaultfsGroup: 65532fsGroupChangePolicy: "OnRootMismatch"+ securityContext:+ allowPrivilegeEscalation: false+ capabilities:+ drop: ["ALL"]image:repository: sam-routeruseOidcToken: false@@ -113,6 +134,17 @@ console:replicaCount: 1image:repository: sam-console+ podSecurityContext:+ runAsNonRoot: true+ # Dockerfiles say "USER nonroot" by name; runAsNonRoot needs the numeric uid.+ runAsUser: 65532+ runAsGroup: 65532+ seccompProfile:+ type: RuntimeDefault+ securityContext:+ allowPrivilegeEscalation: false+ capabilities:+ drop: ["ALL"]resources:requests:cpu: 50m