huaweicloud-devkit 1.0.2-dev.9 → 1.0.2-next.10

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 (99) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +178 -138
  4. package/README.zh-CN.md +176 -138
  5. package/bin/setup.cjs +10 -8
  6. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  7. package/integrations/opencode/opencode.json +11 -14
  8. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +32 -32
  9. package/package.json +60 -44
  10. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +31 -44
  11. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +30 -43
  12. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +31 -44
  13. package/plugins/huaweicloud-core/.mcp.json +13 -15
  14. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +31 -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 +76 -100
  18. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +227 -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 +103 -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 +191 -190
  25. package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +171 -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 +57 -56
  29. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +106 -97
  30. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +36 -29
  31. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +29 -23
  32. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +188 -185
  33. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +144 -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 +57 -55
  36. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  37. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -131
  38. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +60 -58
  39. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +72 -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 +69 -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 +148 -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 +134 -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 +31 -26
  51. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +101 -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 +229 -224
  55. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +173 -134
  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 +77 -76
  59. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +60 -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 +56 -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 +138 -128
  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 +111 -96
  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 +20 -20
  71. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +30 -28
  72. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +59 -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 +54 -1
  77. package/plugins/huaweicloud-core/src/auth/credentials.mjs +103 -95
  78. package/plugins/huaweicloud-core/src/auth/service.mjs +63 -63
  79. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
  80. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +283 -265
  81. package/plugins/huaweicloud-core/src/icon-library.mjs +171 -0
  82. package/plugins/huaweicloud-core/src/mcp-server.mjs +130 -129
  83. package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +68 -0
  84. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +94 -0
  85. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +140 -137
  86. package/plugins/huaweicloud-core/src/safety-policy.mjs +356 -302
  87. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +86 -87
  88. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +150 -153
  89. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +196 -105
  90. package/plugins/huaweicloud-core/src/search-market.mjs +208 -169
  91. package/plugins/huaweicloud-core/src/setup-cli.mjs +2622 -1594
  92. package/plugins/huaweicloud-core/src/tools.mjs +463 -111
  93. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +447 -427
  94. package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +128 -132
  95. package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +215 -227
  96. package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +189 -202
  97. package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +164 -158
  98. package/plugins/huaweicloud-core/src/ws-exec/index.js +19 -19
  99. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +338 -338
@@ -1,56 +1,57 @@
1
- ---
2
- name: huawei-deployment
3
- description: "Use when creating, managing, or running deployment tasks and pipelines on Huawei Cloud CloudDeploy. Triggers: CloudDeploy, deployment, CI/CD, pipeline, release, artifact deployment, deploy task. NOT for: CodeArts Build (build pipeline), SWR container registry."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud CloudDeploy
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
-
13
- ## Overview
14
-
15
- Domain expertise for Huawei Cloud CloudDeploy. Covers application creation, deployment task management, pipeline execution, and artifact configuration.
16
-
17
- ## Critical Warnings
18
-
19
- | Trap | Why |
20
- |------|-----|
21
- | Service name may be `CodeArtsDeploy` | hcloud service name for deployment may be `CodeArtsDeploy` instead of `CloudDeploy`. Run `hcloud --help` to verify |
22
- | Deployment hosts need agent | Install CloudDeploy agent on target hosts first |
23
- | Task must reference application first | Create application before task |
24
- | Artifact source defaults to OBS | Most deployment tasks pull artifacts from OBS. Ensure bucket and object exist |
25
- | Parallel deployments may conflict | Lock resources or use deployment groups |
26
-
27
- ## Common Workflows
28
-
29
- | Task | Operation |
30
- |------|-----------|
31
- | Create application | `CreateApp --name=<n> --platform=<p> --cli-region=<r>` |
32
- | Create deployment task | `CreateTask --name=<n> --app_id=<id> --artifact_source_type=OBS` |
33
- | Start deployment | `StartTask --task_id=<id>` |
34
- | List tasks | `ListTasks --app_id=<id>` |
35
- | Delete task | `DeleteTask --task_id=<id>` |
36
-
37
- ## Troubleshooting
38
-
39
- | Error | Fix |
40
- |-------|-----|
41
- | Agent offline | Check agent service on target host, network connectivity, firewall rules |
42
- | Deployment timeout | Check artifact size, increase task timeout, verify target host resources |
43
- | Artifact not found | Verify OBS bucket and object path, check artifact permissions |
44
- | Permission denied | Verify IAM roles for deployment: `CodeArtsDeploy FullAccess` or custom policy |
45
-
46
- ## Security
47
-
48
- - MUST use IAM roles for deployment permissions
49
- - MUST verify artifact integrity before deployment
50
- - MUST not store credentials in deployment scripts
51
-
52
- ## Cross-Skill References
53
-
54
- - **OBS artifact storage**: See `huawei-obs`
55
- - **ECS deployment target**: See `huawei-ecs`
56
- - **IAM permissions**: See `huawei-iam`
1
+ ---
2
+ name: huawei-deployment
3
+ description: 'Use when creating, managing, or running deployment tasks and pipelines on Huawei Cloud CloudDeploy. Triggers: CloudDeploy, deployment, CI/CD, pipeline, release, artifact deployment, deploy task. NOT for: CodeArts Build (build pipeline), SWR container registry.'
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud CloudDeploy
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for Huawei Cloud CloudDeploy. Covers application creation, deployment task management, pipeline execution, and artifact configuration.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | **Flyway SQL dialect mismatch (H2 dev → MySQL prod)** | Spring Boot apps commonly develop with H2 in-memory DB, then deploy to RDS MySQL. Flyway migrations using H2-specific syntax (e.g. `DATEADD`, `CHARACTER_LENGTH`, `BOOLEAN`) silently succeed on H2 but fail on MySQL. Before deploying, audit `V*__*.sql` migration files: replace `DATEADD` with `DATE_ADD`, `BOOLEAN` with `TINYINT(1)`, remove `characterEncoding=utf8mb4` from Spring Boot datasource URL (KooCLI RDS CreateInstance sets charset at the instance level). Use `Flyway.validate-on-migrate=true` in CI to catch dialect issues early. |
22
+ | Service name may be `CodeArtsDeploy` | hcloud service name for deployment may be `CodeArtsDeploy` instead of `CloudDeploy`. Run `hcloud --help` to verify |
23
+ | Deployment hosts need agent | Install CloudDeploy agent on target hosts first |
24
+ | Task must reference application first | Create application before task |
25
+ | Artifact source defaults to OBS | Most deployment tasks pull artifacts from OBS. Ensure bucket and object exist |
26
+ | Parallel deployments may conflict | Lock resources or use deployment groups |
27
+
28
+ ## Common Workflows
29
+
30
+ | Task | Operation |
31
+ | ---------------------- | ---------------------------------------------------------------- |
32
+ | Create application | `CreateApp --name=<n> --platform=<p> --cli-region=<r>` |
33
+ | Create deployment task | `CreateTask --name=<n> --app_id=<id> --artifact_source_type=OBS` |
34
+ | Start deployment | `StartTask --task_id=<id>` |
35
+ | List tasks | `ListTasks --app_id=<id>` |
36
+ | Delete task | `DeleteTask --task_id=<id>` |
37
+
38
+ ## Troubleshooting
39
+
40
+ | Error | Fix |
41
+ | ------------------ | ----------------------------------------------------------------------------- |
42
+ | Agent offline | Check agent service on target host, network connectivity, firewall rules |
43
+ | Deployment timeout | Check artifact size, increase task timeout, verify target host resources |
44
+ | Artifact not found | Verify OBS bucket and object path, check artifact permissions |
45
+ | Permission denied | Verify IAM roles for deployment: `CodeArtsDeploy FullAccess` or custom policy |
46
+
47
+ ## Security
48
+
49
+ - MUST use IAM roles for deployment permissions
50
+ - MUST verify artifact integrity before deployment
51
+ - MUST not store credentials in deployment scripts
52
+
53
+ ## Cross-Skill References
54
+
55
+ - **OBS artifact storage**: See `huawei-obs`
56
+ - **ECS deployment target**: See `huawei-ecs`
57
+ - **IAM permissions**: See `huawei-iam`
@@ -1,97 +1,106 @@
1
- ---
2
- name: huawei-dew
3
- description: "Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud DEW (Data Encryption Workshop)
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
-
13
- ## Overview
14
-
15
- Domain expertise for Huawei Cloud Data Encryption Workshop (DEW). Covers CSMS for secret lifecycle management, KMS for encryption key management, credential rotation, and secure application integration patterns.
16
-
17
- ## Critical Warnings
18
-
19
- | Trap | Why |
20
- |------|-----|
21
- | NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
22
- | NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
23
- | KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
24
- | Secret rotation requires automation | Manual rotation risks stale credentials |
25
- | Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
26
-
27
- ## CSMS Operations
28
-
29
- ### Read-only (safe — metadata only)
30
- | Operation | Description |
31
- |-----------|-------------|
32
- | ListSecrets | List all secrets (names only, no values) |
33
- | DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
34
- | ListSecretVersions | List version IDs and stages (no values) |
35
-
36
- ### Secret Value (blocked by policy — use runtime injection)
37
- | Operation | Safe Alternative |
38
- |-----------|-----------------|
39
- | DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
40
- | ShowSecretVersion | Use runtime injection, never in agent context |
41
- | GetSecretValue | Blocked. Use MCP proxy resolve pattern |
42
-
43
- ## KMS Operations
44
-
45
- | Task | Command | Notes |
46
- |------|---------|-------|
47
- | List keys | hcloud KMS ListKeys | Read-only |
48
- | Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
49
- | Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
50
- | Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
51
-
52
- ## Runtime Injection Pattern
53
-
54
- `ash
55
- # Terraform / IaC
56
- resource "huaweicloud_csms_secret" "db_password" {
57
- secret_string = var.db_password # NEVER hardcode
58
- }
59
-
60
- # SDK
61
- secret_value = client.get_secret(secret_id="my-secret")
62
- # Use immediately, never print or store in context
63
-
64
- # hcloud (for approved automation only)
65
- hcloud CSMS DownloadSecret --secret_name=<name>
66
- # WARNING: Output goes to stdout. Pipe directly, never capture in agent.
67
- `
68
-
69
- ## Troubleshooting
70
-
71
- | Error | Root Cause -> Fix |
72
- |-------|------------------|
73
- | Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
74
- | AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
75
- | KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
76
- | Rotation stuck | Lambda/Python function error -> Check rotation function logs |
77
-
78
- ## Security Considerations
79
-
80
- - MUST use runtime injection. NEVER fetch secrets into agent context
81
- - MUST rotate credentials every 90 days
82
- - MUST enable automatic rotation for CSMS secrets
83
- - MUST audit KMS key usage via CTS
84
- - SHOULD use customer-managed keys (CMK) for sensitive data
85
- - MUST NOT use default KMS keys for production workloads
86
-
87
- ## MCP Tools
88
-
89
- - huaweicloud_list_operations service=DEW or CSMS or KMS
90
- - huaweicloud_run_readonly_command for ListSecrets/ListKeys (metadata only)
91
- - huaweicloud_safety policy blocks all secret value reads
92
-
93
- ## References
94
-
95
- - DEW Docs: https://support.huaweicloud.com/dew/
96
- - CSMS usage: references/csms-usage.md
97
- - KMS usage: references/kms-usage.md
1
+ ---
2
+ name: huawei-dew
3
+ description: 'Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets.'
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud DEW (Data Encryption Workshop)
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for Huawei Cloud Data Encryption Workshop (DEW). Covers CSMS for secret lifecycle management, KMS for encryption key management, credential rotation, and secure application integration patterns.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ | -------------------------------------------- | ------------------------------------------------------------------ |
21
+ | NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
22
+ | NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
23
+ | KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
24
+ | Secret rotation requires automation | Manual rotation risks stale credentials |
25
+ | Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
26
+
27
+ ## CSMS Operations
28
+
29
+ ### Read-only (safe — metadata only)
30
+
31
+ | Operation | Description |
32
+ | ------------------ | ------------------------------------------------------ |
33
+ | ListSecrets | List all secrets (names only, no values) |
34
+ | DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
35
+ | ListSecretVersions | List version IDs and stages (no values) |
36
+
37
+ ### Secret Value (blocked by policy — use runtime injection)
38
+
39
+ | Operation | Safe Alternative |
40
+ | ----------------- | --------------------------------------------- |
41
+ | DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
42
+ | ShowSecretVersion | Use runtime injection, never in agent context |
43
+ | GetSecretValue | Blocked. Use MCP proxy resolve pattern |
44
+
45
+ ## KMS Operations
46
+
47
+ | Task | Command | Notes |
48
+ | ---------- | ------------------------------------------------------ | -------------------------- |
49
+ | List keys | hcloud KMS ListKeys | Read-only |
50
+ | Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
51
+ | Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
52
+ | Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
53
+
54
+ ## Runtime Injection Pattern
55
+
56
+ `ash
57
+
58
+ # Terraform / IaC
59
+
60
+ resource "huaweicloud_csms_secret" "db_password" {
61
+ secret_string = var.db_password # NEVER hardcode
62
+ }
63
+
64
+ # SDK
65
+
66
+ secret_value = client.get_secret(secret_id="my-secret")
67
+
68
+ # Use immediately, never print or store in context
69
+
70
+ # hcloud (for approved automation only)
71
+
72
+ hcloud CSMS DownloadSecret --secret_name=<name>
73
+
74
+ # WARNING: Output goes to stdout. Pipe directly, never capture in agent.
75
+
76
+ `
77
+
78
+ ## Troubleshooting
79
+
80
+ | Error | Root Cause -> Fix |
81
+ | -------------------- | --------------------------------------------------------------------------- |
82
+ | Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
83
+ | AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
84
+ | KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
85
+ | Rotation stuck | Lambda/Python function error -> Check rotation function logs |
86
+
87
+ ## Security Considerations
88
+
89
+ - MUST use runtime injection. NEVER fetch secrets into agent context
90
+ - MUST rotate credentials every 90 days
91
+ - MUST enable automatic rotation for CSMS secrets
92
+ - MUST audit KMS key usage via CTS
93
+ - SHOULD use customer-managed keys (CMK) for sensitive data
94
+ - MUST NOT use default KMS keys for production workloads
95
+
96
+ ## MCP Tools
97
+
98
+ - huaweicloud_list_operations service=DEW or CSMS or KMS
99
+ - huaweicloud_run_readonly_command for ListSecrets/ListKeys (metadata only)
100
+ - huaweicloud_safety policy blocks all secret value reads
101
+
102
+ ## References
103
+
104
+ - DEW Docs: https://support.huaweicloud.com/dew/
105
+ - CSMS usage: references/csms-usage.md
106
+ - KMS usage: references/kms-usage.md
@@ -1,29 +1,36 @@
1
- # CSMS Usage Guide
2
-
3
- ## Create Secret
4
- hcloud CSMS CreateSecret --secret_name=prod-db-password --secret_string='{"password":"CHANGE_ME"}'
5
-
6
- ## List Secrets (metadata only)
7
- hcloud CSMS ListSecrets
8
-
9
- ## Describe Secret
10
- hcloud CSMS DescribeSecret --secret_name=prod-db-password
11
-
12
- ## List Versions
13
- hcloud CSMS ListSecretVersions --secret_name=prod-db-password
14
-
15
- ## Runtime Injection (Terraform)
16
- data "huaweicloud_csms_secret" "db" {
17
- secret_name = "prod-db-password"
18
- }
19
- Use: data.huaweicloud_csms_secret.db.secret_string
20
-
21
- ## Rotation
22
- - Enable auto-rotation: hcloud CSMS EnableSecretRotation --secret_name=<name> --rotation_interval=30
23
- - Rotation function ARN: provide Lambda to generate new secret value
24
-
25
- ## Policy Rules
26
- - hcloud CSMS DownloadSecret -> BLOCKED (use runtime injection)
27
- - hcloud CSMS ShowSecretVersion -> BLOCKED
28
- - hcloud CSMS ListSecrets -> ALLOWED (metadata only)
29
- - hcloud CSMS DescribeSecret -> ALLOWED (metadata only)
1
+ # CSMS Usage Guide
2
+
3
+ ## Create Secret
4
+
5
+ hcloud CSMS CreateSecret --secret_name=prod-db-password --secret_string='{"password":"CHANGE_ME"}'
6
+
7
+ ## List Secrets (metadata only)
8
+
9
+ hcloud CSMS ListSecrets
10
+
11
+ ## Describe Secret
12
+
13
+ hcloud CSMS DescribeSecret --secret_name=prod-db-password
14
+
15
+ ## List Versions
16
+
17
+ hcloud CSMS ListSecretVersions --secret_name=prod-db-password
18
+
19
+ ## Runtime Injection (Terraform)
20
+
21
+ data "huaweicloud_csms_secret" "db" {
22
+ secret_name = "prod-db-password"
23
+ }
24
+ Use: data.huaweicloud_csms_secret.db.secret_string
25
+
26
+ ## Rotation
27
+
28
+ - Enable auto-rotation: hcloud CSMS EnableSecretRotation --secret_name=<name> --rotation_interval=30
29
+ - Rotation function ARN: provide Lambda to generate new secret value
30
+
31
+ ## Policy Rules
32
+
33
+ - hcloud CSMS DownloadSecret -> BLOCKED (use runtime injection)
34
+ - hcloud CSMS ShowSecretVersion -> BLOCKED
35
+ - hcloud CSMS ListSecrets -> ALLOWED (metadata only)
36
+ - hcloud CSMS DescribeSecret -> ALLOWED (metadata only)
@@ -1,23 +1,29 @@
1
- # KMS Usage Guide
2
-
3
- ## Create Key
4
- hcloud KMS CreateKey --key_alias=app-encryption-key --key_description="Application data encryption"
5
-
6
- ## List Keys (metadata only)
7
- hcloud KMS ListKeys
8
-
9
- ## Encrypt (offline preferred)
10
- hcloud KMS EncryptData --key_id=<key-id> --plaintext=<base64-data>
11
-
12
- ## Decrypt (BLOCKED - use runtime)
13
- DO NOT use hcloud KMS DecryptData directly.
14
- Use SDK with KMS client in application runtime.
15
-
16
- ## Key Rotation
17
- - Enable: hcloud KMS EnableKeyRotation --key_id=<key-id>
18
- - Rotation period: 365 days (default)
19
-
20
- ## Key Deletion
21
- - Schedule: hcloud KMS ScheduleKeyDeletion --key_id=<key-id> --pending_days=7
22
- - Cancel during pending window: hcloud KMS CancelKeyDeletion --key_id=<key-id>
23
- - WARNING: After deletion window passes, data encrypted with this key is UNRECOVERABLE
1
+ # KMS Usage Guide
2
+
3
+ ## Create Key
4
+
5
+ hcloud KMS CreateKey --key_alias=app-encryption-key --key_description="Application data encryption"
6
+
7
+ ## List Keys (metadata only)
8
+
9
+ hcloud KMS ListKeys
10
+
11
+ ## Encrypt (offline preferred)
12
+
13
+ hcloud KMS EncryptData --key_id=<key-id> --plaintext=<base64-data>
14
+
15
+ ## Decrypt (BLOCKED - use runtime)
16
+
17
+ DO NOT use hcloud KMS DecryptData directly.
18
+ Use SDK with KMS client in application runtime.
19
+
20
+ ## Key Rotation
21
+
22
+ - Enable: hcloud KMS EnableKeyRotation --key_id=<key-id>
23
+ - Rotation period: 365 days (default)
24
+
25
+ ## Key Deletion
26
+
27
+ - Schedule: hcloud KMS ScheduleKeyDeletion --key_id=<key-id> --pending_days=7
28
+ - Cancel during pending window: hcloud KMS CancelKeyDeletion --key_id=<key-id>
29
+ - WARNING: After deletion window passes, data encrypted with this key is UNRECOVERABLE