mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-09-15 22:25:33 +02:00
feat: add configurable tool call blocking and monitoring
This commit is contained in:
@@ -129,6 +129,10 @@ func permissionForRequest(method, fullPath string) string {
|
||||
return "notification:read"
|
||||
}
|
||||
return "notification:write"
|
||||
case path == "/tool-guard/test" && method == http.MethodPost:
|
||||
return "config:read"
|
||||
case path == "/tool-guard":
|
||||
return crudPermission(method, "config")
|
||||
case strings.HasPrefix(path, "/config"):
|
||||
return crudPermission(method, "config")
|
||||
case strings.HasPrefix(path, "/terminal"):
|
||||
@@ -208,6 +212,8 @@ func resourceAllowed(c *gin.Context, db *database.DB) bool {
|
||||
}
|
||||
path := strings.TrimPrefix(c.FullPath(), "/api")
|
||||
switch {
|
||||
case path == "/tool-guard" && isMutationMethod(c.Request.Method):
|
||||
return session.Scope == database.RBACScopeAll
|
||||
case path == "/monitor/stats", path == "/monitor/calls-timeline":
|
||||
// These APIs currently operate on process-global state. Until every MCP
|
||||
// invocation and persisted execution record carries an immutable owner,
|
||||
|
||||
Reference in New Issue
Block a user