Agent Mesh
Go a2aa2a-protocolagent-meshagentic-aiinferencemcpmeshmesh-networknetwork-securitynetworking-aip2p-network
chore: fix another instance of deny if in rules block in policy.md
Antonio Ojeaf6cc7b96a4b3
diff --git a/cmd/sam-hub/biscuit.go b/cmd/sam-hub/biscuit.goindex 49b368bd..a3204d24 100644--- a/cmd/sam-hub/biscuit.go+++ b/cmd/sam-hub/biscuit.go@@ -62,21 +62,21 @@ func (h *Hub) mintBiscuitToken(claims jwt.MapClaims, token *oidc.IDToken, remotevalue := parts[1]switch prefix {- case "group":+ case api.FactGroup:for _, cg := range oidcGroups {if value == cg {resolvedRoles[b.Role] = true}}- case "user":+ case api.FactUser:if oidcSub != "" && value == oidcSub {resolvedRoles[b.Role] = true}- case "email":+ case api.FactEmail:if oidcEmail != "" && value == oidcEmail {resolvedRoles[b.Role] = true}- case "node":+ case api.FactNode:if value == remotePeer.String() {resolvedRoles[b.Role] = true}diff --git a/site/content/docs/development/policy.md b/site/content/docs/development/policy.mdindex ee6c6201..0924405d 100644--- a/site/content/docs/development/policy.md+++ b/site/content/docs/development/policy.md@@ -106,11 +106,10 @@ Local developers can configure custom validation rules for their specific node u```yamlversion: "v1alpha1"attenuation:- rules:- - 'deny if user("untrusted_sub_id");'checks:- 'check if time($time), $time < 2026-12-31T00:00:00Z;'policies:+ - 'deny if user("untrusted_sub_id");'- 'deny if service("mcp", "restricted-tool"), group("externals");'```@@ -296,19 +295,21 @@ services:# Local policies further restrict or override permissions on this specific nodeattenuation:- # local rules evaluate to block unauthorized actions+ # local rules generate new facts based on existing onesrules:- # 1. Block db-writer calls during off-hours (9 PM to 6 AM)- - 'deny if service("mcp", "db-writer"), time($time), $time.hour() >= 21;'- - 'deny if service("mcp", "db-writer"), time($time), $time.hour() < 6;'+ # e.g., 'is_off_hours() <- current_hour($h), $h >= 21;'# local checks must be satisfied for any connection to succeedchecks:- # 2. Enforce strict TLS certificate expiry limit+ # 1. Enforce strict TLS certificate expiry limit- 'check if time($time), $time < 2026-12-31T23:59:59Z;'# local policies can contain deny rules (to restrict Hub grants) or allow rules (to override implicit denies)policies:+ # 2. Block db-writer calls during off-hours (9 PM to 6 AM)+ - 'deny if service("mcp", "db-writer"), current_hour($hour), $hour >= 21;'+ - 'deny if service("mcp", "db-writer"), current_hour($hour), $hour < 6;'+# 3. Restrict contractors from accessing db-writer even if Hub granted it- 'deny if service("mcp", "db-writer"), role("contractor");'