huaweicloud-devkit 1.0.3-dev.0 → 1.0.3-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/.agents/plugins/marketplace.json +18 -18
  2. package/README.md +99 -41
  3. package/README.zh-CN.md +99 -41
  4. package/bin/setup.cjs +5 -3
  5. package/integrations/opencode/opencode.json +1 -4
  6. package/package.json +61 -42
  7. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
  8. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +4 -17
  9. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
  10. package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
  11. package/plugins/huaweicloud-core/.mcp.json +2 -5
  12. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
  13. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +32 -9
  14. package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
  15. package/plugins/huaweicloud-core/safety/policy.json +75 -99
  16. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +41 -13
  17. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +34 -34
  18. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +18 -18
  19. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
  20. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +34 -32
  21. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
  22. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
  23. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
  24. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
  25. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +39 -30
  26. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
  27. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +39 -36
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +15 -4
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
  31. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +40 -39
  33. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
  36. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
  37. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
  38. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +27 -27
  39. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
  40. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
  41. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +33 -25
  42. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +51 -44
  43. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
  44. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
  45. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
  46. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
  47. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +63 -58
  48. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +128 -42
  49. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +26 -26
  50. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
  51. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +13 -12
  52. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
  53. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
  54. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +18 -18
  55. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
  56. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
  57. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +25 -2
  58. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
  59. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +27 -1
  60. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
  61. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +65 -47
  62. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
  63. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
  64. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
  65. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
  66. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
  67. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +33 -33
  68. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
  69. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +123 -2
  70. package/plugins/huaweicloud-core/src/auth/credentials.mjs +77 -4
  71. package/plugins/huaweicloud-core/src/auth/service.mjs +1 -1
  72. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  73. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +25 -7
  74. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  75. package/plugins/huaweicloud-core/src/mcp-server.mjs +30 -3
  76. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +73 -0
  77. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
  78. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
  79. package/plugins/huaweicloud-core/src/safety-policy.mjs +122 -68
  80. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +14 -10
  81. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +34 -27
  82. package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
  83. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +521 -8
  84. package/plugins/huaweicloud-core/src/search-market.mjs +53 -14
  85. package/plugins/huaweicloud-core/src/setup-cli.mjs +1741 -215
  86. package/plugins/huaweicloud-core/src/tools.mjs +667 -123
  87. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
  88. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
  89. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +12 -15
  90. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
  91. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
  92. package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +267 -0
  93. package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
  94. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +9 -5
  95. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +0 -190
  96. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +0 -124
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "huaweicloud-core",
3
- "version": "1.0.3-dev.0",
2
+ "name": "huaweicloud-devkit",
3
+ "version": "1.0.3-next.0",
4
4
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
5
5
  "author": {
6
6
  "name": "HuaweiCloud Mate",
@@ -9,17 +9,7 @@
9
9
  "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
10
10
  "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
11
11
  "license": "Apache-2.0",
12
- "keywords": [
13
- "huaweicloud",
14
- "huawei-cloud",
15
- "koocli",
16
- "hcloud",
17
- "agent",
18
- "mcp",
19
- "api",
20
- "sdk",
21
- "skills"
22
- ],
12
+ "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills"],
23
13
  "skills": "./skills/",
24
14
  "mcpServers": "./.mcp.json",
25
15
  "interface": {
@@ -28,10 +18,7 @@
28
18
  "longDescription": "HuaweiCloud Devkit helps coding agents choose and use Huawei Cloud Skills, KooCLI, APIs, SDKs, and MCP tools with less context, safer command execution, and more accurate cloud implementation decisions.",
29
19
  "developerName": "HuaweiCloud Mate",
30
20
  "category": "Cloud",
31
- "capabilities": [
32
- "Read",
33
- "Interactive"
34
- ],
21
+ "capabilities": ["Read", "Interactive"],
35
22
  "websiteURL": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
36
23
  "brandColor": "#C7000B",
37
24
  "defaultPrompt": [
@@ -5,10 +5,7 @@
5
5
  "longDescription": "HuaweiCloud Devkit helps coding agents choose and use Huawei Cloud Skills, KooCLI, APIs, SDKs, and MCP tools with less context, safer command execution, and more accurate cloud implementation decisions.",
6
6
  "developerName": "HuaweiCloud Mate",
7
7
  "category": "Cloud",
8
- "capabilities": [
9
- "Read",
10
- "Interactive"
11
- ],
8
+ "capabilities": ["Read", "Interactive"],
12
9
  "websiteURL": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
13
10
  "brandColor": "#C7000B",
14
11
  "defaultPrompt": [
@@ -20,25 +17,15 @@
20
17
  "mcpServers": "./.mcp.json",
21
18
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
22
19
  "skills": "./skills/",
23
- "version": "1.0.3-dev.0",
20
+ "version": "1.0.3-next.0",
24
21
  "author": {
25
22
  "name": "HuaweiCloud Mate",
26
23
  "url": "https://github.com/huaweicloud"
27
24
  },
28
25
  "hooks": "./hooks/",
29
- "name": "huaweicloud-core",
26
+ "name": "huaweicloud-devkit",
30
27
  "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
31
28
  "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
32
29
  "license": "Apache-2.0",
33
- "keywords": [
34
- "huaweicloud",
35
- "huawei-cloud",
36
- "koocli",
37
- "hcloud",
38
- "agent",
39
- "mcp",
40
- "api",
41
- "sdk",
42
- "skills"
43
- ]
30
+ "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills"]
44
31
  }
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "huaweicloud-devkit",
3
+ "version": "1.0.3-next.0",
4
+ "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
5
+ "author": {
6
+ "name": "HuaweiCloud Mate",
7
+ "url": "https://github.com/huaweicloud"
8
+ },
9
+ "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
10
+ "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
11
+ "license": "Apache-2.0",
12
+ "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills"],
13
+ "skills": "./skills/",
14
+ "mcpServers": "./.mcp.json",
15
+ "interface": {
16
+ "displayName": "HuaweiCloud Devkit",
17
+ "shortDescription": "HuaweiCloud Devkit - Huawei Cloud guidance, CLI/API/SDK routing, MCP tools, and safety for coding agents.",
18
+ "longDescription": "HuaweiCloud Devkit helps coding agents choose and use Huawei Cloud Skills, KooCLI, APIs, SDKs, and MCP tools with less context, safer command execution, and more accurate cloud implementation decisions.",
19
+ "developerName": "HuaweiCloud Mate",
20
+ "category": "Cloud",
21
+ "capabilities": ["Read", "Interactive"],
22
+ "websiteURL": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
23
+ "brandColor": "#C7000B",
24
+ "defaultPrompt": [
25
+ "Help me choose the right Huawei Cloud capability.",
26
+ "Check my Huawei Cloud CLI setup safely.",
27
+ "Plan this Huawei Cloud API or SDK task."
28
+ ]
29
+ }
30
+ }
@@ -2,13 +2,10 @@
2
2
  "mcpServers": {
3
3
  "huaweicloud-devkit": {
4
4
  "command": "node",
5
- "args": [
6
- "./src/mcp-server.mjs"
7
- ],
5
+ "args": ["./src/mcp-server.mjs"],
8
6
  "cwd": ".",
9
7
  "env": {
10
- "HUAWEICLOUD_AGENT_TOOLKIT_MODE": "local",
11
- "HDKITSERVICE_ENDPOINT": ""
8
+ "HUAWEICLOUD_AGENT_TOOLKIT_MODE": "local"
12
9
  }
13
10
  }
14
11
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "huaweicloud-core",
3
- "version": "1.0.0",
2
+ "name": "huaweicloud-devkit",
3
+ "version": "1.0.3-next.0",
4
4
  "description": "Guide coding agents to use Huawei Cloud Skills, KooCLI, APIs, SDKs, and future MCP capabilities with safer execution and less context.",
5
5
  "author": {
6
6
  "name": "HuaweiCloud Mate",
@@ -9,30 +9,16 @@
9
9
  "homepage": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
10
10
  "repository": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
11
11
  "license": "Apache-2.0",
12
- "keywords": [
13
- "huaweicloud",
14
- "huawei-cloud",
15
- "koocli",
16
- "hcloud",
17
- "agent",
18
- "mcp",
19
- "api",
20
- "sdk",
21
- "skills"
22
- ],
12
+ "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills"],
23
13
  "skills": "./skills/",
24
14
  "mcpServers": "./.mcp.json",
25
- "hooks": "./hooks/",
26
15
  "interface": {
27
16
  "displayName": "HuaweiCloud Devkit",
28
17
  "shortDescription": "HuaweiCloud Devkit - Huawei Cloud guidance, CLI/API/SDK routing, MCP tools, and safety for coding agents.",
29
18
  "longDescription": "HuaweiCloud Devkit helps coding agents choose and use Huawei Cloud Skills, KooCLI, APIs, SDKs, and MCP tools with less context, safer command execution, and more accurate cloud implementation decisions.",
30
19
  "developerName": "HuaweiCloud Mate",
31
20
  "category": "Cloud",
32
- "capabilities": [
33
- "Read",
34
- "Interactive"
35
- ],
21
+ "capabilities": ["Read", "Interactive"],
36
22
  "websiteURL": "https://github.com/huaweicloud/HuaweiCloud-Devkit",
37
23
  "brandColor": "#C7000B",
38
24
  "defaultPrompt": [
@@ -18,15 +18,38 @@ from pathlib import Path
18
18
 
19
19
  DENY_PREFIX = "Huawei Cloud safety hook blocked this action: "
20
20
  RULES_PATH = Path(__file__).resolve().parents[1] / "safety" / "rules" / "cloud-risk-rules.json"
21
+ POLICY_PATH = Path(__file__).resolve().parents[1] / "safety" / "policy.json"
21
22
 
22
- CONFIG_FILE_RE = re.compile(r"(\.hcloud|\.huaweicloud|hcloud[/\\](config|credentials)|huaweicloud[/\\](config|credentials))", re.I)
23
- ENV_DUMP_RE = re.compile(r"(env|printenv|Get-ChildItem\s+Env:|gci\s+Env:|dir\s+Env:).*(HUAWEICLOUD|HWC_|HCLOUD|OS_)", re.I)
24
- SECRET_READ_RE = re.compile(r"(ShowSecretVersion|GetSecretValue|secret_string|secret_binary)", re.I)
25
- HCLOUD_RE = re.compile(r"(^|\s)hcloud(\.exe)?\s+", re.I)
26
- WRITE_OPERATION_RE = re.compile(
27
- r"\b(BatchCreate|BatchDelete|Create|Delete|Update|Modify|Resize|Reboot|Stop|Start|Restart|Authorize|Revoke|Add|Remove|Associate|Disassociate|Attach|Detach|Enable|Disable)\w*",
28
- re.I,
23
+ CONFIG_FILE_RE = None
24
+ SECRET_READ_RE = None
25
+ WRITE_OPERATION_RE = None
26
+
27
+
28
+ def load_policy():
29
+ global CONFIG_FILE_RE, SECRET_READ_RE, WRITE_OPERATION_RE
30
+ try:
31
+ with POLICY_PATH.open("r", encoding="utf-8") as file_obj:
32
+ policy = json.load(file_obj)
33
+ cred_patterns = policy.get("credentialFilePatterns", [])
34
+ if cred_patterns:
35
+ CONFIG_FILE_RE = re.compile("|".join(cred_patterns), re.I)
36
+ blocked_secrets = policy.get("blockedSecretOperations", [])
37
+ if blocked_secrets:
38
+ SECRET_READ_RE = re.compile("|".join(re.escape(op) for op in blocked_secrets), re.I)
39
+ write_prefixes = policy.get("writeOperationPrefixes", [])
40
+ if write_prefixes:
41
+ WRITE_OPERATION_RE = re.compile(r"\b(" + "|".join(write_prefixes) + r")\w*", re.I)
42
+ except Exception:
43
+ pass
44
+
45
+
46
+ load_policy()
47
+
48
+ ENV_DUMP_RE = re.compile(
49
+ r"(env|printenv|Get-ChildItem\s+Env:|gci\s+Env:|dir\s+Env:).*(HUAWEICLOUD|HWC_|HCLOUD|OS_)", re.I,
29
50
  )
51
+ HCLOUD_RE = re.compile(r"(^|\s)hcloud(\.exe)?\s+", re.I)
52
+ READ_OPERATION_RE = re.compile(r"\b(List|Show|Get|Describe|NovaList|NovaShow)\w*", re.I)
30
53
  READ_OPERATION_RE = re.compile(r"\b(List|Show|Get|Describe|NovaList|NovaShow)\w*", re.I)
31
54
 
32
55
 
@@ -117,11 +140,11 @@ def main():
117
140
  tool_name = data.get("tool_name", "")
118
141
  text = command_text(data.get("tool_input", {}))
119
142
 
120
- if CONFIG_FILE_RE.search(text):
143
+ if CONFIG_FILE_RE and CONFIG_FILE_RE.search(text):
121
144
  deny("reading Huawei Cloud credential/profile files can expose AK/SK or tokens. Use redacted toolkit tools.")
122
145
  if ENV_DUMP_RE.search(text):
123
146
  deny("dumping cloud credential environment variables is not allowed.")
124
- if SECRET_READ_RE.search(text):
147
+ if SECRET_READ_RE and SECRET_READ_RE.search(text):
125
148
  deny("direct secret value retrieval would put plaintext secrets into the agent context.")
126
149
  denied_rule = first_denied_command_rule(text)
127
150
  if denied_rule:
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "huaweicloud-devkit",
3
+ "id": "huaweicloud-devkit",
4
+ "displayName": "HuaweiCloud DevKit",
5
+ "version": "1.0.3-next.0",
6
+ "family": "bundle-plugin",
7
+ "bundleFormat": "codex",
8
+ "description": "Guide coding agents to use Huawei Cloud safely — KooCLI, APIs, SDKs, 28 MCP tools, skills, and safety guardrails.",
9
+ "author": {
10
+ "name": "HuaweiCloud Mate",
11
+ "url": "https://github.com/huaweicloud"
12
+ },
13
+ "homepage": "https://github.com/huaweicloud/huaweicloud-devkit",
14
+ "repository": "https://github.com/huaweicloud/huaweicloud-devkit",
15
+ "license": "Apache-2.0",
16
+ "keywords": ["huaweicloud", "huawei-cloud", "koocli", "hcloud", "agent", "mcp", "api", "sdk", "skills", "cloud"],
17
+ "category": "Cloud",
18
+ "capabilities": ["Read", "Interactive"],
19
+ "brandColor": "#C7000B"
20
+ }
@@ -1,100 +1,76 @@
1
1
  {
2
- "version": "0.1.0",
3
- "secretKeyNamePatterns": [
4
- "access[_-]?key",
5
- "secret[_-]?key",
6
- "security[_-]?token",
7
- "x[_-]?auth[_-]?token",
8
- "authorization",
9
- "password",
10
- "passwd",
11
- "token",
12
- "credential",
13
- "private[_-]?key",
14
- "ak",
15
- "sk"
16
- ],
17
- "credentialFilePatterns": [
18
- "\\.hcloud",
19
- "\\.huaweicloud",
20
- "hcloud[/\\\\](config|credentials)",
21
- "huaweicloud[/\\\\](config|credentials)"
22
- ],
23
- "blockedConfigureSubcommands": [
24
- "show",
25
- "get",
26
- "list",
27
- "export",
28
- "init"
29
- ],
30
- "blockedSecretOperations": [
31
- "ShowSecretVersion",
32
- "DownloadSecret",
33
- "GetSecretValue"
34
- ],
35
- "writeOperationPrefixes": [
36
- "Create",
37
- "BatchCreate",
38
- "Delete",
39
- "BatchDelete",
40
- "Update",
41
- "Modify",
42
- "Resize",
43
- "Reboot",
44
- "Stop",
45
- "Start",
46
- "Restart",
47
- "Authorize",
48
- "Revoke",
49
- "Add",
50
- "Remove",
51
- "Associate",
52
- "Disassociate",
53
- "Attach",
54
- "Detach",
55
- "Enable",
56
- "Disable",
57
- "Set",
58
- "Put",
59
- "Upload",
60
- "Install",
61
- "Publish",
62
- "Bind",
63
- "Unbind",
64
- "Invoke",
65
- "Execute",
66
- "Trigger",
67
- "Deploy"
68
- ],
69
- "readOperationPrefixes": [
70
- "List",
71
- "Show",
72
- "Get",
73
- "Describe",
74
- "NovaList",
75
- "NovaShow"
76
- ],
77
- "safeTextReadCommands": [
78
- "rg",
79
- "grep",
80
- "findstr",
81
- "git",
82
- "ls",
83
- "dir",
84
- "Get-ChildItem"
85
- ],
86
- "blockedSandboxCommands": [
87
- "rm\\s+-rf\\s+/",
88
- "mkfs",
89
- "dd\\s+if=",
90
- ":\\(\\)\\{:\\|:&\\};:",
91
- "shutdown",
92
- "reboot",
93
- "init\\s+[06]",
94
- "fdisk"
95
- ],
96
- "sandboxWriteTools": [
97
- "huaweicloud_sandbox_connect",
98
- "huaweicloud_sandbox_credentials"
99
- ]
100
- }
2
+ "version": "0.1.0",
3
+ "secretKeyNamePatterns": [
4
+ "access[_-]?key",
5
+ "secret[_-]?key",
6
+ "security[_-]?token",
7
+ "x[_-]?auth[_-]?token",
8
+ "authorization",
9
+ "password",
10
+ "passwd",
11
+ "token",
12
+ "credential",
13
+ "private[_-]?key",
14
+ "ak",
15
+ "sk"
16
+ ],
17
+ "credentialFilePatterns": [
18
+ "\\.hcloud",
19
+ "\\.huaweicloud",
20
+ "hcloud[/\\\\](config|credentials)",
21
+ "huaweicloud[/\\\\](config|credentials)"
22
+ ],
23
+ "blockedConfigureSubcommands": ["show", "get", "list", "export", "init"],
24
+ "blockedSecretOperations": ["ShowSecretVersion", "DownloadSecret", "GetSecretValue"],
25
+ "writeOperationPrefixes": [
26
+ "Create",
27
+ "BatchCreate",
28
+ "Delete",
29
+ "BatchDelete",
30
+ "Update",
31
+ "Modify",
32
+ "Resize",
33
+ "Reboot",
34
+ "Stop",
35
+ "Start",
36
+ "Restart",
37
+ "Authorize",
38
+ "Revoke",
39
+ "Add",
40
+ "Remove",
41
+ "Associate",
42
+ "Disassociate",
43
+ "Attach",
44
+ "Detach",
45
+ "Enable",
46
+ "Disable",
47
+ "Set",
48
+ "Put",
49
+ "Upload",
50
+ "Install",
51
+ "Publish",
52
+ "Bind",
53
+ "Unbind",
54
+ "Invoke",
55
+ "Execute",
56
+ "Trigger",
57
+ "Deploy"
58
+ ],
59
+ "readOperationPrefixes": ["List", "Show", "Get", "Describe", "NovaList", "NovaShow"],
60
+ "safeTextReadCommands": ["rg", "grep", "findstr", "git", "ls", "dir", "Get-ChildItem"],
61
+ "blockedSandboxCommands": [
62
+ "rm\\s+-rf\\s+/",
63
+ "mkfs",
64
+ "dd\\s+if=",
65
+ ":\\(\\)\\{:\\|:&\\};:",
66
+ "shutdown",
67
+ "reboot",
68
+ "init\\s+[06]",
69
+ "fdisk"
70
+ ],
71
+ "sandboxWriteTools": [
72
+ "huaweicloud_sandbox_connect",
73
+ "huaweicloud_sandbox_credentials",
74
+ "huaweicloud_sandbox_upload_file"
75
+ ]
76
+ }
@@ -9,7 +9,10 @@
9
9
  "stages": ["command"],
10
10
  "match": {
11
11
  "any": [
12
- { "field": "text", "regex": "(^|\\s)(cat|type|Get-Content|gc|less|more)\\s+[^\\n]*(\\.hcloud|\\.huaweicloud)" },
12
+ {
13
+ "field": "text",
14
+ "regex": "(^|\\s)(cat|type|Get-Content|gc|less|more)\\s+[^\\n]*(\\.hcloud|\\.huaweicloud)"
15
+ },
13
16
  { "field": "text", "regex": "(hcloud|huaweicloud)[/\\\\](config|credentials)" }
14
17
  ]
15
18
  },
@@ -54,7 +57,10 @@
54
57
  "stages": ["command"],
55
58
  "match": {
56
59
  "all": [
57
- { "field": "text", "regex": "(base64\\s+(-d|--decode)|xxd\\s+-r|certutil\\s+-decode|FromBase64String|hex\\s*decode)" },
60
+ {
61
+ "field": "text",
62
+ "regex": "(base64\\s+(-d|--decode)|xxd\\s+-r|certutil\\s+-decode|FromBase64String|hex\\s*decode)"
63
+ },
58
64
  { "field": "text", "regex": "(\\||;|&&)" },
59
65
  { "field": "text", "regex": "\\b(bash|sh|zsh|powershell|pwsh|cmd|python|node)\\b" }
60
66
  ]
@@ -70,8 +76,14 @@
70
76
  "stages": ["command", "artifact", "deploy_plan"],
71
77
  "match": {
72
78
  "all": [
73
- { "field": "text", "regex": "(0\\.0\\.0\\.0\\s*/\\s*0|::\\s*/\\s*0|remote_ip_prefix\\s*[=:]\\s*0\\.0\\.0\\.0\\s*/\\s*0|cidr\\s*[=:]\\s*0\\.0\\.0\\.0\\s*/\\s*0)" },
74
- { "field": "text", "regex": "(port_range_min|port_range_max|from_port|to_port|port|\\b22\\b|\\b3389\\b|\\b3306\\b|\\b5432\\b|\\b6379\\b|\\b9200\\b)" }
79
+ {
80
+ "field": "text",
81
+ "regex": "(0\\.0\\.0\\.0\\s*/\\s*0|::\\s*/\\s*0|remote_ip_prefix\\s*[=:]\\s*0\\.0\\.0\\.0\\s*/\\s*0|cidr\\s*[=:]\\s*0\\.0\\.0\\.0\\s*/\\s*0)"
82
+ },
83
+ {
84
+ "field": "text",
85
+ "regex": "(port_range_min|port_range_max|from_port|to_port|port|\\b22\\b|\\b3389\\b|\\b3306\\b|\\b5432\\b|\\b6379\\b|\\b9200\\b)"
86
+ }
75
87
  ]
76
88
  },
77
89
  "message": "The change appears to expose an administrative or database port to the public internet.",
@@ -84,12 +96,16 @@
84
96
  "severity": "deny",
85
97
  "stages": ["command", "artifact", "deploy_plan"],
86
98
  "match": {
87
- "all": [
88
- { "field": "text", "regex": "(OBS|obs://|bucket|object|Statement|Principal)" }
89
- ],
99
+ "all": [{ "field": "text", "regex": "(OBS|obs://|bucket|object|Statement|Principal)" }],
90
100
  "any": [
91
- { "field": "text", "regex": "((Anonymous|Everyone|\\\"Principal\\\"\\s*:\\s*\\\"\\*\\\"|AllUsers).*(PutObject|DeleteObject|PutBucketPolicy|FULL_CONTROL|WRITE|obs:object:PutObject|obs:bucket:PutBucketPolicy)|(PutObject|DeleteObject|PutBucketPolicy|FULL_CONTROL|WRITE|obs:object:PutObject|obs:bucket:PutBucketPolicy).*(Anonymous|Everyone|\\\"Principal\\\"\\s*:\\s*\\\"\\*\\\"|AllUsers))" },
92
- { "field": "text", "regex": "(-acl\\s*=?\\s*public-read-write|acl\\s*[=:]\\s*[\\\"']?public-read-write|public-write)" }
101
+ {
102
+ "field": "text",
103
+ "regex": "((Anonymous|Everyone|\\\"Principal\\\"\\s*:\\s*\\\"\\*\\\"|AllUsers).*(PutObject|DeleteObject|PutBucketPolicy|FULL_CONTROL|WRITE|obs:object:PutObject|obs:bucket:PutBucketPolicy)|(PutObject|DeleteObject|PutBucketPolicy|FULL_CONTROL|WRITE|obs:object:PutObject|obs:bucket:PutBucketPolicy).*(Anonymous|Everyone|\\\"Principal\\\"\\s*:\\s*\\\"\\*\\\"|AllUsers))"
104
+ },
105
+ {
106
+ "field": "text",
107
+ "regex": "(-acl\\s*=?\\s*public-read-write|acl\\s*[=:]\\s*[\\\"']?public-read-write|public-write)"
108
+ }
93
109
  ]
94
110
  },
95
111
  "message": "The change may grant anonymous write or full-control access to OBS data.",
@@ -104,7 +120,10 @@
104
120
  "match": {
105
121
  "all": [
106
122
  { "field": "text", "regex": "(FunctionGraph|APIG|CreateTrigger|CreateApi|DEDICATEDGATEWAY|API Gateway)" },
107
- { "field": "text", "regex": "(public|PUBLIC|0\\.0\\.0\\.0\\s*/\\s*0|auth[\\\"']?\\s*[=:]\\s*[\\\"']?(NONE|none|false)|security_authentication[\\\"']?\\s*[=:]\\s*[\\\"']?(NONE|none))" }
123
+ {
124
+ "field": "text",
125
+ "regex": "(public|PUBLIC|0\\.0\\.0\\.0\\s*/\\s*0|auth[\\\"']?\\s*[=:]\\s*[\\\"']?(NONE|none|false)|security_authentication[\\\"']?\\s*[=:]\\s*[\\\"']?(NONE|none))"
126
+ }
108
127
  ]
109
128
  },
110
129
  "message": "The generated FunctionGraph or API Gateway path may be publicly reachable without authentication.",
@@ -119,7 +138,10 @@
119
138
  "match": {
120
139
  "all": [
121
140
  { "field": "text", "regex": "(IAM|policy|role|agency|Statement|Action)" },
122
- { "field": "text", "regex": "(\\\"Action\\\"\\s*:\\s*(\\\"(\\*|\\*:\\*)\\\"|\\[\\s*\\\"(\\*|\\*:\\*)\\\")|Action\\s*[=:]\\s*(\\*|\\*:\\*)|AdministratorAccess|FullAccess)" },
141
+ {
142
+ "field": "text",
143
+ "regex": "(\\\"Action\\\"\\s*:\\s*(\\\"(\\*|\\*:\\*)\\\"|\\[\\s*\\\"(\\*|\\*:\\*)\\\")|Action\\s*[=:]\\s*(\\*|\\*:\\*)|AdministratorAccess|FullAccess)"
144
+ },
123
145
  { "field": "text", "regex": "(\\\"Effect\\\"\\s*:\\s*\\\"Allow\\\"|Effect\\s*[=:]\\s*Allow)" }
124
146
  ]
125
147
  },
@@ -149,7 +171,10 @@
149
171
  "stages": ["artifact", "deploy_plan"],
150
172
  "match": {
151
173
  "all": [
152
- { "field": "text", "regex": "(sandbox|preview|temporary|ephemeral|dev environment|FunctionGraph|ECS|CCE|APIG)" },
174
+ {
175
+ "field": "text",
176
+ "regex": "(sandbox|preview|temporary|ephemeral|dev environment|FunctionGraph|ECS|CCE|APIG)"
177
+ },
153
178
  { "field": "text", "regex": "(Create|Deploy|Provision|resource|stack|environment)" }
154
179
  ],
155
180
  "none": [
@@ -167,7 +192,10 @@
167
192
  "stages": ["command", "artifact", "deploy_plan"],
168
193
  "match": {
169
194
  "any": [
170
- { "field": "text", "regex": "(max_instances|max_node_count|max_replica|desired\\s*[=:]\\s*[5-9][0-9]|replicas\\s*[=:]\\s*[5-9][0-9])" },
195
+ {
196
+ "field": "text",
197
+ "regex": "(max_instances|max_node_count|max_replica|desired\\s*[=:]\\s*[5-9][0-9]|replicas\\s*[=:]\\s*[5-9][0-9])"
198
+ },
171
199
  { "field": "text", "regex": "(GPU|gpu|large|xlarge|charging_mode\\s*[=:]\\s*prePaid|period_type|period_num)" }
172
200
  ]
173
201
  },