Package burp.mcp.util
Class PermissionManager
java.lang.Object
burp.mcp.util.PermissionManager
Middleware permission manager for MCP tool access control.
Four operating modes:
READ_ONLY — only tools that don't modify state (query, list, parse, decode)
READ_WRITE — all tools allowed (default)
PROMPT — read tools allowed, write tools require operator approval
CUSTOM — per-tool policy: ALLOW, PROMPT or DENY
Sensitivity gate: when blockSensitive is true, tools tagged as sensitive
are denied regardless of mode (a hard deny that never prompts).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classEvaluation result for one tool call.static enumstatic enumPer-tool policy for CUSTOM mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisableTool(String toolName) Disable a tool in CUSTOM mode (policy DENY).voidenableTool(String toolName) Enable a tool in CUSTOM mode (policy ALLOW).Evaluate the policy for a tool call.getLevel()Snapshot of the explicitly configured per-tool policies.getToolPolicy(String toolName) Explicit policy for a tool in CUSTOM mode; unset defaults to ALLOW.booleanstatic booleanisReadTool(String toolName) static booleanisSensitive(String toolName) booleanisToolEnabled(String toolName) Check if a tool is not explicitly denied in CUSTOM mode.voidsetBlockSensitive(boolean block) voidsetDisabledTools(Set<String> tools) Set the full set of denied tools.voidsetEnabledTools(Set<String> tools) Set the full set of allowed tools (others keep their default ALLOW).voidsetLevel(PermissionManager.Level level) voidsetToolPolicies(Map<String, PermissionManager.Policy> policies) Replace the full per-tool policy map (for bulk import / Apply).voidsetToolPolicy(String toolName, PermissionManager.Policy policy) Set the explicit policy for a tool in CUSTOM mode.
-
Constructor Details
-
PermissionManager
public PermissionManager()
-
-
Method Details
-
getLevel
-
setLevel
-
isBlockSensitive
public boolean isBlockSensitive() -
setBlockSensitive
public void setBlockSensitive(boolean block) -
setToolPolicy
Set the explicit policy for a tool in CUSTOM mode. -
getToolPolicy
Explicit policy for a tool in CUSTOM mode; unset defaults to ALLOW. -
setToolPolicies
Replace the full per-tool policy map (for bulk import / Apply). -
getToolPolicies
Snapshot of the explicitly configured per-tool policies. -
enableTool
Enable a tool in CUSTOM mode (policy ALLOW). -
disableTool
Disable a tool in CUSTOM mode (policy DENY). -
isToolEnabled
Check if a tool is not explicitly denied in CUSTOM mode. -
setEnabledTools
Set the full set of allowed tools (others keep their default ALLOW). -
setDisabledTools
Set the full set of denied tools. -
getEnabledTools
-
getDisabledTools
-
getPromptTools
-
evaluate
Evaluate the policy for a tool call. The returnedPermissionManager.Accessis never null: it is ALLOW, PROMPT or DENY. -
isReadTool
-
isSensitive
-
getReadTools
-
getSensitiveTools
-