Skip to content

Commit 779f4a0

Browse files
committed
Add Lightspeed integration docs
1 parent 78eb515 commit 779f4a0

File tree

9 files changed

+95
-22
lines changed

9 files changed

+95
-22
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Run the server:
2323
./stackrox-mcp --config=examples/config-read-only.yaml
2424

2525
# Or using environment variables only
26-
export STACKROX_MCP__CENTRAL__URL=central.stackrox:8443
26+
export STACKROX_MCP__CENTRAL__URL=central.stackrox:443
2727
export STACKROX_MCP__TOOLS__VULNERABILITY__ENABLED=true
2828
./stackrox-mcp
2929
```
@@ -57,7 +57,7 @@ Note the double underscore (`__`) separator between sections and keys.
5757
#### Examples
5858

5959
```bash
60-
export STACKROX_MCP__CENTRAL__URL=central.stackrox:8443
60+
export STACKROX_MCP__CENTRAL__URL=central.stackrox:443
6161
export STACKROX_MCP__GLOBAL__READ_ONLY_TOOLS=true
6262
export STACKROX_MCP__TOOLS__CONFIG_MANAGER__ENABLED=true
6363
```
@@ -70,7 +70,7 @@ Configuration for connecting to StackRox Central.
7070

7171
| Option | Environment Variable | Type | Required | Default | Description |
7272
|--------|---------------------|------|----------|---------|-------------|
73-
| `central.url` | `STACKROX_MCP__CENTRAL__URL` | string | Yes | central.stackrox:8443 | URL of StackRox Central instance |
73+
| `central.url` | `STACKROX_MCP__CENTRAL__URL` | string | Yes | central.stackrox:443 | URL of StackRox Central instance |
7474
| `central.auth_type` | `STACKROX_MCP__CENTRAL__AUTH_TYPE` | string | No | `passthrough` | Authentication type: `passthrough` (use token from MCP client headers) or `static` (use configured token) |
7575
| `central.api_token` | `STACKROX_MCP__CENTRAL__API_TOKEN` | string | Conditional | - | API token for static authentication (required when `auth_type` is `static`, must not be set when `passthrough`) |
7676
| `central.insecure_skip_tls_verify` | `STACKROX_MCP__CENTRAL__INSECURE_SKIP_TLS_VERIFY` | bool | No | `false` | Skip TLS certificate verification (use only for testing) |
@@ -130,7 +130,7 @@ Start the server with a configuration file:
130130
Or using environment variables:
131131

132132
```bash
133-
export STACKROX_MCP__CENTRAL__URL="central.example.com:8443"
133+
export STACKROX_MCP__CENTRAL__URL="central.example.com:443"
134134
export STACKROX_MCP__TOOLS__VULNERABILITY__ENABLED="true"
135135
./stackrox-mcp
136136
```
@@ -287,7 +287,7 @@ Deploy the StackRox MCP server to Kubernetes or OpenShift clusters using Helm.
287287
helm install stackrox-mcp charts/stackrox-mcp \
288288
--namespace stackrox-mcp \
289289
--create-namespace \
290-
--set config.central.url=central.stackrox:8443
290+
--set config.central.url=central.stackrox:443
291291
```
292292

293293
**With custom values file:**
@@ -315,7 +315,7 @@ helm install stackrox-mcp charts/stackrox-mcp \
315315
helm install stackrox-mcp charts/stackrox-mcp \
316316
--namespace stackrox-mcp \
317317
--create-namespace \
318-
--set config.central.url=central.stackrox:8443 \
318+
--set config.central.url=central.stackrox:443 \
319319
--set openshift.route.host=stackrox-mcp.apps.example.com
320320
```
321321

@@ -345,6 +345,12 @@ For complete configuration options including:
345345

346346
See the [Helm Chart README](charts/stackrox-mcp/README.md).
347347

348+
### Integrations
349+
350+
**OpenShift Lightspeed Integration:**
351+
352+
For integrating StackRox MCP with OpenShift Lightspeed, see the [OpenShift Lightspeed Integration Guide](docs/lightspeed-integration.md).
353+
348354
## Development
349355

350356
For detailed development guidelines, testing standards, and contribution workflows, see [CONTRIBUTING.md](.github/CONTRIBUTING.md).

charts/stackrox-mcp/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ The following table lists the configurable parameters of the StackRox MCP chart
151151

152152
| Parameter | Description | Default |
153153
|-----------|-------------|---------|
154-
| `config.central.url` | StackRox Central URL | `central.stackrox:8443` |
154+
| `config.central.url` | StackRox Central URL | `central.stackrox:443` |
155155
| `config.central.insecureSkipTLSVerify` | Skip TLS verification (testing only) | `false` |
156156
| `config.central.forceHTTP1` | Force HTTP/1 bridge | `false` |
157157
| `config.central.requestTimeout` | Request timeout | `30s` |
@@ -188,7 +188,7 @@ The following table lists the configurable parameters of the StackRox MCP chart
188188
```yaml
189189
config:
190190
central:
191-
url: "central.stackrox:8443"
191+
url: "central.stackrox:443"
192192
```
193193
194194
### OpenShift Deployment
@@ -208,7 +208,7 @@ openshift:
208208

209209
config:
210210
central:
211-
url: "central.stackrox:8443"
211+
url: "central.stackrox:443"
212212
```
213213
214214
**OpenShift Security Context Constraints (SCC):**
@@ -245,7 +245,7 @@ affinity:
245245
246246
config:
247247
central:
248-
url: "central.stackrox:8443"
248+
url: "central.stackrox:443"
249249
```
250250

251251
## Configuration Loading
@@ -299,7 +299,7 @@ Test the health endpoint:
299299

300300
```bash
301301
kubectl run -i --tty --rm debug --image=curlimages/curl --restart=Never -- \
302-
curl http://stackrox-mcp.stackrox-mcp.svc.cluster.local:8080/health
302+
curl http://stackrox-mcp.stackrox-mcp:8080/health
303303
```
304304

305305
Expected response: `{"status":"ok"}`

charts/stackrox-mcp/templates/NOTES.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ StackRox MCP Server Configuration:
1717
- Configuration Manager: {{ .Values.config.tools.configManager.enabled | ternary "ENABLED" "DISABLED" }}
1818

1919
3. The service is available at:
20+
Kubernetes service: {{ include "stackrox-mcp.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}
2021
{{- if eq (include "stackrox-mcp.isOpenshift" .) "true" }}
2122
Openshift route: kubectl get route --namespace {{ .Release.Namespace }} {{ include "stackrox-mcp.fullname" . }}
22-
{{- else }}
23-
Kubernetes service: {{ include "stackrox-mcp.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}
2423
{{- end }}
2524

2625
To test connectivity:
2726
$ kubectl run -i --tty --rm debug --image=curlimages/curl --restart=Never -- \
28-
curl http://{{ include "stackrox-mcp.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }}/health
27+
curl http://{{ include "stackrox-mcp.fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.port }}/health

charts/stackrox-mcp/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ config:
121121
# Central connection configuration
122122
central:
123123
# URL of StackRox Central instance (required)
124-
url: "central.stackrox:8443"
124+
url: "central.stackrox:443"
125125

126126
# Skip TLS certificate verification (default: false)
127127
# WARNING: Only use for testing in non-production environments

cmd/stackrox-mcp/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func main() {
6767
cancel()
6868
}()
6969

70-
slog.Info("Starting Stackrox MCP server")
70+
slog.Info("Starting StackRox MCP server")
7171

7272
if err := srv.Start(ctx); err != nil {
7373
logging.Fatal("Server error", err)

docs/lightspeed-integration.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Guide for Setting Up StackRox MCP OpenShift Lightspeed Integration
2+
3+
Guide tested with OpenShift Lightspeed version `1.0.8`.
4+
5+
### 1. Set Up OpenShift Lightspeed
6+
- Set up your OpenShift Lightspeed integration with a large language model (LLM) service. Detailed documentation can be found in the [Red Hat OpenShift Lightspeed Configuration Guide](https://docs.redhat.com/en/documentation/red_hat_openshift_lightspeed/1.0/html/configure/ols-configuring-openshift-lightspeed).
7+
- After OpenShift Lightspeed integration with the LLM is configured and tested, you can continue with StackRox MCP setup.
8+
9+
### 2. Set Up StackRox MCP
10+
- Install StackRox MCP with Helm:
11+
```bash
12+
# Create temp directory and checkout repository with Helm chart.
13+
tmp_stackrox_mcp_dir="stackrox-mcp-${RANDOM}"
14+
git clone --depth 1 --branch main https://github.com/stackrox/stackrox-mcp.git "${tmp_stackrox_mcp_dir}"
15+
16+
# Assuming that StackRox Central is installed on the same cluster in "stackrox" namespace.
17+
helm install stackrox-mcp "${tmp_stackrox_mcp_dir}/charts/stackrox-mcp" --namespace stackrox-mcp --create-namespace
18+
19+
# Delete temp directory.
20+
rm -rf "${tmp_stackrox_mcp_dir}"
21+
```
22+
23+
> **Note:** For advanced helm chart configuration options, see the [StackRox MCP Helm Chart README](../charts/stackrox-mcp/README.md). For OpenShift-specific deployment settings, refer to the [OpenShift Deployment](../charts/stackrox-mcp/README.md#openshift-deployment) section.
24+
25+
- Verify the MCP server is running:
26+
```bash
27+
kubectl run -i --tty --rm debug --image=curlimages/curl --restart=Never -- \
28+
curl http://stackrox-mcp.stackrox-mcp:8080/health
29+
```
30+
You should get `{"status":"ok"}` as a response.
31+
32+
### 3. Set Up Integration of StackRox MCP with OpenShift Lightspeed
33+
- Create an API token in StackRox Central with appropriate permissions.
34+
- Create Authorization Header Secret
35+
- Create a Base64 value for the authorization header secret:
36+
```bash
37+
stackrox_api_token="<StackRox API Token>"
38+
echo -n "Bearer ${stackrox_api_token}" | base64
39+
```
40+
- Create secret `stackrox-mcp-authorization-header` in the `openshift-lightspeed` namespace:
41+
```yaml
42+
kind: Secret
43+
apiVersion: v1
44+
metadata:
45+
name: stackrox-mcp-authorization-header
46+
namespace: openshift-lightspeed
47+
data:
48+
header: "<Base64 value for authorization header>"
49+
type: Opaque
50+
```
51+
- Configure OpenShift Lightspeed by editing the `OLSConfig` configuration for your OpenShift Lightspeed installation and add this section to `spec`:
52+
```yaml
53+
featureGates:
54+
- MCPServer
55+
mcpServers:
56+
- name: stackrox-mcp
57+
streamableHTTP:
58+
enableSSE: false
59+
headers:
60+
authorization: stackrox-mcp-authorization-header
61+
sseReadTimeout: 30
62+
timeout: 60
63+
url: 'http://stackrox-mcp.stackrox-mcp:8080/mcp'
64+
```
65+
- After completing the setup, test your integration with a simple prompt: "List all clusters secured by StackRox"
66+
67+
### Troubleshooting
68+
If you encounter issues, refer to the [Troubleshooting](../charts/stackrox-mcp/README.md#troubleshooting) section in the Helm chart documentation.

examples/config-read-only.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
# Naming convention: STACKROX_MCP__SECTION__KEY
1111
# Example:
1212
# central:
13-
# url: central.stackrox:8443
13+
# url: central.stackrox:443
1414
#
1515
# Can be overridden with:
16-
# STACKROX_MCP__CENTRAL__URL=central.stackrox:8443
16+
# STACKROX_MCP__CENTRAL__URL=central.stackrox:443
1717

1818
# Central connection configuration
1919
central:
20-
# Central URL (required, default: central.stackrox:8443)
20+
# Central URL (required, default: central.stackrox:443)
2121
# The URL of your StackRox Central instance
22-
url: central.stackrox:8443
22+
url: central.stackrox:443
2323

2424
# Authentication type (optional, default: passthrough)
2525
# Options: "passthrough" or "static"

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func LoadConfig(configPath string) (*Config, error) {
130130

131131
// setDefaults sets default values for configuration.
132132
func setDefaults(viper *viper.Viper) {
133-
viper.SetDefault("central.url", "central.stackrox:8443")
133+
viper.SetDefault("central.url", "central.stackrox:443")
134134
viper.SetDefault("central.auth_type", "passthrough")
135135
viper.SetDefault("central.api_token", "")
136136
viper.SetDefault("central.insecure_skip_tls_verify", false)

internal/config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func TestLoadConfig_Defaults(t *testing.T) {
130130
require.NoError(t, err)
131131
require.NotNil(t, cfg)
132132

133-
assert.Equal(t, "central.stackrox:8443", cfg.Central.URL)
133+
assert.Equal(t, "central.stackrox:443", cfg.Central.URL)
134134
assert.False(t, cfg.Central.InsecureSkipTLSVerify)
135135
assert.False(t, cfg.Central.ForceHTTP1)
136136
assert.True(t, cfg.Global.ReadOnlyTools)

0 commit comments

Comments
 (0)