Skip to content

Commit 05dee46

Browse files
alecronS3B4SZ17
andauthored
Add CLI-Scanner Tool and fix app.region URLs (#9)
# Add CLI-Scanner Tool and fix app.region URLs ## Changes * Adding the Sysdig CLI scanner tool * The tool will help you run vuln scans against a particular image or use the IaC mode for infrastructure scans * You need to have the `sysdig-cli-scanner` binary installed * Overall format adjustments * Add support for the https://app.region.sysdig.com URLs --------- Signed-off-by: S3B4SZ17 <sebastian.zumbado@sysdig.com> Co-authored-by: Sebastian Zumbado <59905760+S3B4SZ17@users.noreply.github.com> Co-authored-by: S3B4SZ17 <sebastian.zumbado@sysdig.com>
1 parent 045ccd6 commit 05dee46

File tree

27 files changed

+687
-330
lines changed

27 files changed

+687
-330
lines changed

.github/workflows/helm_test.yaml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ name: Lint & Test helm chart
44
on:
55
pull_request:
66
branches:
7-
- beta
7+
- main
88
paths:
99
- 'charts/**'
1010
push:
1111
branches:
1212
- main
13-
- beta
1413
paths:
1514
- 'charts/**'
1615
workflow_call:
@@ -21,35 +20,9 @@ concurrency:
2120
cancel-in-progress: true
2221

2322
jobs:
24-
set-charts:
25-
# Required permissions
26-
permissions:
27-
contents: read
28-
pull-requests: read
29-
outputs:
30-
charts: ${{ steps.charts.outputs.changes }}
31-
name: "Set Charts"
32-
runs-on: [ubuntu-latest]
33-
steps:
34-
- uses: actions/checkout@v4
35-
- uses: dorny/paths-filter@v2
36-
id: charts
37-
with:
38-
base: ${{ github.ref_name }}
39-
filters: |
40-
sysdig-mcp:
41-
- 'charts/sysdig-mcp/**'
4223
lint-charts:
43-
needs: set-charts
4424
name: Lint new helm charts
4525
runs-on: [ubuntu-latest]
46-
strategy:
47-
matrix:
48-
chart: ${{ fromJSON(needs.set-charts.outputs.charts) }}
49-
# When set to true, GitHub cancels all in-progress jobs if any matrix job fails.
50-
fail-fast: false
51-
# The maximum number of jobs that can run simultaneously
52-
max-parallel: 3
5326
steps:
5427

5528
- uses: actions/checkout@v4
@@ -59,15 +32,17 @@ jobs:
5932
- name: Set up Helm
6033
uses: azure/setup-helm@v4
6134
with:
62-
version: v3.5.0
35+
version: v3.13.3
6336

6437
- uses: actions/setup-python@v4
6538
with:
6639
python-version: '3.10'
6740
check-latest: true
6841

6942
- name: Set up chart-testing
70-
uses: helm/chart-testing-action@v2.6.1
43+
uses: helm/chart-testing-action@v2.7.0
44+
with:
45+
version: v3.13.0
7146

7247
- name: Run chart-testing (list-changed)
7348
id: list-changed
@@ -87,4 +62,5 @@ jobs:
8762

8863
- name: Run chart-testing (install)
8964
if: steps.list-changed.outputs.changed == 'true'
90-
run: ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs charts
65+
run: |
66+
ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs charts

.github/workflows/publish.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ on:
55
push:
66
branches:
77
- main
8-
- beta
98
paths:
9+
- '.github/workflows/**'
1010
- pyproject.toml
1111
- Dockerfile
1212
- '*.py'
1313
- tests/**
1414
- tools/**
1515
- utils/**
16-
workflow_dispatch:
1716

1817
concurrency:
1918
group: 'publish-${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
@@ -99,8 +98,6 @@ jobs:
9998
DEFAULT_BUMP: "patch"
10099
TAG_CONTEXT: 'repo'
101100
WITH_V: true
102-
PRERELEASE_SUFFIX: "beta"
103-
PRERELEASE: ${{ (github.base_ref == 'beta') && 'true' || (github.base_ref == 'main') && 'false' || (github.base_ref == 'integration') && 'false' || 'true' }}
104101

105102
- name: Summary
106103
run: |

.github/workflows/test.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ jobs:
6565
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
6666
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
6767
68+
- name: Get branch ref name
69+
id: branch_ref
70+
run: |
71+
BRANCH_NAME=${{ github.base_ref || github.ref_name }}
72+
echo "$BRANCH_NAME"
73+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
74+
6875
- name: Get tag version
6976
id: semantic_release
7077
uses: anothrNick/github-tag-action@1.71.0
@@ -73,8 +80,6 @@ jobs:
7380
DEFAULT_BUMP: "patch"
7481
TAG_CONTEXT: 'repo'
7582
WITH_V: true
76-
PRERELEASE_SUFFIX: "beta"
77-
PRERELEASE: ${{ (github.base_ref == 'beta') && 'true' || (github.base_ref == 'main') && 'false' || (github.base_ref == 'integration') && 'false' || 'true' }}
7883
DRY_RUN: true
7984

8085
- name: Compare versions

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# MCP Server
22

3+
| App Test | Helm Test |
4+
|------|---------|
5+
| [![App Test](https://github.com/sysdiglabs/sysdig-mcp-server/actions/workflows/publish.yaml/badge.svg?branch=main)](https://github.com/sysdiglabs/sysdig-mcp-server/actions/workflows/publish.yaml) | [![Helm Test](https://github.com/sysdiglabs/sysdig-mcp-server/actions/workflows/helm_test.yaml/badge.svg?branch=main)](https://github.com/sysdiglabs/sysdig-mcp-server/actions/workflows/helm_test.yaml) |
6+
7+
---
8+
39
## Table of contents
410

511
- [MCP Server](#mcp-server)
@@ -79,6 +85,21 @@ Get up and running with the Sysdig MCP Server quickly using our pre-built Docker
7985

8086
## Available Tools
8187

88+
You can select what group of tools to add when running the server by adding/removing them from the `mcp.allowed_tools` list in the app_config.yaml file
89+
90+
```yaml
91+
...
92+
mcp:
93+
transport: stdio
94+
...
95+
allowed_tools:
96+
- "events-feed"
97+
- "inventory"
98+
- "vulnerability-management"
99+
- "sysdig-sage"
100+
- "sysdig-cli-scanner" # Only available in stdio local transport mode
101+
```
102+
82103
<details>
83104
<summary><strong>Events Feed</strong></summary>
84105

@@ -125,6 +146,15 @@ Get up and running with the Sysdig MCP Server quickly using our pre-built Docker
125146

126147
</details>
127148

149+
<details>
150+
<summary><strong>Sysdig CLI scanner</strong></summary>
151+
152+
| Tool Name | Description | Sample Prompt |
153+
|-----------|-------------|----------------|
154+
| `run_sysdig_cli_scanner` | Run the Sysdig CLI Scanner to analyze a container image or IaC files for vulnerabilities and posture and misconfigurations. | "Scan this image ubuntu:latest for vulnerabilities" |
155+
156+
</details>
157+
128158
### Available Resources
129159

130160
- Sysdig Secure Vulnerability Management Overview:
@@ -165,6 +195,8 @@ This file contains the main configuration for the application, including:
165195
- **sysdig**: The Sysdig Secure host to connect to.
166196
- **mcp**: Transport protocol (stdio, sse, streamable-http), URL, host, and port for the MCP server.
167197
198+
> You can set the path for the app_config.yaml using the `APP_CONFIG_FILE=/path/to/app_config.yaml` env var. By default the app will search the file in the root of the app.
199+
168200
### Environment Variables
169201
170202
The following environment variables are required for configuring the Sysdig SDK:
@@ -244,6 +276,12 @@ configMap:
244276
transport: streamable-http
245277
host: "0.0.0.0"
246278
port: 8080
279+
allowed_tools:
280+
- "events-feed"
281+
- "inventory"
282+
- "vulnerability-management"
283+
- "sysdig-sage"
284+
- "sysdig-cli-scanner" # You need the sysdig-cli-scanner binary installed in your server to use this tool
247285
```
248286
249287
Install the chart

app_config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ mcp:
1111
transport: stdio
1212
host: "localhost"
1313
port: 8080
14+
allowed_tools:
15+
- "events-feed"
16+
- "sysdig-cli-scanner" # Only available in stdio local transport mode
17+
- "vulnerability-management"
18+
- "inventory"
19+
- "sysdig-sage"

charts/sysdig-mcp/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ type: application
2020
# This is the chart version. This version number should be incremented each time you make changes
2121
# to the chart and its templates, including the app version.
2222
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23-
version: 0.1.2
23+
version: 0.1.3
2424

2525
# This is the version number of the application being deployed. This version number should be
2626
# incremented each time you make changes to the application. Versions are not expected to
2727
# follow Semantic Versioning. They should reflect the version the application is using.
2828
# It is recommended to use it with quotes.
29-
appVersion: "v0.1.2"
29+
appVersion: "v0.1.3"

charts/sysdig-mcp/templates/configmap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
{{- if .Values.configMap.enabled -}}
32
apiVersion: v1
43
kind: ConfigMap

charts/sysdig-mcp/templates/secrets.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
{{- if .Values.sysdig.secrets.create -}}
32
apiVersion: v1
43
kind: Secret

charts/sysdig-mcp/values.schema.json

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
{
2+
"$schema": "https://json-schema.org/draft-07/schema#",
3+
"title": "Values",
4+
"type": "object",
5+
"properties": {
6+
"sysdig": {
7+
"$ref": "#/$defs/SysdigConfig"
8+
},
9+
"oauth": {
10+
"$ref": "#/$defs/OauthConfig"
11+
}
12+
},
13+
"required": [
14+
"configMap",
15+
"sysdig"
16+
],
17+
"$defs": {
18+
"SysdigConfig": {
19+
"type": "object",
20+
"properties": {
21+
"host": {
22+
"type": [ "string", "null" ],
23+
"description": "Sysdig Tenant Host",
24+
"examples": [
25+
"https://us2.app.sysdig.com",
26+
"https://eu1.app.sysdig.com"
27+
]
28+
},
29+
"mcp": {
30+
"type": "object",
31+
"properties": {
32+
"transport": {
33+
"type": "string",
34+
"enum": [
35+
"streamable-http",
36+
"sse",
37+
"stdio"
38+
],
39+
"description": "The transport protocol for the Sysdig MCP"
40+
}
41+
},
42+
"required": [
43+
"transport"
44+
]
45+
},
46+
"secrets": {
47+
"type": "object",
48+
"properties": {
49+
"create": {
50+
"type": "boolean",
51+
"description": "Whether to create the secret"
52+
},
53+
"secureAPIToken": {
54+
"type": [
55+
"string",
56+
"null"
57+
],
58+
"description": "The API Token to access Sysdig Secure",
59+
"examples": [
60+
"12345678-1234-1234-1234-123456789012"
61+
]
62+
}
63+
},
64+
"required": [
65+
"create",
66+
"secureAPIToken"
67+
]
68+
}
69+
},
70+
"required": [
71+
"host",
72+
"mcp",
73+
"secrets"
74+
],
75+
"additionalProperties": false
76+
},
77+
"OauthConfig": {
78+
"type": "object",
79+
"properties": {
80+
"secrets": {
81+
"type": "object",
82+
"properties": {
83+
"create": {
84+
"type": "boolean",
85+
"description": "Whether to create the secret"
86+
},
87+
"clientId": {
88+
"type": [
89+
"string",
90+
"null"
91+
],
92+
"description": "The Client ID for the OAuth application",
93+
"examples": [
94+
"my-client-id"
95+
]
96+
},
97+
"clientSecret": {
98+
"type": [
99+
"string",
100+
"null"
101+
],
102+
"description": "The Client Secret for the OAuth application",
103+
"examples": [
104+
"my-client-secret"
105+
]
106+
}
107+
},
108+
"required": [
109+
"create",
110+
"clientId",
111+
"clientSecret"
112+
]
113+
}
114+
},
115+
"required": [
116+
"secrets"
117+
],
118+
"additionalProperties": false
119+
},
120+
"AppConfig": {
121+
"type": "object",
122+
"properties": {
123+
"enabled": {
124+
"type": "boolean",
125+
"description": "Whether to create the application configuration"
126+
},
127+
"app_config": {
128+
"type": [
129+
"string",
130+
"null"
131+
],
132+
"description": "The application configuration in YAML format"
133+
}
134+
},
135+
"required": [
136+
"secrets"
137+
],
138+
"additionalProperties": false
139+
}
140+
}
141+
}

charts/sysdig-mcp/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ image:
88
repository: ghcr.io/sysdiglabs/sysdig-mcp-server
99
pullPolicy: IfNotPresent
1010
# Overrides the image tag whose default is the chart appVersion.
11-
tag: "v0.1.2"
11+
tag: "v0.1.3"
1212

1313
imagePullSecrets: []
1414
nameOverride: ""
@@ -126,3 +126,9 @@ configMap:
126126
transport: streamable-http
127127
host: "0.0.0.0"
128128
port: 8080
129+
allowed_tools:
130+
- "events-feed"
131+
- "sysdig-cli-scanner" # You need the sysdig-cli-scanner binary installed in your server to use this tool
132+
- "vulnerability-management"
133+
- "inventory"
134+
- "sysdig-sage"

0 commit comments

Comments
 (0)