-
Notifications
You must be signed in to change notification settings - Fork 0
ROX-31495: wiremock for central #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5fbca6c
ROX-31495: Add WireMock standalone mock service for StackRox Central
janisz cef9fbf
Simplify smoke test to focus on functionality
janisz 07bf2c0
chore: cleanup WireMock code and documentation
janisz a157c6b
feat: Use go mod cache for proto files instead of manual repo clone
janisz cf2af0c
feat: Add E2E test infrastructure with mock/real service support
janisz 15497ef
fix: Configure E2E tests to work with WireMock mock service
janisz 01f58ab
fix: Fix WireMock JSONPath patterns for gRPC protobuf field names
janisz ad34e28
fix: Fix WireMock smoke test failures and add grpcurl dependency
janisz a878c6f
Delete IMPLEMENTATION_SUMMARY.md
janisz 56d0a4a
Change contains prompt
janisz 924e044
Apply suggestion from @mtodor
janisz 2e28dd4
Apply suggestion from @mtodor
janisz c7559c8
fixes
janisz 488768d
Address PR review comments from @mtodor
janisz 5cf7602
Clean up unused WireMock files and compact README
janisz 74fc864
fix: Fix WireMock JSONPath patterns for deployment CVE queries
janisz 4e23fe9
feat: Add automatic protoc installation to Makefile
janisz 7763733
refactor: Simplify e2e tests to only support WireMock mode
janisz 84bb4ab
Merge branch 'main' into ROX-31495-wiremock-mock-service
janisz 3ba6aaf
Update .github/workflows/wiremock-test.yml
janisz 483ee9e
fix: Fix WireMock smoke test in GitHub Actions
janisz f5bb3b0
fix: Correct JSON payload in smoke test to match protobuf structure
janisz 8d8df75
cleanup readme
janisz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: WireMock Smoke Test | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
|
|
||
| jobs: | ||
| wiremock-smoke-test: | ||
| name: WireMock Smoke Test | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Set up Java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '11' | ||
|
|
||
| - name: Download Go dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Install protoc | ||
| run: make proto-install | ||
|
|
||
| - name: Setup proto files from go mod cache | ||
| run: ./scripts/setup-proto-files.sh | ||
|
|
||
| - name: Run smoke test | ||
| run: make mock-test | ||
|
|
||
| - name: Upload logs on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: wiremock-logs | ||
| path: wiremock/wiremock.log | ||
| if-no-files-found: ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| mcpServers: | ||
| stackrox-mcp: | ||
| command: go | ||
| args: | ||
| - run | ||
| - ../../cmd/stackrox-mcp/... | ||
| - --config | ||
| - ../stackrox-mcp-e2e-config.yaml | ||
| # Explicit environment overrides for mock mode | ||
| # mcpchecker doesn't support proper environment inheritance, | ||
| # so we need to explicitly set all required variables here | ||
| env: | ||
| STACKROX_MCP__CENTRAL__URL: "localhost:8081" | ||
| STACKROX_MCP__CENTRAL__API_TOKEN: "test-token-admin" | ||
| STACKROX_MCP__CENTRAL__INSECURE_SKIP_TLS_VERIFY: "true" | ||
| STACKROX_MCP__CENTRAL__AUTH_TYPE: "static" | ||
| STACKROX_MCP__SERVER__TYPE: "stdio" | ||
| STACKROX_MCP__TOOLS__VULNERABILITY__ENABLED: "true" | ||
| STACKROX_MCP__TOOLS__CONFIG_MANAGER__ENABLED: "true" | ||
| # Auto-approve all tools | ||
| enableAllTools: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| kind: Task | ||
| metadata: | ||
| name: "cve-log4shell" | ||
| difficulty: easy | ||
| steps: | ||
| prompt: | ||
| inline: "Is log4shell CVE detected in my cluster fleet?" | ||
| verify: | ||
| contains: The commonly used name "log4shell" is resolved into the exact CVE number (CVE-2021-44228). And it's detected in a few deployments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| kind: Task | ||
| metadata: | ||
| name: "cve-multiple" | ||
| difficulty: medium | ||
| steps: | ||
| prompt: | ||
| inline: "Are CVE-2021-31805 and CVE-2016-1000031 detected in my cluster fleet?" | ||
| verify: | ||
| contains: "Both CVEs (CVE-2021-31805 and CVE-2016-1000031), along with the cluster names, deployments, and namespaces where they are detected." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| kind: Task | ||
| metadata: | ||
| name: "rhsa-not-supported" | ||
| difficulty: easy | ||
| steps: | ||
| prompt: | ||
| inline: "Is RHSA-2024:5137 affecting my clusters?" | ||
| verify: | ||
| contains: "Information that RHSA-2024:5137 has been detected, along with the cluster where it is detected." |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.