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
2 changes: 2 additions & 0 deletions components/manifests/base/ambient-control-plane-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
value: "kube"
- name: LOG_LEVEL
value: "info"
- name: CP_TOKEN_URL
value: "http://ambient-control-plane.ambient-code.svc:8080/token"
- name: CP_RUNTIME_NAMESPACE
valueFrom:
fieldRef:
Expand Down
15 changes: 15 additions & 0 deletions components/manifests/base/ambient-control-plane-token-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: v1
kind: Service
metadata:
name: ambient-control-plane
labels:
app: ambient-control-plane
spec:
selector:
app: ambient-control-plane
ports:
- name: token
port: 8080
targetPort: 8080
protocol: TCP
Comment on lines +8 to +15
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Token service is exposed without a base ingress guard

This new Service exposes the token-minting endpoint, but base manifests do not add a matching NetworkPolicy. In clusters without default-deny, any pod in-namespace can hit :8080/token. Add a base policy limiting ingress to expected caller pods/namespaces (similar to components/manifests/overlays/mpp-openshift/ambient-cp-token-netpol.yaml).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/manifests/base/ambient-control-plane-token-svc.yaml` around lines
8 - 15, The Service defined in ambient-control-plane-token-svc.yaml exposes port
"token" (8080) without a matching NetworkPolicy, allowing any in-namespace pod
to call :8080/token; add a base NetworkPolicy (similar to
components/manifests/overlays/mpp-openshift/ambient-cp-token-netpol.yaml) that
targets the same backend pods (podSelector: matchLabels: app:
ambient-control-plane) and restricts ingress (policyTypes: ["Ingress"]) to only
the expected callers by using specific podSelector and/or namespaceSelector
rules (e.g., allow from pods with the caller label or a namespace with a known
label) so only authorized pods/namespaces can reach port 8080 (name: token).

1 change: 1 addition & 0 deletions components/manifests/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ resources:
- rbac
- platform
- ambient-control-plane-service.yml
- ambient-control-plane-token-svc.yaml

# Default images (can be overridden by overlays)
images:
Expand Down
Loading