huaweicloud-devkit 1.0.2-dev.8 → 1.0.2-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 (97) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +163 -138
  4. package/README.zh-CN.md +161 -138
  5. package/bin/setup.cjs +8 -8
  6. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  7. package/integrations/opencode/opencode.json +14 -14
  8. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
  9. package/package.json +46 -44
  10. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +44 -44
  11. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +43 -43
  12. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +44 -44
  13. package/plugins/huaweicloud-core/.mcp.json +15 -15
  14. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +44 -44
  15. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  16. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +136 -136
  17. package/plugins/huaweicloud-core/safety/policy.json +99 -100
  18. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +199 -199
  19. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +164 -164
  20. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  21. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  22. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
  23. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +90 -90
  24. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +190 -190
  25. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +124 -124
  26. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  27. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  28. package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +56 -56
  29. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
  30. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
  31. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +185 -185
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +133 -133
  34. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  35. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +55 -55
  36. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +131 -131
  38. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
  39. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
  40. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  41. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  42. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  43. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
  44. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  45. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +122 -122
  46. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +56 -56
  47. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  48. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +133 -127
  49. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +49 -49
  50. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
  51. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +100 -100
  52. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +40 -40
  53. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  54. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +224 -224
  55. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +135 -131
  56. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  57. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +84 -84
  58. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
  59. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
  60. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +50 -50
  61. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  62. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +56 -56
  63. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  64. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +51 -47
  65. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  66. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +128 -127
  67. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  68. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +110 -95
  69. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  70. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
  71. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
  72. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +60 -60
  73. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  74. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  75. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  76. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +105 -87
  77. package/plugins/huaweicloud-core/src/auth/credentials.mjs +95 -95
  78. package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
  79. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
  80. package/plugins/huaweicloud-core/src/mcp-server.mjs +129 -129
  81. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +155 -0
  82. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +87 -0
  83. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +137 -137
  84. package/plugins/huaweicloud-core/src/safety-policy.mjs +302 -302
  85. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +91 -97
  86. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +162 -153
  87. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +112 -105
  88. package/plugins/huaweicloud-core/src/search-market.mjs +174 -169
  89. package/plugins/huaweicloud-core/src/setup-cli.mjs +2017 -1576
  90. package/plugins/huaweicloud-core/src/tools.mjs +1008 -1005
  91. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +427 -427
  92. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +132 -132
  93. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +227 -227
  94. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +202 -202
  95. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +158 -158
  96. package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
  97. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
@@ -1,199 +1,199 @@
1
- {
2
- "version": "0.1.0",
3
- "rules": [
4
- {
5
- "id": "hwc-command-credential-file",
6
- "title": "Credential file read",
7
- "category": "credential",
8
- "severity": "deny",
9
- "stages": ["command"],
10
- "match": {
11
- "any": [
12
- { "field": "text", "regex": "(^|\\s)(cat|type|Get-Content|gc|less|more)\\s+[^\\n]*(\\.hcloud|\\.huaweicloud)" },
13
- { "field": "text", "regex": "(hcloud|huaweicloud)[/\\\\](config|credentials)" }
14
- ]
15
- },
16
- "message": "The command may read local Huawei Cloud credential or profile files into the agent context.",
17
- "remediation": "Use huaweicloud_show_profile_redacted or user-side credential configuration instead of reading credential files."
18
- },
19
- {
20
- "id": "hwc-command-env-dump",
21
- "title": "Cloud credential environment dump",
22
- "category": "credential",
23
- "severity": "deny",
24
- "stages": ["command"],
25
- "match": {
26
- "all": [
27
- { "field": "text", "regex": "(^|\\s)(env|printenv|Get-ChildItem\\s+Env:|gci\\s+Env:|dir\\s+Env:)" },
28
- { "field": "text", "regex": "(HUAWEICLOUD|HWC_|HCLOUD|OS_)" }
29
- ]
30
- },
31
- "message": "The command may print cloud credential environment variables.",
32
- "remediation": "Inspect only required non-secret settings and redact secret-like values before returning output."
33
- },
34
- {
35
- "id": "hwc-command-secret-value-read",
36
- "title": "Plaintext secret read",
37
- "category": "secret",
38
- "severity": "deny",
39
- "stages": ["command"],
40
- "match": {
41
- "any": [
42
- { "field": "text", "regex": "(ShowSecretVersion|DownloadSecret|GetSecretValue)" },
43
- { "field": "text", "regex": "(secret_string|secret_binary|secretString|secretBinary)" }
44
- ]
45
- },
46
- "message": "The command appears to retrieve plaintext secret values.",
47
- "remediation": "Use runtime secret references, user-side inspection, or redacted metadata checks instead of returning secret values to the agent."
48
- },
49
- {
50
- "id": "hwc-command-encoded-shell-exec",
51
- "title": "Encoded payload piped to shell",
52
- "category": "execution",
53
- "severity": "deny",
54
- "stages": ["command"],
55
- "match": {
56
- "all": [
57
- { "field": "text", "regex": "(base64\\s+(-d|--decode)|xxd\\s+-r|certutil\\s+-decode|FromBase64String|hex\\s*decode)" },
58
- { "field": "text", "regex": "(\\||;|&&)" },
59
- { "field": "text", "regex": "\\b(bash|sh|zsh|powershell|pwsh|cmd|python|node)\\b" }
60
- ]
61
- },
62
- "message": "The command decodes an encoded payload and pipes it into an interpreter.",
63
- "remediation": "Decode payloads into a reviewable file first, inspect the content, then execute only explicit reviewed commands."
64
- },
65
- {
66
- "id": "hwc-network-public-admin-port",
67
- "title": "Public admin port exposure",
68
- "category": "public_exposure",
69
- "severity": "deny",
70
- "stages": ["command", "artifact", "deploy_plan"],
71
- "match": {
72
- "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)" }
75
- ]
76
- },
77
- "message": "The change appears to expose an administrative or database port to the public internet.",
78
- "remediation": "Restrict the source CIDR to a trusted range, use a bastion or VPN, and keep public preview endpoints behind authenticated HTTP services."
79
- },
80
- {
81
- "id": "hwc-obs-anonymous-write",
82
- "title": "OBS anonymous write",
83
- "category": "public_exposure",
84
- "severity": "deny",
85
- "stages": ["command", "artifact", "deploy_plan"],
86
- "match": {
87
- "all": [
88
- { "field": "text", "regex": "(OBS|obs://|bucket|object|Statement|Principal)" }
89
- ],
90
- "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)" }
93
- ]
94
- },
95
- "message": "The change may grant anonymous write or full-control access to OBS data.",
96
- "remediation": "Use private buckets by default. Grant object read only when required, and avoid anonymous write permissions."
97
- },
98
- {
99
- "id": "hwc-functiongraph-public-no-auth",
100
- "title": "Public FunctionGraph trigger without auth",
101
- "category": "public_exposure",
102
- "severity": "warn",
103
- "stages": ["command", "artifact", "deploy_plan"],
104
- "match": {
105
- "all": [
106
- { "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))" }
108
- ]
109
- },
110
- "message": "The generated FunctionGraph or API Gateway path may be publicly reachable without authentication.",
111
- "remediation": "Require IAM, app authentication, JWT, or another explicit auth layer before exposing generated application endpoints."
112
- },
113
- {
114
- "id": "hwc-iam-admin-policy",
115
- "title": "Broad IAM administrator grant",
116
- "category": "iam",
117
- "severity": "deny",
118
- "stages": ["command", "artifact", "deploy_plan"],
119
- "match": {
120
- "all": [
121
- { "field": "text", "regex": "(IAM|policy|role|agency|Statement|Action)" },
122
- { "field": "text", "regex": "(\\\"Action\\\"\\s*:\\s*(\\\"(\\*|\\*:\\*)\\\"|\\[\\s*\\\"(\\*|\\*:\\*)\\\")|Action\\s*[=:]\\s*(\\*|\\*:\\*)|AdministratorAccess|FullAccess)" },
123
- { "field": "text", "regex": "(\\\"Effect\\\"\\s*:\\s*\\\"Allow\\\"|Effect\\s*[=:]\\s*Allow)" }
124
- ]
125
- },
126
- "message": "The change appears to grant broad administrator permissions.",
127
- "remediation": "Use least-privilege service actions, resource constraints, and short-lived credentials for generated application workflows."
128
- },
129
- {
130
- "id": "hwc-destructive-delete-force",
131
- "title": "Forced destructive operation",
132
- "category": "destructive",
133
- "severity": "deny",
134
- "stages": ["command"],
135
- "match": {
136
- "all": [
137
- { "field": "text", "regex": "(Delete|BatchDelete|Remove|\\brm\\b|delete)" },
138
- { "field": "text", "regex": "(--force|-f|--recursive|-r|delete_publicip\\s*[=:]\\s*true)" }
139
- ]
140
- },
141
- "message": "The command combines deletion with force, recursive, or cascading deletion behavior.",
142
- "remediation": "Show the exact resources to be deleted, confirm backups or recovery path, and require explicit user approval for the exact command."
143
- },
144
- {
145
- "id": "hwc-sandbox-missing-ttl",
146
- "title": "Sandbox deployment missing cleanup metadata",
147
- "category": "sandbox",
148
- "severity": "warn",
149
- "stages": ["artifact", "deploy_plan"],
150
- "match": {
151
- "all": [
152
- { "field": "text", "regex": "(sandbox|preview|temporary|ephemeral|dev environment|FunctionGraph|ECS|CCE|APIG)" },
153
- { "field": "text", "regex": "(Create|Deploy|Provision|resource|stack|environment)" }
154
- ],
155
- "none": [
156
- { "field": "text", "regex": "(ttl|expires_at|expire_at|cleanup|owner|cost_center|auto_delete|auto-delete)" }
157
- ]
158
- },
159
- "message": "The preview or sandbox deployment does not show cleanup or ownership metadata.",
160
- "remediation": "Add owner, purpose, expiration time, and cleanup command before creating preview cloud resources."
161
- },
162
- {
163
- "id": "hwc-cost-unbounded-scale",
164
- "title": "Unbounded scale or high-cost resource",
165
- "category": "cost",
166
- "severity": "warn",
167
- "stages": ["command", "artifact", "deploy_plan"],
168
- "match": {
169
- "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])" },
171
- { "field": "text", "regex": "(GPU|gpu|large|xlarge|charging_mode\\s*[=:]\\s*prePaid|period_type|period_num)" }
172
- ]
173
- },
174
- "message": "The generated plan may create high-cost or unbounded capacity.",
175
- "remediation": "Use small preview defaults, explicit quotas, budget labels, and user approval before creating high-cost resources."
176
- },
177
- {
178
- "id": "hwc-sandbox-destructive-command",
179
- "title": "Destructive command in sandbox terminal",
180
- "category": "destructive",
181
- "severity": "deny",
182
- "stages": ["command"],
183
- "match": {
184
- "any": [
185
- { "field": "text", "regex": "rm\\s+-rf\\s+/" },
186
- { "field": "text", "regex": "mkfs" },
187
- { "field": "text", "regex": "dd\\s+if=" },
188
- { "field": "text", "regex": ":\\\\(\\\\)\\\\{[^}]*\\\\|[^}]*&[^}]*\\\\}[^;]*;:" },
189
- { "field": "text", "regex": "\\bshutdown\\b" },
190
- { "field": "text", "regex": "\\breboot\\b" },
191
- { "field": "text", "regex": "\\binit\\s+[06]\\b" },
192
- { "field": "text", "regex": "\\bfdisk\\b" }
193
- ]
194
- },
195
- "message": "The sandbox terminal command is destructively dangerous and could destroy the workspace.",
196
- "remediation": "Use targeted deletions instead of recursive root removal. Avoid disk format, fork bombs, and system shutdown commands in sandbox terminals."
197
- }
198
- ]
199
- }
1
+ {
2
+ "version": "0.1.0",
3
+ "rules": [
4
+ {
5
+ "id": "hwc-command-credential-file",
6
+ "title": "Credential file read",
7
+ "category": "credential",
8
+ "severity": "deny",
9
+ "stages": ["command"],
10
+ "match": {
11
+ "any": [
12
+ { "field": "text", "regex": "(^|\\s)(cat|type|Get-Content|gc|less|more)\\s+[^\\n]*(\\.hcloud|\\.huaweicloud)" },
13
+ { "field": "text", "regex": "(hcloud|huaweicloud)[/\\\\](config|credentials)" }
14
+ ]
15
+ },
16
+ "message": "The command may read local Huawei Cloud credential or profile files into the agent context.",
17
+ "remediation": "Use huaweicloud_show_profile_redacted or user-side credential configuration instead of reading credential files."
18
+ },
19
+ {
20
+ "id": "hwc-command-env-dump",
21
+ "title": "Cloud credential environment dump",
22
+ "category": "credential",
23
+ "severity": "deny",
24
+ "stages": ["command"],
25
+ "match": {
26
+ "all": [
27
+ { "field": "text", "regex": "(^|\\s)(env|printenv|Get-ChildItem\\s+Env:|gci\\s+Env:|dir\\s+Env:)" },
28
+ { "field": "text", "regex": "(HUAWEICLOUD|HWC_|HCLOUD|OS_)" }
29
+ ]
30
+ },
31
+ "message": "The command may print cloud credential environment variables.",
32
+ "remediation": "Inspect only required non-secret settings and redact secret-like values before returning output."
33
+ },
34
+ {
35
+ "id": "hwc-command-secret-value-read",
36
+ "title": "Plaintext secret read",
37
+ "category": "secret",
38
+ "severity": "deny",
39
+ "stages": ["command"],
40
+ "match": {
41
+ "any": [
42
+ { "field": "text", "regex": "(ShowSecretVersion|DownloadSecret|GetSecretValue)" },
43
+ { "field": "text", "regex": "(secret_string|secret_binary|secretString|secretBinary)" }
44
+ ]
45
+ },
46
+ "message": "The command appears to retrieve plaintext secret values.",
47
+ "remediation": "Use runtime secret references, user-side inspection, or redacted metadata checks instead of returning secret values to the agent."
48
+ },
49
+ {
50
+ "id": "hwc-command-encoded-shell-exec",
51
+ "title": "Encoded payload piped to shell",
52
+ "category": "execution",
53
+ "severity": "deny",
54
+ "stages": ["command"],
55
+ "match": {
56
+ "all": [
57
+ { "field": "text", "regex": "(base64\\s+(-d|--decode)|xxd\\s+-r|certutil\\s+-decode|FromBase64String|hex\\s*decode)" },
58
+ { "field": "text", "regex": "(\\||;|&&)" },
59
+ { "field": "text", "regex": "\\b(bash|sh|zsh|powershell|pwsh|cmd|python|node)\\b" }
60
+ ]
61
+ },
62
+ "message": "The command decodes an encoded payload and pipes it into an interpreter.",
63
+ "remediation": "Decode payloads into a reviewable file first, inspect the content, then execute only explicit reviewed commands."
64
+ },
65
+ {
66
+ "id": "hwc-network-public-admin-port",
67
+ "title": "Public admin port exposure",
68
+ "category": "public_exposure",
69
+ "severity": "deny",
70
+ "stages": ["command", "artifact", "deploy_plan"],
71
+ "match": {
72
+ "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)" }
75
+ ]
76
+ },
77
+ "message": "The change appears to expose an administrative or database port to the public internet.",
78
+ "remediation": "Restrict the source CIDR to a trusted range, use a bastion or VPN, and keep public preview endpoints behind authenticated HTTP services."
79
+ },
80
+ {
81
+ "id": "hwc-obs-anonymous-write",
82
+ "title": "OBS anonymous write",
83
+ "category": "public_exposure",
84
+ "severity": "deny",
85
+ "stages": ["command", "artifact", "deploy_plan"],
86
+ "match": {
87
+ "all": [
88
+ { "field": "text", "regex": "(OBS|obs://|bucket|object|Statement|Principal)" }
89
+ ],
90
+ "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)" }
93
+ ]
94
+ },
95
+ "message": "The change may grant anonymous write or full-control access to OBS data.",
96
+ "remediation": "Use private buckets by default. Grant object read only when required, and avoid anonymous write permissions."
97
+ },
98
+ {
99
+ "id": "hwc-functiongraph-public-no-auth",
100
+ "title": "Public FunctionGraph trigger without auth",
101
+ "category": "public_exposure",
102
+ "severity": "warn",
103
+ "stages": ["command", "artifact", "deploy_plan"],
104
+ "match": {
105
+ "all": [
106
+ { "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))" }
108
+ ]
109
+ },
110
+ "message": "The generated FunctionGraph or API Gateway path may be publicly reachable without authentication.",
111
+ "remediation": "Require IAM, app authentication, JWT, or another explicit auth layer before exposing generated application endpoints."
112
+ },
113
+ {
114
+ "id": "hwc-iam-admin-policy",
115
+ "title": "Broad IAM administrator grant",
116
+ "category": "iam",
117
+ "severity": "deny",
118
+ "stages": ["command", "artifact", "deploy_plan"],
119
+ "match": {
120
+ "all": [
121
+ { "field": "text", "regex": "(IAM|policy|role|agency|Statement|Action)" },
122
+ { "field": "text", "regex": "(\\\"Action\\\"\\s*:\\s*(\\\"(\\*|\\*:\\*)\\\"|\\[\\s*\\\"(\\*|\\*:\\*)\\\")|Action\\s*[=:]\\s*(\\*|\\*:\\*)|AdministratorAccess|FullAccess)" },
123
+ { "field": "text", "regex": "(\\\"Effect\\\"\\s*:\\s*\\\"Allow\\\"|Effect\\s*[=:]\\s*Allow)" }
124
+ ]
125
+ },
126
+ "message": "The change appears to grant broad administrator permissions.",
127
+ "remediation": "Use least-privilege service actions, resource constraints, and short-lived credentials for generated application workflows."
128
+ },
129
+ {
130
+ "id": "hwc-destructive-delete-force",
131
+ "title": "Forced destructive operation",
132
+ "category": "destructive",
133
+ "severity": "deny",
134
+ "stages": ["command"],
135
+ "match": {
136
+ "all": [
137
+ { "field": "text", "regex": "(Delete|BatchDelete|Remove|\\brm\\b|delete)" },
138
+ { "field": "text", "regex": "(--force|-f|--recursive|-r|delete_publicip\\s*[=:]\\s*true)" }
139
+ ]
140
+ },
141
+ "message": "The command combines deletion with force, recursive, or cascading deletion behavior.",
142
+ "remediation": "Show the exact resources to be deleted, confirm backups or recovery path, and require explicit user approval for the exact command."
143
+ },
144
+ {
145
+ "id": "hwc-sandbox-missing-ttl",
146
+ "title": "Sandbox deployment missing cleanup metadata",
147
+ "category": "sandbox",
148
+ "severity": "warn",
149
+ "stages": ["artifact", "deploy_plan"],
150
+ "match": {
151
+ "all": [
152
+ { "field": "text", "regex": "(sandbox|preview|temporary|ephemeral|dev environment|FunctionGraph|ECS|CCE|APIG)" },
153
+ { "field": "text", "regex": "(Create|Deploy|Provision|resource|stack|environment)" }
154
+ ],
155
+ "none": [
156
+ { "field": "text", "regex": "(ttl|expires_at|expire_at|cleanup|owner|cost_center|auto_delete|auto-delete)" }
157
+ ]
158
+ },
159
+ "message": "The preview or sandbox deployment does not show cleanup or ownership metadata.",
160
+ "remediation": "Add owner, purpose, expiration time, and cleanup command before creating preview cloud resources."
161
+ },
162
+ {
163
+ "id": "hwc-cost-unbounded-scale",
164
+ "title": "Unbounded scale or high-cost resource",
165
+ "category": "cost",
166
+ "severity": "warn",
167
+ "stages": ["command", "artifact", "deploy_plan"],
168
+ "match": {
169
+ "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])" },
171
+ { "field": "text", "regex": "(GPU|gpu|large|xlarge|charging_mode\\s*[=:]\\s*prePaid|period_type|period_num)" }
172
+ ]
173
+ },
174
+ "message": "The generated plan may create high-cost or unbounded capacity.",
175
+ "remediation": "Use small preview defaults, explicit quotas, budget labels, and user approval before creating high-cost resources."
176
+ },
177
+ {
178
+ "id": "hwc-sandbox-destructive-command",
179
+ "title": "Destructive command in sandbox terminal",
180
+ "category": "destructive",
181
+ "severity": "deny",
182
+ "stages": ["command"],
183
+ "match": {
184
+ "any": [
185
+ { "field": "text", "regex": "rm\\s+-rf\\s+/" },
186
+ { "field": "text", "regex": "mkfs" },
187
+ { "field": "text", "regex": "dd\\s+if=" },
188
+ { "field": "text", "regex": ":\\\\(\\\\)\\\\{[^}]*\\\\|[^}]*&[^}]*\\\\}[^;]*;:" },
189
+ { "field": "text", "regex": "\\bshutdown\\b" },
190
+ { "field": "text", "regex": "\\breboot\\b" },
191
+ { "field": "text", "regex": "\\binit\\s+[06]\\b" },
192
+ { "field": "text", "regex": "\\bfdisk\\b" }
193
+ ]
194
+ },
195
+ "message": "The sandbox terminal command is destructively dangerous and could destroy the workspace.",
196
+ "remediation": "Use targeted deletions instead of recursive root removal. Avoid disk format, fork bombs, and system shutdown commands in sandbox terminals."
197
+ }
198
+ ]
199
+ }