Skip to content

Commit e981076

Browse files
authored
Add Sysdig CLI scanner tool (#7)
# Add Sysdig CLI scanner tool ## 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 --------- Signed-off-by: S3B4SZ17 <sebastian.zumbado@sysdig.com>
1 parent a46dd9e commit e981076

File tree

27 files changed

+691
-343
lines changed

27 files changed

+691
-343
lines changed

.github/workflows/helm_test.yaml

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ name: Lint & Test helm chart
44
on:
55
pull_request:
66
branches:
7-
- main
87
- beta
8+
- main
99
paths:
1010
- 'charts/**'
1111
push:
@@ -22,35 +22,9 @@ concurrency:
2222
cancel-in-progress: true
2323

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

5630
- uses: actions/checkout@v4
@@ -60,15 +34,17 @@ jobs:
6034
- name: Set up Helm
6135
uses: azure/setup-helm@v4
6236
with:
63-
version: v3.5.0
37+
version: v3.13.3
6438

6539
- uses: actions/setup-python@v4
6640
with:
6741
python-version: '3.10'
6842
check-latest: true
6943

7044
- name: Set up chart-testing
71-
uses: helm/chart-testing-action@v2.6.1
45+
uses: helm/chart-testing-action@v2.7.0
46+
with:
47+
version: v3.13.0
7248

7349
- name: Run chart-testing (list-changed)
7450
id: list-changed
@@ -83,9 +59,10 @@ jobs:
8359
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --chart-dirs charts
8460

8561
- name: Create kind cluster
86-
if: steps.list-changed.outputs.changed == 'true'
62+
if: github.ref_name == 'beta' || github.ref_name == 'main'
8763
uses: helm/kind-action@v1.12.0
8864

8965
- name: Run chart-testing (install)
90-
if: steps.list-changed.outputs.changed == 'true'
91-
run: ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs charts
66+
if: github.ref_name == 'beta' || github.ref_name == 'main'
67+
run: |
68+
ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs charts

.github/workflows/publish.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ on:
77
- main
88
- beta
99
paths:
10+
- '.github/workflows/**'
1011
- pyproject.toml
1112
- Dockerfile
1213
- '*.py'
1314
- tests/**
1415
- tools/**
1516
- utils/**
16-
workflow_dispatch:
1717

1818
concurrency:
1919
group: 'publish-${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
@@ -45,7 +45,7 @@ jobs:
4545
- name: Extract version
4646
id: extract_version
4747
run: |
48-
VERSION=$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')-$(echo $GITHUB_SHA | cut -c1-7)
48+
VERSION=$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
4949
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
5050
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
5151
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
@@ -100,7 +100,7 @@ jobs:
100100
TAG_CONTEXT: 'repo'
101101
WITH_V: true
102102
PRERELEASE_SUFFIX: "beta"
103-
PRERELEASE: ${{ (github.base_ref == 'beta') && 'true' || (github.base_ref == 'main') && 'false' || (github.base_ref == 'integration') && 'false' || 'true' }}
103+
PRERELEASE: ${{ (github.base_ref || github.ref_name == 'beta') && 'true' || ((github.base_ref || github.ref_name == 'main') && 'false' || 'true') }}
104104

105105
- name: Summary
106106
run: |

.github/workflows/test.yaml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@
22
name: Test
33

44
on:
5-
push:
6-
branches:
7-
- main
8-
- beta
9-
- integration
10-
- feature/**
11-
- release/**
12-
- hotfix/**
13-
paths:
14-
- pyproject.toml
15-
- Dockerfile
16-
- '*.py'
17-
- tests/**
18-
- tools/**
19-
- utils/**
205
pull_request:
216
paths:
227
- pyproject.toml
@@ -80,6 +65,13 @@ jobs:
8065
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
8166
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
8267
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+
8375
- name: Get tag version
8476
id: semantic_release
8577
uses: anothrNick/github-tag-action@1.71.0
@@ -89,7 +81,7 @@ jobs:
8981
TAG_CONTEXT: 'repo'
9082
WITH_V: true
9183
PRERELEASE_SUFFIX: "beta"
92-
PRERELEASE: ${{ (github.base_ref == 'beta') && 'true' || (github.base_ref == 'main') && 'false' || (github.base_ref == 'integration') && 'false' || 'true' }}
84+
PRERELEASE: ${{ (github.base_ref || github.ref_name == 'beta') && 'true' || (((github.base_ref || github.ref_name == 'main') && 'false' || (github.base_ref || github.ref_name == 'integration') && 'false') || 'true') }}
9385
DRY_RUN: true
9486

9587
- 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-beta.0"

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

0 commit comments

Comments
 (0)