huaweicloud-devkit 1.1.2-next.0 → 1.1.2-next.2
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.
- package/.agents/plugins/marketplace.json +18 -18
- package/README.md +182 -38
- package/README.zh-CN.md +180 -36
- package/bin/dsh-postinstall.cjs +77 -0
- package/bin/setup.cjs +7 -4
- package/cordis.patch.yml +13 -0
- package/integrations/atomcode/hooks/huaweicloud-telemetry.js +181 -0
- package/integrations/atomcode/hooks.json +9 -0
- package/integrations/dsh/hook-plugin.mjs +148 -0
- package/integrations/hermes/hooks/huaweicloud-telemetry.py +238 -0
- package/integrations/hermes/manifest.yaml +43 -0
- package/integrations/opencode/hooks/skill-tracker.js +115 -0
- package/integrations/opencode/opencode.json +1 -4
- package/integrations/workbuddy/hooks/telemetry-tracker.py +226 -0
- package/package.json +74 -43
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +23 -33
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
- package/plugins/huaweicloud-core/.mcp.json +2 -5
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
- package/plugins/huaweicloud-core/assets/icon.png +0 -0
- package/plugins/huaweicloud-core/assets/logo-dark.png +0 -0
- package/plugins/huaweicloud-core/assets/logo.png +0 -0
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +104 -28
- package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
- package/plugins/huaweicloud-core/safety/policy.json +75 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +196 -35
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +38 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +38 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +40 -31
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +45 -37
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +57 -6
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/hc-activity.md +27 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +44 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iac/SKILL.md +93 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/architectures.md +83 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/resource-catalog.md +107 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/state-file.md +104 -0
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +33 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +46 -45
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +71 -61
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +776 -44
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +84 -0
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +100 -0
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +36 -29
- package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +57 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +22 -15
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +23 -20
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +21 -2
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +30 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +68 -54
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +36 -34
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +142 -5
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +217 -5
- package/plugins/huaweicloud-core/src/auth/reconcile.mjs +174 -0
- package/plugins/huaweicloud-core/src/auth/service.mjs +57 -2
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/detect-framework.mjs +366 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +203 -16
- package/plugins/huaweicloud-core/src/icon-library.mjs +176 -0
- package/plugins/huaweicloud-core/src/mcp-protocol.mjs +88 -0
- package/plugins/huaweicloud-core/src/mcp-server-remote.mjs +107 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +154 -99
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +20 -102
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +11 -4
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
- package/plugins/huaweicloud-core/src/safety-policy.mjs +123 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +48 -12
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +25 -26
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +943 -10
- package/plugins/huaweicloud-core/src/sandbox/uninstall-cleanup.mjs +50 -0
- package/plugins/huaweicloud-core/src/search-market.mjs +49 -14
- package/plugins/huaweicloud-core/src/setup-cli.mjs +3091 -498
- package/plugins/huaweicloud-core/src/telemetry/agent-detect.mjs +40 -0
- package/plugins/huaweicloud-core/src/telemetry/agent-registry.mjs +328 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry.mjs +378 -0
- package/plugins/huaweicloud-core/src/tools.mjs +1272 -146
- package/plugins/huaweicloud-core/src/update-check.mjs +383 -0
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +13 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +268 -0
- package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +40 -13
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +0 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +0 -124
|
@@ -1,100 +1,76 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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,8 +9,14 @@
|
|
|
9
9
|
"stages": ["command"],
|
|
10
10
|
"match": {
|
|
11
11
|
"any": [
|
|
12
|
-
{
|
|
13
|
-
|
|
12
|
+
{
|
|
13
|
+
"field": "text",
|
|
14
|
+
"regex": "(^|\\s)(cat|type|Get-Content|gc|less|more)\\s+[^\\n]*(\\.hcloud|\\.huaweicloud)"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"field": "text",
|
|
18
|
+
"regex": "(hcloud|huaweicloud)[/\\\\](config|credentials)"
|
|
19
|
+
}
|
|
14
20
|
]
|
|
15
21
|
},
|
|
16
22
|
"message": "The command may read local Huawei Cloud credential or profile files into the agent context.",
|
|
@@ -24,8 +30,14 @@
|
|
|
24
30
|
"stages": ["command"],
|
|
25
31
|
"match": {
|
|
26
32
|
"all": [
|
|
27
|
-
{
|
|
28
|
-
|
|
33
|
+
{
|
|
34
|
+
"field": "text",
|
|
35
|
+
"regex": "(^|\\s)(env|printenv|Get-ChildItem\\s+Env:|gci\\s+Env:|dir\\s+Env:)"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"field": "text",
|
|
39
|
+
"regex": "(HUAWEICLOUD|HWC_|HCLOUD|OS_)"
|
|
40
|
+
}
|
|
29
41
|
]
|
|
30
42
|
},
|
|
31
43
|
"message": "The command may print cloud credential environment variables.",
|
|
@@ -39,13 +51,36 @@
|
|
|
39
51
|
"stages": ["command"],
|
|
40
52
|
"match": {
|
|
41
53
|
"any": [
|
|
42
|
-
{
|
|
43
|
-
|
|
54
|
+
{
|
|
55
|
+
"field": "text",
|
|
56
|
+
"regex": "(ShowSecretVersion|DownloadSecret|GetSecretValue)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"field": "text",
|
|
60
|
+
"regex": "(secret_string|secret_binary|secretString|secretBinary)"
|
|
61
|
+
}
|
|
44
62
|
]
|
|
45
63
|
},
|
|
46
64
|
"message": "The command appears to retrieve plaintext secret values.",
|
|
47
65
|
"remediation": "Use runtime secret references, user-side inspection, or redacted metadata checks instead of returning secret values to the agent."
|
|
48
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"id": "hwc-command-sts-credential",
|
|
69
|
+
"title": "Temporary credential exposure",
|
|
70
|
+
"category": "credential",
|
|
71
|
+
"severity": "warn",
|
|
72
|
+
"stages": ["command"],
|
|
73
|
+
"match": {
|
|
74
|
+
"any": [
|
|
75
|
+
{
|
|
76
|
+
"field": "text",
|
|
77
|
+
"regex": "hcloud\\s+STS\\s+(AssumeAgency|GetCallerIdentity|GetTemporaryCredential)\\b"
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"message": "此操作将返回临时 AK/SK 和 SecurityToken。注意敏感数据保密,不要将凭证输出到日志或分享给第三方。",
|
|
82
|
+
"remediation": "临时凭证仅用于当前会话,使用完毕后及时销毁,不要持久化存储。"
|
|
83
|
+
},
|
|
49
84
|
{
|
|
50
85
|
"id": "hwc-command-encoded-shell-exec",
|
|
51
86
|
"title": "Encoded payload piped to shell",
|
|
@@ -54,9 +89,18 @@
|
|
|
54
89
|
"stages": ["command"],
|
|
55
90
|
"match": {
|
|
56
91
|
"all": [
|
|
57
|
-
{
|
|
58
|
-
|
|
59
|
-
|
|
92
|
+
{
|
|
93
|
+
"field": "text",
|
|
94
|
+
"regex": "(base64\\s+(-d|--decode)|xxd\\s+-r|certutil\\s+-decode|FromBase64String|hex\\s*decode)"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"field": "text",
|
|
98
|
+
"regex": "(\\||;|&&)"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"field": "text",
|
|
102
|
+
"regex": "\\b(bash|sh|zsh|powershell|pwsh|cmd|python|node)\\b"
|
|
103
|
+
}
|
|
60
104
|
]
|
|
61
105
|
},
|
|
62
106
|
"message": "The command decodes an encoded payload and pipes it into an interpreter.",
|
|
@@ -70,11 +114,17 @@
|
|
|
70
114
|
"stages": ["command", "artifact", "deploy_plan"],
|
|
71
115
|
"match": {
|
|
72
116
|
"all": [
|
|
73
|
-
{
|
|
74
|
-
|
|
117
|
+
{
|
|
118
|
+
"field": "text",
|
|
119
|
+
"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)"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"field": "text",
|
|
123
|
+
"regex": "\\b(22|3389|3306|5432|6379|9200|27017|1433|2375|2376|5900|11211|8080|8443)\\b"
|
|
124
|
+
}
|
|
75
125
|
]
|
|
76
126
|
},
|
|
77
|
-
"message": "The change appears to expose an administrative or database port to the public internet.",
|
|
127
|
+
"message": "The change appears to expose an administrative or database port to the public internet. Web ports (80/443) are allowed - this rule only covers admin/database ports.",
|
|
78
128
|
"remediation": "Restrict the source CIDR to a trusted range, use a bastion or VPN, and keep public preview endpoints behind authenticated HTTP services."
|
|
79
129
|
},
|
|
80
130
|
{
|
|
@@ -85,11 +135,20 @@
|
|
|
85
135
|
"stages": ["command", "artifact", "deploy_plan"],
|
|
86
136
|
"match": {
|
|
87
137
|
"all": [
|
|
88
|
-
{
|
|
138
|
+
{
|
|
139
|
+
"field": "text",
|
|
140
|
+
"regex": "(OBS|obs://|bucket|object|Statement|Principal)"
|
|
141
|
+
}
|
|
89
142
|
],
|
|
90
143
|
"any": [
|
|
91
|
-
{
|
|
92
|
-
|
|
144
|
+
{
|
|
145
|
+
"field": "text",
|
|
146
|
+
"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))"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"field": "text",
|
|
150
|
+
"regex": "(-acl\\s*=?\\s*public-read-write|acl\\s*[=:]\\s*[\\\"']?public-read-write|public-write)"
|
|
151
|
+
}
|
|
93
152
|
]
|
|
94
153
|
},
|
|
95
154
|
"message": "The change may grant anonymous write or full-control access to OBS data.",
|
|
@@ -103,8 +162,14 @@
|
|
|
103
162
|
"stages": ["command", "artifact", "deploy_plan"],
|
|
104
163
|
"match": {
|
|
105
164
|
"all": [
|
|
106
|
-
{
|
|
107
|
-
|
|
165
|
+
{
|
|
166
|
+
"field": "text",
|
|
167
|
+
"regex": "(FunctionGraph|APIG|CreateTrigger|CreateApi|DEDICATEDGATEWAY|API Gateway)"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"field": "text",
|
|
171
|
+
"regex": "(public|PUBLIC|0\\.0\\.0\\.0\\s*/\\s*0|auth[\\\"']?\\s*[=:]\\s*[\\\"']?(NONE|none|false)|security_authentication[\\\"']?\\s*[=:]\\s*[\\\"']?(NONE|none))"
|
|
172
|
+
}
|
|
108
173
|
]
|
|
109
174
|
},
|
|
110
175
|
"message": "The generated FunctionGraph or API Gateway path may be publicly reachable without authentication.",
|
|
@@ -118,9 +183,18 @@
|
|
|
118
183
|
"stages": ["command", "artifact", "deploy_plan"],
|
|
119
184
|
"match": {
|
|
120
185
|
"all": [
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
186
|
+
{
|
|
187
|
+
"field": "text",
|
|
188
|
+
"regex": "(IAM|policy|role|agency|Statement|Action)"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"field": "text",
|
|
192
|
+
"regex": "(\\\"Action\\\"\\s*:\\s*(\\\"(\\*|\\*:\\*)\\\"|\\[\\s*\\\"(\\*|\\*:\\*)\\\")|Action\\s*[=:]\\s*(\\*|\\*:\\*)|AdministratorAccess|FullAccess)"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"field": "text",
|
|
196
|
+
"regex": "(\\\"Effect\\\"\\s*:\\s*\\\"Allow\\\"|Effect\\s*[=:]\\s*Allow)"
|
|
197
|
+
}
|
|
124
198
|
]
|
|
125
199
|
},
|
|
126
200
|
"message": "The change appears to grant broad administrator permissions.",
|
|
@@ -134,13 +208,61 @@
|
|
|
134
208
|
"stages": ["command"],
|
|
135
209
|
"match": {
|
|
136
210
|
"all": [
|
|
137
|
-
{
|
|
138
|
-
|
|
211
|
+
{
|
|
212
|
+
"field": "text",
|
|
213
|
+
"regex": "(Delete|BatchDelete|Remove|\\brm\\b|delete)"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"field": "text",
|
|
217
|
+
"regex": "(\\s--force|\\s-f\\s|\\s--recursive|\\s-r\\s)"
|
|
218
|
+
}
|
|
139
219
|
]
|
|
140
220
|
},
|
|
141
221
|
"message": "The command combines deletion with force, recursive, or cascading deletion behavior.",
|
|
142
222
|
"remediation": "Show the exact resources to be deleted, confirm backups or recovery path, and require explicit user approval for the exact command."
|
|
143
223
|
},
|
|
224
|
+
{
|
|
225
|
+
"id": "hwc-destructive-delete-operation",
|
|
226
|
+
"title": "Destructive cloud resource operation",
|
|
227
|
+
"category": "destructive",
|
|
228
|
+
"severity": "warn",
|
|
229
|
+
"stages": ["command"],
|
|
230
|
+
"match": {
|
|
231
|
+
"any": [
|
|
232
|
+
{
|
|
233
|
+
"field": "text",
|
|
234
|
+
"regex": "hcloud\\s+\\w+\\s+(Delete\\w*|Detach\\w*|Remove\\w*|Dissociate\\w*|Unassign\\w*|Revoke\\w*)\\b"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"field": "text",
|
|
238
|
+
"regex": "hcloud\\s+\\w+\\s+(BatchDelete\\w*|BatchRemove\\w*)\\b"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
241
|
+
},
|
|
242
|
+
"message": "This hcloud command will delete, detach, or remove cloud resources. The operation may be irreversible.",
|
|
243
|
+
"remediation": "List the resources to be affected first, confirm with the user, and require explicit approval before executing any destructive operation."
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"id": "hwc-destructive-delete-cascade",
|
|
247
|
+
"title": "Cascading cloud resource deletion",
|
|
248
|
+
"category": "destructive",
|
|
249
|
+
"severity": "warn",
|
|
250
|
+
"stages": ["command"],
|
|
251
|
+
"match": {
|
|
252
|
+
"all": [
|
|
253
|
+
{
|
|
254
|
+
"field": "text",
|
|
255
|
+
"regex": "(Delete|BatchDelete|Remove|\\brm\\b|delete)"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"field": "text",
|
|
259
|
+
"regex": "(delete_publicip\\s*[=:]\\s*true|delete_volume\\s*[=:]\\s*true)"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"message": "This delete command will also remove associated resources (EIP, volume). Check that these should be deleted together.",
|
|
264
|
+
"remediation": "Confirm with the user whether to delete the associated resources, or set delete_publicip/delete_volume to false to keep them."
|
|
265
|
+
},
|
|
144
266
|
{
|
|
145
267
|
"id": "hwc-sandbox-missing-ttl",
|
|
146
268
|
"title": "Sandbox deployment missing cleanup metadata",
|
|
@@ -149,11 +271,20 @@
|
|
|
149
271
|
"stages": ["artifact", "deploy_plan"],
|
|
150
272
|
"match": {
|
|
151
273
|
"all": [
|
|
152
|
-
{
|
|
153
|
-
|
|
274
|
+
{
|
|
275
|
+
"field": "text",
|
|
276
|
+
"regex": "(sandbox|preview|temporary|ephemeral|dev environment|FunctionGraph|ECS|CCE|APIG)"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"field": "text",
|
|
280
|
+
"regex": "(Create|Deploy|Provision|resource|stack|environment)"
|
|
281
|
+
}
|
|
154
282
|
],
|
|
155
283
|
"none": [
|
|
156
|
-
{
|
|
284
|
+
{
|
|
285
|
+
"field": "text",
|
|
286
|
+
"regex": "(ttl|expires_at|expire_at|cleanup|owner|cost_center|auto_delete|auto-delete)"
|
|
287
|
+
}
|
|
157
288
|
]
|
|
158
289
|
},
|
|
159
290
|
"message": "The preview or sandbox deployment does not show cleanup or ownership metadata.",
|
|
@@ -167,8 +298,14 @@
|
|
|
167
298
|
"stages": ["command", "artifact", "deploy_plan"],
|
|
168
299
|
"match": {
|
|
169
300
|
"any": [
|
|
170
|
-
{
|
|
171
|
-
|
|
301
|
+
{
|
|
302
|
+
"field": "text",
|
|
303
|
+
"regex": "(max_instances|max_node_count|max_replica|desired\\s*[=:]\\s*[5-9][0-9]|replicas\\s*[=:]\\s*[5-9][0-9])"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"field": "text",
|
|
307
|
+
"regex": "(GPU|gpu|large|xlarge|charging_mode\\s*[=:]\\s*prePaid|period_type|period_num)"
|
|
308
|
+
}
|
|
172
309
|
]
|
|
173
310
|
},
|
|
174
311
|
"message": "The generated plan may create high-cost or unbounded capacity.",
|
|
@@ -182,14 +319,38 @@
|
|
|
182
319
|
"stages": ["command"],
|
|
183
320
|
"match": {
|
|
184
321
|
"any": [
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
322
|
+
{
|
|
323
|
+
"field": "text",
|
|
324
|
+
"regex": "rm\\s+-rf\\s+/"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"field": "text",
|
|
328
|
+
"regex": "mkfs"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"field": "text",
|
|
332
|
+
"regex": "dd\\s+if="
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"field": "text",
|
|
336
|
+
"regex": ":\\\\(\\\\)\\\\{[^}]*\\\\|[^}]*&[^}]*\\\\}[^;]*;:"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"field": "text",
|
|
340
|
+
"regex": "\\bshutdown\\b"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"field": "text",
|
|
344
|
+
"regex": "\\breboot\\b"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"field": "text",
|
|
348
|
+
"regex": "\\binit\\s+[06]\\b"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"field": "text",
|
|
352
|
+
"regex": "\\bfdisk\\b"
|
|
353
|
+
}
|
|
193
354
|
]
|
|
194
355
|
},
|
|
195
356
|
"message": "The sandbox terminal command is destructively dangerous and could destroy the workspace.",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-apig
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating or managing API Gateway (APIG). Covers API creation, throttling, auth (IAM/APP/basic), CORS, publishing, instance management. Triggers: APIG, API gateway, throttling, publish API. NOT for: FunctionGraph triggers (use huawei-functiongraph).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,6 +8,10 @@ version: 1
|
|
|
8
8
|
|
|
9
9
|
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
10
|
|
|
11
|
+
## Deployment Routing Guard
|
|
12
|
+
|
|
13
|
+
If this skill was reached via a DEPLOYMENT intent (the gateway instance is part of an application deployment, not a standalone ad-hoc operation), this is a cloud resource purchase: load `huawei-iac` first for orchestration (mandatory cost+balance gate, batch approval, session state, ordered destroy), then return here for the exact instance/API commands. Sandbox-deployed workloads (huawei-sandbox) bypass iac - no purchase involved.
|
|
14
|
+
|
|
11
15
|
## Overview
|
|
12
16
|
|
|
13
17
|
Domain expertise for Huawei Cloud API Gateway (APIG). Covers instance lifecycle, API group/API creation, publishing, and FunctionGraph trigger integration.
|
|
@@ -16,16 +20,16 @@ Always discover parameters with `hcloud APIG <Operation> --help` before executin
|
|
|
16
20
|
|
|
17
21
|
## Critical Warnings
|
|
18
22
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| API group region-locked
|
|
22
|
-
| Throttling per-API default
|
|
23
|
-
| CORS must be explicit
|
|
24
|
-
| `BASIC` spec has no public IP
|
|
25
|
-
| Instance creation takes 5-15min
|
|
26
|
-
| `sl_domain` is from API **Group** | NOT from Instance. Get it from `CreateApiGroupV2` or `ListApiGroupsV2` response
|
|
27
|
-
| API name must NOT have hyphens
|
|
28
|
-
| VPC params need prefix
|
|
23
|
+
| Trap | Why |
|
|
24
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| API group region-locked | Cannot move across regions |
|
|
26
|
+
| Throttling per-API default | Use app-level quotas for per-user limits |
|
|
27
|
+
| CORS must be explicit | OPTIONS preflight fails until configured |
|
|
28
|
+
| `BASIC` spec has no public IP | Use `PROFESSIONAL` + `elb` provider for public access |
|
|
29
|
+
| Instance creation takes 5-15min | Long-running async operation. State is **Running** (NOT "SUCCESS"). Poll with `ListInstancesV2`, wait for `status == "Running"` |
|
|
30
|
+
| `sl_domain` is from API **Group** | NOT from Instance. Get it from `CreateApiGroupV2` or `ListApiGroupsV2` response |
|
|
31
|
+
| API name must NOT have hyphens | `[a-zA-Z0-9_]+` only. Hyphens cause regex validation failure |
|
|
32
|
+
| VPC params need prefix | `--vpc.name=<n>` / `--subnet.vpc_id=<id>` / `--security_group.name=<n>` with KooCLI 7.x |
|
|
29
33
|
|
|
30
34
|
## Instance Management
|
|
31
35
|
|
|
@@ -43,14 +47,14 @@ hcloud APIG CreateInstanceV2 --help
|
|
|
43
47
|
|
|
44
48
|
Key gotchas when creating:
|
|
45
49
|
|
|
46
|
-
| Param
|
|
47
|
-
|
|
48
|
-
| `--spec_id`
|
|
49
|
-
| `--loadbalancer_provider` | `elb` for public access (supports `AddIngressEipV2`), `lvs` for internal only (supports `AddEipV2`)
|
|
50
|
-
| `--enterprise_project_id` | **Required** for enterprise accounts. Use `"0"` for default project
|
|
51
|
-
| `--available_zone_ids`
|
|
52
|
-
| `--vpc_id`, `--subnet_id` | Must exist in the target region
|
|
53
|
-
| `--security_group_id`
|
|
50
|
+
| Param | Note |
|
|
51
|
+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `--spec_id` | `BASIC` (no public access), `PROFESSIONAL` (requires `--loadbalancer_provider`) |
|
|
53
|
+
| `--loadbalancer_provider` | `elb` for public access (supports `AddIngressEipV2`), `lvs` for internal only (supports `AddEipV2`) |
|
|
54
|
+
| `--enterprise_project_id` | **Required** for enterprise accounts. Use `"0"` for default project |
|
|
55
|
+
| `--available_zone_ids` | Use AZ code like `ap-southeast-3a`, NOT UUID from `ListAvailableZonesV2` |
|
|
56
|
+
| `--vpc_id`, `--subnet_id` | Must exist in the target region |
|
|
57
|
+
| `--security_group_id` | **Required**. Create a security group first via `VPC CreateSecurityGroup` (VPC v3 API — no `vpc_id` param needed) |
|
|
54
58
|
|
|
55
59
|
### Add Public Access (ELB Provider Only)
|
|
56
60
|
|
|
@@ -89,9 +93,9 @@ Wait for `eip_address` to show a valid IP (may take up to 2 minutes). If `eip_ad
|
|
|
89
93
|
hcloud APIG CreateApiGroupV2 --instance_id=<id> --name=<n>
|
|
90
94
|
```
|
|
91
95
|
|
|
92
|
-
| Param
|
|
93
|
-
|
|
94
|
-
| `--name`
|
|
96
|
+
| Param | Note |
|
|
97
|
+
| ---------- | ---------------------- |
|
|
98
|
+
| `--name` | Group name (required) |
|
|
95
99
|
| `--remark` | Description (optional) |
|
|
96
100
|
|
|
97
101
|
## API Management
|
|
@@ -120,18 +124,18 @@ hcloud APIG CreateThrottlingPolicyV2 --name=<n> --api_call_limits=1000
|
|
|
120
124
|
|
|
121
125
|
## Common Workflows
|
|
122
126
|
|
|
123
|
-
| Task
|
|
124
|
-
|
|
125
|
-
| List instances
|
|
126
|
-
| Create instance
|
|
127
|
-
| Delete instance
|
|
128
|
-
| Add public EIP
|
|
129
|
-
| Create API group | `CreateApiGroupV2`
|
|
130
|
-
| Create API
|
|
131
|
-
| Update API
|
|
132
|
-
| List APIs
|
|
133
|
-
| Publish
|
|
134
|
-
| List APIs
|
|
127
|
+
| Task | Operation |
|
|
128
|
+
| ---------------- | -------------------------------------------- |
|
|
129
|
+
| List instances | `ListInstancesV2` |
|
|
130
|
+
| Create instance | `CreateInstanceV2` |
|
|
131
|
+
| Delete instance | `DeleteInstancesV2` |
|
|
132
|
+
| Add public EIP | `AddIngressEipV2` |
|
|
133
|
+
| Create API group | `CreateApiGroupV2` |
|
|
134
|
+
| Create API | `CreateApiV2` |
|
|
135
|
+
| Update API | `UpdateApiV2` — change auth mode, path, etc. |
|
|
136
|
+
| List APIs | `ListApisV2` |
|
|
137
|
+
| Publish | `BatchPublishOrOfflineApiV2` |
|
|
138
|
+
| List APIs | `ListApisV2` |
|
|
135
139
|
|
|
136
140
|
## FunctionGraph Integration
|
|
137
141
|
|