Skip to content

Commit 89b1588

Browse files
authored
fix Tool permissions for API (#22)
# fix Tool permissions for API ## Changes * fix the tool API minimum permissions * Updated the docs to include the required minimum permissions Signed-off-by: S3B4SZ17 <[email protected]>
1 parent 5871eed commit 89b1588

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ repos:
66
description: Format code with ruff.
77
entry: make fmt
88
language: system
9-
stages: ["commit", "push"]
9+
stages: ["pre-commit", "pre-push"]
1010
- id: ruff-check
1111
name: Ruff Check
1212
description: Check code style with ruff.
1313
entry: make lint
1414
language: system
15-
stages: ["commit", "push"]
15+
stages: ["pre-commit", "pre-push"]

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
- [Requirements](#requirements)
1818
- [UV Setup](#uv-setup)
1919
- [Configuration](#configuration)
20+
- [API Permissions](#api-permissions)
2021
- [Running the Server](#running-the-server)
2122
- [Docker](#docker)
22-
- [K8s Deployment](#k8s-deployment)
2323
- [UV](#uv)
2424
- [Client Configuration](#client-configuration)
2525
- [Authentication](#authentication)
@@ -157,6 +157,32 @@ You can find your API token in the Sysdig Secure UI under **Settings > Sysdig Se
157157
158158
You can set these variables in your shell or in a `.env` file.
159159
160+
### API Permissions
161+
162+
The minimum permissions needed for the tools to make the necessary API calls are the following:
163+
164+
```bash
165+
"cli-scanner": ["secure.vm.cli-scanner.exec"],
166+
"threat-detection": ["policy-events.read"],
167+
"sysql": ["sage.exec","risks.read"],
168+
```
169+
170+
We advise you to create a separate role for your MCP server ideally a SA. More information on the official [doc for roles-administration](https://docs.sysdig.com/en/administration/roles-administration/) and how to attach it to the SA and/or team user.
171+
172+
The permissions needed for the Secure platform are:
173+
174+
- Threats: "Policy Events" Read
175+
- Risks: "Access to risk feature" Read
176+
- Vulnerability Management: "CLI Execution" EXEC
177+
- Settings: "API Access Token" View, Read, Edit
178+
- Sage: "Use Sage chat" EXEC
179+
180+
When selecting the above some other permissions dependent will be added.
181+
182+
>[!IMPORTANT]
183+
> When using a SA token is expected that the `generate_and_run_sysql` will give a 500 error, to use that tool you should use a token assigned to a user for now.
184+
185+
160186
## Running the Server
161187
162188
You can run the MCP server using either Docker, `uv` or install it in your K8s cluster with helm.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sysdig-mcp-server"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
description = "Sysdig MCP Server"
55
readme = "README.md"
66
requires-python = ">=3.12"

utils/sysdig/helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
# Sysdig permissions needed for the different set of tools
66
TOOL_PERMISSIONS = {
77
"cli-scanner": ["secure.vm.cli-scanner.exec"],
8-
"threat-detection": ["custom-events.read"],
9-
"sysql": ["sage.exec", "sage.manage.exec"],
8+
"threat-detection": ["policy-events.read"],
9+
"sysql": ["sage.exec", "risks.read"],
1010
}

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)