-
Notifications
You must be signed in to change notification settings - Fork 90
feat: add vulnerability management platform service adapter #385
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
Open
dongyueyan127-dot
wants to merge
18
commits into
chaitin:main
Choose a base branch
from
dongyueyan127-dot:add-vulnplatform-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1e8a4a6
Add vulnerability management platform service adapter
670703f
Migrate vulnerability platform service package
kingfs 65b8392
Harden vulnerability platform token isolation
kingfs 06851d0
Harden token expiry and rate limit mapping
kingfs baa8fbe
Bound platform token cache size
kingfs 1101e83
Remove unverifiable vendor JAR authentication
kingfs c19003d
Fix config schema after auth hardening
kingfs 9321dcd
Remove obsolete bearer token cache
kingfs 44429c7
Simplify bearer token validation
kingfs 7d30802
Remove obsolete token parsing helper
kingfs de05c9b
Require secure platform transport
kingfs 4ea0965
Allow loopback HTTP for service smoke
kingfs 8422b65
Use literal loopback transport exceptions
kingfs 56e726d
Align platform URL schema validation
kingfs bbd3b73
Align runtime URL normalization rules
kingfs 89a2320
Accept normalized secure URL forms
kingfs 19993b3
Reject ambiguous platform URL forms
kingfs 7c0e7ca
Require a platform URL hostname
kingfs 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
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
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,10 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { fileURLToPath } from "node:url"; | ||
| import { runServiceMain } from "@chaitin-ai/octobus-sdk"; | ||
|
|
||
| import { service } from "../vulnplatform__vulnerability-management_v3-2-0/src/service.js"; | ||
|
|
||
| runServiceMain(service, { | ||
| entryFile: fileURLToPath(new URL("../vulnplatform__vulnerability-management_v3-2-0/bin/vulnplatform-vuln.js", import.meta.url)), | ||
| }); |
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
30 changes: 30 additions & 0 deletions
30
services/vulnplatform__vulnerability-management_v3-2-0/README.md
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,30 @@ | ||
| # Vulnerability Management Platform 3.2.0 | ||
|
|
||
| OctoBus integration for the vendor Vulnerability Management Platform. It exposes 16 RPCs covering vulnerability lifecycle operations, asset inventory, and standard-vulnerability intelligence. | ||
|
|
||
| ## Configuration | ||
|
|
||
| ```json | ||
| {"apiBaseUrl":"https://vuln-platform.example.com","timeoutMs":10000,"skipTlsVerify":false} | ||
| ``` | ||
|
|
||
| Provide a platform-issued bearer token: | ||
|
|
||
| ```json | ||
| {"apiToken":"your-platform-token"} | ||
| ``` | ||
|
|
||
| The adapter intentionally does not execute the vendor JAR or accept appId/key/account credentials; this avoids exposing vendor secrets through process arguments. A configured bearer token is used directly and is not copied into a process-wide cache. | ||
|
|
||
| `apiBaseUrl` must use HTTPS so the bearer token is never sent over plaintext networks. Plain HTTP is accepted only for the literal loopback addresses `127.0.0.1` and `[::1]` used by local tests; hostnames such as `localhost` are rejected because their resolution is environment-dependent. Embedded URL credentials are always rejected. `skipTlsVerify` defaults to false. If a trusted private installation requires a self-signed certificate, the service uses a local undici dispatcher and does not weaken Node’s process-wide TLS policy. | ||
|
|
||
| ## Import and validation | ||
|
|
||
| ```bash | ||
| octobus service import --id vulnplatform-vuln ./services/vulnplatform__vulnerability-management_v3-2-0 | ||
| cd services | ||
| npm run validate -- --service-dir vulnplatform__vulnerability-management_v3-2-0 | ||
| npm test -- --service-dir vulnplatform__vulnerability-management_v3-2-0 --coverage | ||
| ``` | ||
|
|
||
| All RPC handlers use the current single-context SDK ABI (`handler({request, config, secret})`). HTTP 401/403/404 map to authentication, authorization, and not-found gRPC errors; other 4xx map to failed precondition; network and 5xx failures map to unavailable; timeout maps to deadline exceeded. Upstream response bodies are never included in error messages. |
7 changes: 7 additions & 0 deletions
7
services/vulnplatform__vulnerability-management_v3-2-0/bin/vulnplatform-vuln.js
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,7 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { runServiceMain } from "@chaitin-ai/octobus-sdk"; | ||
|
|
||
| import { service } from "../src/service.js"; | ||
|
|
||
| runServiceMain(service); |
26 changes: 26 additions & 0 deletions
26
services/vulnplatform__vulnerability-management_v3-2-0/config.schema.json
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,26 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["apiBaseUrl"], | ||
| "properties": { | ||
| "apiBaseUrl": { | ||
| "type": "string", | ||
| "format": "uri", | ||
| "pattern": "^(?:[Hh][Tt][Tt][Pp][Ss]://(?:\\[[0-9A-Fa-f:.]+\\]|[^/@\\s:?#]+)(?::[0-9]+)?(?:[/?#][^\\s]*)?|[Hh][Tt][Tt][Pp]://(?:127\\.0\\.0\\.1|\\[(?:::0{0,3}1|(?:0{1,4}:){0,6}:0{0,3}1|(?:0{1,4}:){7}0{0,3}1)\\])(?::[0-9]+)?(?:[/?#][^\\s]*)?)$", | ||
| "description": "Vulnerability Management Platform URL. Runtime validation requires HTTPS, except for literal 127.0.0.1 and [::1] HTTP test endpoints, and rejects embedded credentials." | ||
| }, | ||
| "timeoutMs": { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 120000, | ||
| "default": 10000, | ||
| "description": "Per-request upstream timeout in milliseconds." | ||
| }, | ||
| "skipTlsVerify": { | ||
| "type": "boolean", | ||
| "default": false, | ||
| "description": "Use only for a trusted private deployment with a self-signed certificate. TLS relaxation is isolated to this service." | ||
| } | ||
| } | ||
| } | ||
11 changes: 11 additions & 0 deletions
11
services/vulnplatform__vulnerability-management_v3-2-0/package.json
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,11 @@ | ||
| { | ||
| "name": "vulnplatform-vuln", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "type": "module", | ||
| "bin": { "vulnplatform-vuln": "bin/vulnplatform-vuln.js" }, | ||
| "dependencies": { | ||
| "@chaitin-ai/octobus-sdk": "^0.6.0", | ||
| "undici": "^7.16.0" | ||
| } | ||
| } |
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.