Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions services/bin/octobus-tentacles.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ const services = {
entryFile: "../volcengine__cloud-firewall/bin/volcengine-cloud-firewall.js",
serviceModule: "../volcengine__cloud-firewall/src/service.js",
},
"volcengine-waf": {
entryFile: "../volcengine__waf/bin/volcengine-waf.js",
serviceModule: "../volcengine__waf/src/service.js",
},
"wangsu-label-ip": {
entryFile: "../wangsu__label-ip/bin/wangsu-label-ip.js",
serviceModule: "../wangsu__label-ip/src/service.js",
Expand Down
10 changes: 10 additions & 0 deletions services/bin/volcengine-waf.js
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 "../volcengine__waf/src/service.js";

runServiceMain(service, {
entryFile: fileURLToPath(new URL("../volcengine__waf/bin/volcengine-waf.js", import.meta.url)),
});
3 changes: 3 additions & 0 deletions services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"topsec-waf-v3-2294-20238": "bin/topsec-waf-v3-2294-20238.js",
"venus-ads-v3-6": "bin/venus-ads-v3-6.js",
"volcengine-cloud-firewall": "bin/volcengine-cloud-firewall.js",
"volcengine-waf": "bin/volcengine-waf.js",
"wangsu-label-ip": "bin/wangsu-label-ip.js",
"wd-k01": "bin/wd-k01.js",
"tencent-bh": "bin/tencent-bh.js",
Expand Down Expand Up @@ -125,6 +126,7 @@
"bin/topsec-waf-v3-2294-20238.js",
"bin/venus-ads-v3-6.js",
"bin/volcengine-cloud-firewall.js",
"bin/volcengine-waf.js",
"bin/wd-k01.js",
"bin/tencent-bh.js",
"bin/alibaba-sas.js",
Expand Down Expand Up @@ -187,6 +189,7 @@
"topsec__waf_v3-2294-20238",
"venus__ads_v3-6",
"volcengine__cloud-firewall",
"volcengine__waf",
"wd__k01",
"tencent__bh",
"alibaba__sas",
Expand Down
34 changes: 34 additions & 0 deletions services/volcengine__waf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Volcengine WAF OctoBus Service

## Supported RPCs

This service package exposes read-only Volcengine WAF query APIs through OctoBus RPCs.

| RPC | Volcengine Action | Purpose |
|---|---|---|
| `ListDomain` | `ListDomain` | Query protected domains. |
| `ListLoadBalancer` | `ListLoadBalancer` | Query load balancer access resources. |
| `QueryProtectionOverviewLb` | `QueryProtectionOverviewLb` | Query protection overview metrics. |
| `QueryAttackSecurityEvent` | `QueryAttackSecurityEvent` | Query attack security events. |
| `QueryAttackAnalysisWithRuleAggLb` | `QueryAttackAnalysisWithRuleAggLb` | Query attack analysis grouped by protection rule. |
| `QueryFlowOverviewLb` | `QueryFlowOverviewLb` | Query traffic overview metrics. |
| `ListCustomPage` | `ListCustomPage` | Query custom response pages. |
| `GetTLSConfig` | `GetTLSConfig` | Query TLS configuration. |
| `GetVulnerabilityConfig` | `GetVulnerabilityConfig` | Query vulnerability protection configuration. |
| `ListVulnerabilityRule` | `ListVulnerabilityRule` | Query vulnerability protection rules. |
| `ListCustomBotConfig` | `ListCustomBotConfig` | Query custom bot protection configuration. |
| `ListWafServiceCertificate` | `ListWafServiceCertificate` | Query WAF service certificates. |
| `ListBlockRule` | `ListBlockRule` | Query block rules. |
| `ListAllowRule` | `ListAllowRule` | Query allow rules. |

## Configuration

Use the service `config.schema.json` and `secret.schema.json` files for required endpoint, region, and credential fields. Secrets must be supplied at runtime and are not stored in this package.

## Tests

Run the service test with Node.js from the repository or service worktree:

```bash
node --test test/*.test.js
```
6 changes: 6 additions & 0 deletions services/volcengine__waf/bin/volcengine-waf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env node
import { runServiceMain } from '@chaitin-ai/octobus-sdk';

import { service } from '../src/service.js';

runServiceMain(service);
29 changes: 29 additions & 0 deletions services/volcengine__waf/config.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"additionalProperties": true,
"properties": {
"region": {
"type": "string",
"default": "cn-beijing",
"description": "Volcengine region used for signing and regional WAF endpoints."
},
"endpoint": {
"type": "string",
"description": "Optional Volcengine WAF endpoint override."
},
"timeoutMs": {
"type": "integer",
"minimum": 1,
"default": 5000,
"description": "HTTP timeout in milliseconds."
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Optional additional HTTP headers. Signing headers are set by the service."
}
}
}
15 changes: 15 additions & 0 deletions services/volcengine__waf/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@chaitin-ai/octobus-service-volcengine-waf",
"version": "0.1.0",
"private": true,
"type": "module",
"bin": {
"volcengine-waf": "bin/volcengine-waf.js"
},
"scripts": {
"test": "node --test test/*.test.js"
},
"dependencies": {
"@chaitin-ai/octobus-sdk": "^0.6.0"
}
}
32 changes: 32 additions & 0 deletions services/volcengine__waf/proto/volcengine_waf.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
syntax = "proto3";

package Volcengine_WAF;

import "google/protobuf/struct.proto";

option go_package = "miner/grpc-service/Volcengine_WAF";

service Volcengine_WAF {
rpc ListDomain(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListLoadBalancer(VolcengineRequest) returns (VolcengineResponse) {}
rpc QueryAttackAnalysisWithRuleAggLb(VolcengineRequest) returns (VolcengineResponse) {}
rpc QueryAttackSecurityEvent(VolcengineRequest) returns (VolcengineResponse) {}
rpc QueryFlowOverviewLb(VolcengineRequest) returns (VolcengineResponse) {}
rpc QueryProtectionOverviewLb(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListCustomPage(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListVulnerabilityRule(VolcengineRequest) returns (VolcengineResponse) {}
rpc GetVulnerabilityConfig(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListCustomBotConfig(VolcengineRequest) returns (VolcengineResponse) {}
rpc GetTLSConfig(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListWafServiceCertificate(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListBlockRule(VolcengineRequest) returns (VolcengineResponse) {}
rpc ListAllowRule(VolcengineRequest) returns (VolcengineResponse) {}
}

message VolcengineRequest {
google.protobuf.Struct payload = 1;
}

message VolcengineResponse {
google.protobuf.Value response = 1;
}
31 changes: 31 additions & 0 deletions services/volcengine__waf/secret.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"additionalProperties": true,
"properties": {
"accessKeyId": {
"type": "string",
"description": "Volcengine AccessKeyID."
},
"access_key_id": {
"type": "string",
"description": "Alias for accessKeyId."
},
"secretAccessKey": {
"type": "string",
"description": "Volcengine SecretAccessKey."
},
"secret_access_key": {
"type": "string",
"description": "Alias for secretAccessKey."
},
"sessionToken": {
"type": "string",
"description": "Optional temporary security token."
},
"session_token": {
"type": "string",
"description": "Alias for sessionToken."
}
}
}
81 changes: 81 additions & 0 deletions services/volcengine__waf/service.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"schema": "chaitin.octobus.service.v1",
"name": "volcengine-waf",
"displayName": "Volcengine WAF",
"description": "OctoBus package for Volcengine Web Application Firewall read-only query APIs.",
"runtime": {
"mode": "long-running"
},
"proto": {
"roots": [
"proto"
],
"files": [
"proto/volcengine_waf.proto"
]
},
"configSchema": "config.schema.json",
"secretSchema": "secret.schema.json",
"sdk": {
"cli": {
"commands": {
"Volcengine_WAF.Volcengine_WAF/ListDomain": {
"name": "list-domain",
"description": "Query Volcengine WAF protected domains."
},
"Volcengine_WAF.Volcengine_WAF/ListLoadBalancer": {
"name": "list-load-balancer",
"description": "Query Volcengine WAF load balancer access resources."
},
"Volcengine_WAF.Volcengine_WAF/QueryProtectionOverviewLb": {
"name": "query-protection-overview-lb",
"description": "Query Volcengine WAF protection overview metrics."
},
"Volcengine_WAF.Volcengine_WAF/QueryAttackAnalysisWithRuleAggLb": {
"name": "query-attack-analysis-with-rule-agg-lb",
"description": "Query Volcengine WAF attack analysis grouped by protection rule."
},
"Volcengine_WAF.Volcengine_WAF/QueryAttackSecurityEvent": {
"name": "query-attack-security-event",
"description": "Query Volcengine WAF attack security events."
},
"Volcengine_WAF.Volcengine_WAF/QueryFlowOverviewLb": {
"name": "query-flow-overview-lb",
"description": "Query Volcengine WAF traffic overview metrics."
},
"Volcengine_WAF.Volcengine_WAF/ListCustomPage": {
"name": "list-custom-page",
"description": "Query Volcengine WAF custom response pages."
},
"Volcengine_WAF.Volcengine_WAF/GetTLSConfig": {
"name": "get-tls-config",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetTLSConfig 的描述错误地写成了“log configuration”

GetTLSConfig RPC 用于查询 TLS 配置,但在 service.json 和 README.md 中被描述为“Query Volcengine WAF log configuration.”,明显是复制粘贴错误。错误的文档描述会导致 CLI 帮助信息和 README 对使用者产生误导,使其误以为该接口用于查询日志配置。

Problem code:

Changed code at services/volcengine__waf/service.json:51-53

Recommendation:
将 service.json 和 README.md 中 GetTLSConfig 的描述修正为与 TLS 配置相关的正确文案,例如“Query Volcengine WAF TLS configuration.”。

Suggested diff:

--- a/services/volcengine__waf/service.json
+++ b/services/volcengine__waf/service.json
@@ -50,7 +50,7 @@
         "Volcengine_WAF.Volcengine_WAF/GetTLSConfig": {
           "name": "get-tls-config",
-          "description": "Query Volcengine WAF log configuration."
+          "description": "Query Volcengine WAF TLS configuration."
         },
--- a/services/volcengine__waf/README.md
+++ b/services/volcengine__waf/README.md
@@ -15,7 +15,7 @@
 | `ListCustomPage` | `ListCustomPage` | Query custom response pages. |
-| `GetTLSConfig` | `GetTLSConfig` | Query log configuration. |
+| `GetTLSConfig` | `GetTLSConfig` | Query TLS configuration. |

"description": "Query Volcengine WAF TLS configuration."
},
"Volcengine_WAF.Volcengine_WAF/GetVulnerabilityConfig": {
"name": "get-vulnerability-config",
"description": "Query Volcengine WAF vulnerability protection configuration."
},
"Volcengine_WAF.Volcengine_WAF/ListVulnerabilityRule": {
"name": "list-vulnerability-rule",
"description": "Query Volcengine WAF vulnerability protection rules."
},
"Volcengine_WAF.Volcengine_WAF/ListCustomBotConfig": {
"name": "list-custom-bot-config",
"description": "Query Volcengine WAF custom bot protection configuration."
},
"Volcengine_WAF.Volcengine_WAF/ListWafServiceCertificate": {
"name": "list-waf-service-certificate",
"description": "Query Volcengine WAF service certificates."
},
"Volcengine_WAF.Volcengine_WAF/ListBlockRule": {
"name": "list-block-rule",
"description": "Query Volcengine WAF block rules."
},
"Volcengine_WAF.Volcengine_WAF/ListAllowRule": {
"name": "list-allow-rule",
"description": "Query Volcengine WAF allow rules."
}
}
}
}
}
7 changes: 7 additions & 0 deletions services/volcengine__waf/src/service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineService } from '@chaitin-ai/octobus-sdk';

import { handlers } from './volcengine-waf.js';

export { handlers } from './volcengine-waf.js';

export const service = defineService({ handlers });
Loading