agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Pod securityContext / hardening customizer for Fabric8KubernetesPodRuntime

Aperta
#1,767 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area/ext/integration enhancement
Lingua principale
Java
Stelle
5.6k
Fork
1.3k
Merge medio
4g 12h
PR unite (30g)
77

Descrizione

### Summary

`Fabric8KubernetesPodRuntime.createPod()` provides no way to set a pod/container `securityContext`. For untrusted code-execution sandboxes this blocks standard pod hardening.

### Details

`createPod()` builds `PodSpecBuilder` + `ContainerBuilder` with restartPolicy, image, command/args, resource requests, bind-mounts, nodeSelector and serviceAccount — but there is no hook, `Consumer`, or option to set any of:
- `runAsUser` / `runAsNonRoot` / `fsGroup`
- `readOnlyRootFilesystem`
- `capabilities.drop` (e.g. `ALL`)
- `allowPrivilegeEscalation`
- `seccompProfile` (e.g. `RuntimeDefault`)
- `automountServiceAccountToken: false`

`KubernetesSandboxClientOptions` has no security-context fields either (namespace, image, containerName, workspaceRoot, serviceAccount, nodeSelector, podLabels, cpu/memoryRequest). #1713 (env injection) adds an env map at the same insertion points but does not touch `securityContext`.

### Request

Add a customizer so callers can inject a hardened security posture, e.g.:
- `Consumer` + `Consumer` hooks on the runtime, **or**
- explicit security fields on `KubernetesSandboxClientOptions` (runAsNonRoot, runAsUser, readOnlyRootFilesystem, dropCapabilities, seccompProfile, automountServiceAccountToken, ...).

Same `createPod()` insertion points as #1713. Happy to contribute the PR if the API shape is agreed.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.