Skip to content

Agent Mesh

charts: make sam:role:node's allowed services configurable

Tomas Tormoe9a7af49ef90
diff --git a/charts/sam-mesh/templates/bootstrap-job.yaml b/charts/sam-mesh/templates/bootstrap-job.yaml
index b49f3238..e93e06ad 100644
--- a/charts/sam-mesh/templates/bootstrap-job.yaml
+++ b/charts/sam-mesh/templates/bootstrap-job.yaml
@@ -81,9 +81,8 @@ spec:
{{- $bindings := .Values.bootstrap.bindings -}}
{{- if not $bindings -}}
{{- $defaultRouterSA := printf "user:system:serviceaccount:%s:%s-router-sa" .Release.Namespace (include "sam-mesh.fullname" .) -}}
- {{- $bindings = list
+ {{- $bindings = list
(dict "role" "sam:role:router" "members" (list "group:routers" $defaultRouterSA))
- (dict "role" "sam-admin" "members" (list (printf "user:system:serviceaccount:%s:node-a-sa" .Release.Namespace) (printf "user:system:serviceaccount:%s:node-b-sa" .Release.Namespace) (printf "user:system:serviceaccount:%s:node-c-sa" .Release.Namespace) (printf "user:system:serviceaccount:%s:local-node-sa" .Release.Namespace)))
(dict "role" "sam:role:sambox" "members" (list (printf "user:system:serviceaccount:%s:sam-box-sa" .Release.Namespace)))
(dict "role" "sam:role:node" "members" (list "group:data-scientist" "group:users"))
-}}
@@ -96,7 +95,7 @@ spec:
{"name": "sam-admin", "allowed_services": ["*"], "allowed_targets": ["*"]},
{"name": "sam:role:sambox", "allowed_services": ["*"], "allowed_targets": ["*"]},
{"name": "sam:role:router", "allowed_services": ["*"], "allowed_targets": ["*"]},
- {"name": "sam:role:node", "allowed_services": ["mcp://calculator", "mcp://db-agent", "mcp://http-tool", "mcp://stdio-tool", "system://sam.catalog"], "allowed_targets": ["*"]}
+ {"name": "sam:role:node", "allowed_services": {{ toJson .Values.bootstrap.nodeServices }}, "allowed_targets": ["*"]}
],
"bindings": {{ toJson $bindings }}
}' \
diff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yaml
index dc54b6a2..2b0c2884 100644
--- a/charts/sam-mesh/values.yaml
+++ b/charts/sam-mesh/values.yaml
@@ -112,4 +112,6 @@ dex:
bootstrap:
bindings: []
+ # Services sam:role:node may call
+ nodeServices: ["*"]
diff --git a/development/examples/calc-mcp/sam-node-config.yaml b/development/examples/calc-mcp/sam-node-config.yaml
index fad29c57..1abd60e8 100644
--- a/development/examples/calc-mcp/sam-node-config.yaml
+++ b/development/examples/calc-mcp/sam-node-config.yaml
@@ -1,8 +1,6 @@
version: "v1alpha1"
attenuation:
- # Allow cross-node MCP only when the caller's biscuit carries a
- # node($peer) fact — i.e. it was issued by our control plane upon enrollment.
- policies:
+ policies: []
services:
- type: "mcp"
name: "calculator"
diff --git a/development/examples/everything-mcp/sam-node-config.yaml b/development/examples/everything-mcp/sam-node-config.yaml
index af7e33f7..3107e5df 100644
--- a/development/examples/everything-mcp/sam-node-config.yaml
+++ b/development/examples/everything-mcp/sam-node-config.yaml
@@ -1,8 +1,6 @@
version: "v1alpha1"
attenuation:
- policies:
- - 'allow if service("mcp", "everything");'
- - 'allow if service("system", "sam.catalog");'
+ policies: []
services:
- type: "mcp"
name: "everything"
diff --git a/development/examples/greeter-mcp/sam-node-config.yaml b/development/examples/greeter-mcp/sam-node-config.yaml
index 4b52f7b2..12722585 100644
--- a/development/examples/greeter-mcp/sam-node-config.yaml
+++ b/development/examples/greeter-mcp/sam-node-config.yaml
@@ -1,6 +1,6 @@
version: "v1alpha1"
attenuation:
- policies:
+ policies: []
services:
- type: "mcp"
name: "greeter"