agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Pod securityContext / hardening customizer for Fabric8KubernetesPodRuntime

Offen
#1,767 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area/ext/integration enhancement
Vorherrschende Sprache
Java
Sterne
5.6k
Forks
1.3k
Ø Merge
4 T. 12 Std.
Gemergte PRs (30 T.)
77

Beschreibung

### 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.