Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions kubernetes/code-interpreter/templates/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,30 @@ spec:
egress:
{{- toYaml . | nindent 4 }}
{{- end }}
---
# NetworkPolicy for ephemeral executor pods spawned by the code-interpreter.
# These pods run user-submitted code and must be fully network-isolated
# to prevent data exfiltration and SSRF attacks.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "code-interpreter.fullname" . }}-executor
labels:
{{- include "code-interpreter.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
app: code-interpreter
component: executor
policyTypes:
- Ingress
- Egress
ingress:
# Allow exec connections from the code-interpreter service pod
- from:
- podSelector:
matchLabels:
{{- include "code-interpreter.selectorLabels" . | nindent 14 }}
egress: []
# Deny all egress — executor pods must not have network access
{{- end }}
2 changes: 1 addition & 1 deletion kubernetes/code-interpreter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ readinessProbe:

# Network Policy
networkPolicy:
enabled: false
enabled: true
policyTypes:
- Ingress
- Egress
Expand Down
Loading