跳转到正文
报告库
用途分类 / 开发辅助

Azure Cloud Migrate Skill 安全审计

作者说它能做什么(原文)

Assess and migrate cross-cloud workloads to Azure with reports and code conversion. Supports Lambda→Functions, Beanstalk/Heroku/App Engine→App Service, Fargate/Kubernetes/Cloud Run/Spring Boot→Container Apps. WHEN: migrate Lambda to Functions, AWS to Azure, migrate Beanstalk, migrate Heroku, migrate App Engine, Cloud Run migration, Fargate to ACA, ECS/Kubernetes/GKE/EKS to Container Apps, Spring B

第三方安全检查结论

先别安装或运行

已检查文件
31
发现的风险
4
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。未发现风险
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 2 项风险
高风险

Kubernetes 导出脚本会把 Secret 对象写入本地文件

原文依据:1 处
发现了什么

导出命令明确包含 `secret`,并把完整 YAML 重定向到输出文件。Kubernetes Secret 的值通常只是 Base64 编码,并非加密。

为什么需要注意

任何能读取该目录、备份、构建产物或日志附件的人,都可能取得数据库密码、令牌或证书材料。

该部署指南的活动导出脚本把 `secret` 与其他 Kubernetes 资源一起序列化到本地 `all-resources.yaml`。执行时,Secret 数据虽通常为 Base64,但并未因此加密;输出目录若被提交、备份或被其他用户读取,凭据可能泄露。用户可要求默认排除 Secret 内容,仅导出名称/引用,并限制输出目录权限与保留时间。

references/services/container-apps/deployment-guide.md:19来自说明文档打开原文件
set -euo pipefailNAMESPACE="${K8S_NAMESPACE:-<namespace>}"OUTPUT_DIR="${OUTPUT_DIR:-k8s-export}"mkdir -p "$OUTPUT_DIR"kubectl get deploy,svc,ingress,configmap,secret -n "$NAMESPACE" -o yaml > "$OUTPUT_DIR/all-resources.yaml"for deploy in $(kubectl get deploy -n "$NAMESPACE" -o jsonpath='{.items[*].metadata.name}'); do  kubectl get deployment "$deploy" -n "$NAMESPACE" -o yaml > "$OUTPUT_DIR/deploy-${deploy}.yaml"done
中风险

部分指南把秘密和 Log Analytics 共享密钥放入命令行参数

原文依据:3 处
发现了什么

命令替换或变量中的秘密会展开为 `az ... --value` 或 `--logs-workspace-key` 的进程参数。虽然没有写入普通文件,但进程监控、详细 CI 日志、shell 跟踪或错误收集仍可能捕获它们。

为什么需要注意

可观察命令行或流水线诊断信息的人可能取得 GCP、Kubernetes 或 Azure 监控凭据,并用于访问对应服务。

这些是部署指南中的可执行示例。Cloud Run 示例把从 GCP 读取的秘密展开到 `--value` 参数;同一指南还读取 Log Analytics 主共享密钥并通过命令参数传递。执行时,秘密可能被进程检查、shell 跟踪、详细 CI 日志或错误采集记录。“不写磁盘”并不能消除这些渠道。用户可要求使用受保护文件或标准输入、禁用跟踪并优先采用无共享密钥配置。

references/services/container-apps/cloudrun-deployment-guide.md:114来自说明文档打开原文件
# Migrate secrets without writing them to diskaz keyvault secret set --vault-name "$KEY_VAULT" --name <secret-name> \  --value "$(gcloud secrets versions access latest --secret=<secret-id> --project="$GCP_PROJECT")"
查看另外 2 个位置
references/services/container-apps/deployment-guide.md:89来自说明文档打开原文件
# Create Key Vault and migrate secrets (pipe directly — no temp file)az keyvault create --name myapp-kv --resource-group myapp-rg --location eastusaz keyvault secret set --vault-name myapp-kv --name password --value "$(kubectl get secret mysecret -n <namespace> -o jsonpath='{.data.password}' | base64 -d)"
references/services/container-apps/cloudrun-deployment-guide.md:54来自说明文档打开原文件
az monitor log-analytics workspace create -g "$RG" -n "${RG}-logs" -l "$LOCATION"LOG_ID=$(az monitor log-analytics workspace show -g "$RG" -n "${RG}-logs" --query customerId -o tsv)LOG_KEY=$(az monitor log-analytics workspace get-shared-keys -g "$RG" -n "${RG}-logs" --query primarySharedKey -o tsv)az containerapp env create -n "${RG}-env" -g "$RG" -l "$LOCATION" \  --logs-workspace-id "$LOG_ID" --logs-workspace-key "$LOG_KEY"```
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。未发现风险
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 2 项风险
中风险

迁移示例默认创建外部入口和匿名 HTTP 函数

原文依据:4 处
发现了什么

多个部署示例固定使用 `--ingress external`,函数运行时示例也设置匿名授权。若代理直接沿用示例,而没有保留源系统的身份验证和内部入口要求,服务会对互联网开放。

为什么需要注意

未授权人员可能访问迁移后的接口、触发函数、读取应用返回的数据或产生资源费用。

部署示例明确创建外部入口,函数示例也使用匿名授权;若代理把示例直接用于真实迁移而未保留原系统的访问控制,服务或函数可能公开到互联网。它们是示例而非自动执行代码,且全局规则要求部署前确认,但确认部署并不等同于确认公开访问。用户可要求默认内部入口、非匿名函数,并在部署前单独核对身份验证和网络暴露。

references/services/container-apps/fargate-deployment-guide.md:162来自说明文档打开原文件
SECRET_URI=$(az keyvault secret show --vault-name "$KEY_VAULT" --name db-password --query id -o tsv)az containerapp create --name <app-name> -g "$RG" --environment "${RG}-env" \  --image "${ACR_NAME}.azurecr.io/<image>:<tag>" --target-port 8080 --ingress external \  --cpu 0.5 --memory 1Gi --min-replicas 1 --max-replicas 10 \  --user-assigned "$IDENTITY_ID" --registry-identity "$IDENTITY_ID" \  --registry-server "${ACR_NAME}.azurecr.io" \  --secrets db-pass=keyvaultref:"${SECRET_URI}",identityref:"${IDENTITY_ID}" \  --env-vars ENV=production DB_PASSWORD=secretref:db-pass```
查看另外 3 个位置
references/services/functions/runtimes/javascript.md:50来自说明文档打开原文件
```javascriptapp.http('httpFunction', {  methods: ['GET', 'POST'],  authLevel: 'anonymous',  handler: async (request, context) => {    const name = request.query.get('name') || (await request.text());
references/services/functions/runtimes/csharp.md:9来自说明文档打开原文件
```csharp[Function("HttpFunction")]public static HttpResponseData Run(    [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req,    FunctionContext context){
references/services/app-service/global-rules.md:16来自说明文档打开原文件
Always use `ask_user` before:- Selecting Azure subscription- Selecting Azure region/location- Deploying infrastructure- Making breaking changes to existing code- Choosing App Service Plan tier (Free, Basic, Standard, Premium)
中风险

函数模式把运行时身份授予资源组级事件订阅管理权和存储 Data Owner 权限

原文依据:2 处
发现了什么

“必需角色”表建议给同一个用户分配的托管身份授予资源组范围的 EventGrid EventSubscription Contributor,以及存储账户范围的 Storage Blob Data Owner。这些能力超过普通读取和写入业务对象所需的最小权限。

为什么需要注意

若应用代码或运行时身份被攻破,攻击者可能删除 Blob、修改其访问控制,或创建和更改资源组中的事件订阅。

指南明确要求把 EventGrid EventSubscription Contributor 授予 UAMI,并在“必需角色”表中把该角色置于资源组范围,同时给存储账户授予 Storage Blob Data Owner。若这里的 UAMI 是应用运行时身份,应用被攻破后可能管理整个资源组的事件订阅,并拥有 Blob 所有者级能力,权限高于普通对象读写。用户可要求拆分部署身份与运行时身份,并将存储权限限制到所需容器和较窄角色。

references/services/functions/lambda-to-functions.md:218来自说明文档打开原文件
### Required RBAC Roles for Face Blur Pattern| Role | Scope | Purpose ||------|-------|---------|| Storage Blob Data Owner | Storage Account | Read source blobs, write destination blobs || Storage Queue Data Contributor | Storage Account | Poison-message queue for blob extension || EventGrid EventSubscription Contributor | Resource Group | Create/manage Event Grid subscriptions || Cognitive Services User | Cognitive Services Account | Call Computer Vision API || Monitoring Metrics Publisher | Application Insights | Emit telemetry |
查看另外 1 个位置
references/services/functions/lambda-to-functions.md:185来自说明文档打开原文件
**RBAC requirement**: Assign **EventGrid EventSubscription Contributor** role to the UAMI.
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

4 个说明模块

该 Skill 先评估现有云应用,再把转换后的代码和配置写入工作区中的独立 Azure 输出目录;其明文规则要求不修改源目录。

查看原文
SKILL.md:16来自说明文档打开原文件
1. Follow phases sequentially — do not skip2. Generate assessment before any code migration3. Load the scenario reference and follow its rules4. Use `mcp_azure_mcp_get_azure_bestpractices` and `mcp_azure_mcp_documentation` MCP tools
SKILL.md:40来自说明文档打开原文件
## Output DirectoryAll output goes to `<workspace-root-basename>-azure/` at workspace root, where `<workspace-root-basename>` is the name of the top-level workspace directory itself (NOT a subdirectory within it). Never modify the source directory.

这不只是报告工具:场景指南包含登录源和目标镜像仓库、拉取和推送镜像、创建 Azure 资源、分配角色及部署应用的命令。

查看原文
references/services/container-apps/fargate-deployment-guide.md:11来自说明文档打开原文件
set -euo pipefailaws ecr get-login-password --region "$AWS_REGION" | \  docker login --username AWS --password-stdin "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com"az acr login --name "$ACR_NAME"docker pull "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${IMAGE}"docker tag "${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/${IMAGE}" "${ACR_NAME}.azurecr.io/${IMAGE}"docker push "${ACR_NAME}.azurecr.io/${IMAGE}"```
references/services/container-apps/fargate-deployment-guide.md:95来自说明文档打开原文件
set -euo pipefailaz keyvault create --name "$KEY_VAULT" -g "$RG" -l "$LOCATION" \  --enable-rbac-authorization trueIDENTITY_ID=$(az identity create -n "${RG}-id" -g "$RG" -l "$LOCATION" --query id -o tsv)PRINCIPAL_ID=$(az identity show --ids "$IDENTITY_ID" --query principalId -o tsv)# Grant Key Vault access — use RBAC (recommended) or access policies# Option A: RBAC (enabled on the vault created above)KV_ID=$(az keyvault show --name "$KEY_VAULT" --query id -o tsv)az role assignment create --assignee "$PRINCIPAL_ID" \  --role "Key Vault Secrets User" --scope "$KV_ID"# Option B: Access policies (if vault uses access policy mode)

明文政策要求在选择订阅、区域、服务层级以及部署或破坏性操作前取得用户确认。用户应把这些确认视为安全边界,并核对具体订阅、区域、资源和公开访问设置。

查看原文
references/services/app-service/global-rules.md:7来自说明文档打开原文件
⛔ **NEVER** perform destructive actions without explicit user confirmation via `ask_user`:- Deleting files or directories- Overwriting existing code- Deploying to production environments- Modifying existing Azure resources- Removing source-platform resources
references/services/app-service/global-rules.md:16来自说明文档打开原文件
Always use `ask_user` before:- Selecting Azure subscription- Selecting Azure region/location- Deploying infrastructure- Making breaking changes to existing code- Choosing App Service Plan tier (Free, Basic, Standard, Premium)

代码迁移结束后,流程会交给其他 Azure Skill 生成基础设施,并继续到验证和部署,因此用户授权部署时可能触发多阶段云账户变更。

查看原文
references/services/functions/code-migration.md:130来自说明文档打开原文件
After code migration is complete:1. Update `migration-status.md` — mark Code Migration as ✅ Complete2. Invoke **azure-prepare** — pass the assessment report context so it can:   - Use the service mapping as requirements input (skips manual gather-requirements)   - Generate IaC (Bicep/Terraform) for the mapped Azure services   - Create `azure.yaml` and `.azure/preparation-manifest.md`   - Apply security hardening3. azure-prepare will then chain to **azure-validate** → **azure-deploy**
从这里开始 · 工作说明SKILL.md
azure-cloud-migrate
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。

文件引用关系图

40 处引用
哪些文件发起引用引用了什么
连线表示真实的文件引用,不是运行顺序。点击节点可高亮相关连线,并查看具体文件和原文位置。虚线表示还有文件需要定位。
文件与检查记录31 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文
  • references/services/app-service/app-engine-to-app-service.md已纳入全文
  • references/services/app-service/assessment.md已纳入全文
  • references/services/app-service/beanstalk-to-app-service.md已纳入全文
  • references/services/app-service/code-migration.md已纳入全文
  • references/services/app-service/global-rules.md已纳入全文
  • references/services/app-service/heroku-to-app-service.md已纳入全文
  • references/services/container-apps/cloudrun-to-container-apps.md已纳入全文
  • references/services/container-apps/fargate-assessment-guide.md已纳入全文
  • references/services/container-apps/fargate-deployment-guide.md已纳入全文
  • references/services/container-apps/fargate-to-container-apps.md已纳入全文
  • references/services/container-apps/k8s-to-container-apps.md已纳入全文
  • references/services/container-apps/spring-apps-to-aca.md已纳入全文
  • references/services/functions/assessment.md已纳入全文
  • references/services/functions/code-migration.md已纳入全文
  • references/services/functions/global-rules.md已纳入全文
  • references/services/functions/lambda-to-functions.md已纳入全文
  • references/workflow-details.md已纳入全文
  • references/services/container-apps/assessment-guide.md已纳入全文
  • references/services/container-apps/cloudrun-assessment-guide.md已纳入全文
  • references/services/container-apps/cloudrun-deployment-guide.md已纳入全文
  • references/services/container-apps/deployment-guide.md已纳入全文
  • references/services/container-apps/spring-assessment-guide.md已纳入全文
  • references/services/container-apps/spring-dependency-patterns.md已纳入全文
  • references/services/container-apps/spring-deployment-guide.md已纳入全文
  • references/services/functions/runtimes/csharp.md已纳入全文
  • references/services/functions/runtimes/java.md已纳入全文
  • references/services/functions/runtimes/javascript.md已纳入全文
  • references/services/functions/runtimes/powershell.md已纳入全文
  • references/services/functions/runtimes/python.md已纳入全文
  • references/services/functions/runtimes/typescript.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明
  • references/services/app-service/app-engine-to-app-service.md配套文件
  • references/services/app-service/assessment.md配套文件
  • references/services/app-service/beanstalk-to-app-service.md配套文件
  • references/services/app-service/code-migration.md配套文件
  • references/services/app-service/global-rules.md配套文件
  • references/services/app-service/heroku-to-app-service.md配套文件
  • references/services/container-apps/assessment-guide.md配套文件
  • references/services/container-apps/cloudrun-assessment-guide.md配套文件
  • references/services/container-apps/cloudrun-deployment-guide.md配套文件
  • references/services/container-apps/cloudrun-to-container-apps.md配套文件
  • references/services/container-apps/deployment-guide.md配套文件
  • references/services/container-apps/fargate-assessment-guide.md配套文件
  • references/services/container-apps/fargate-deployment-guide.md配套文件
  • references/services/container-apps/fargate-to-container-apps.md配套文件
  • references/services/container-apps/k8s-to-container-apps.md配套文件
  • references/services/container-apps/spring-apps-to-aca.md配套文件
  • references/services/container-apps/spring-assessment-guide.md配套文件
  • references/services/container-apps/spring-dependency-patterns.md配套文件
  • references/services/container-apps/spring-deployment-guide.md配套文件
  • references/services/functions/assessment.md配套文件
  • references/services/functions/code-migration.md配套文件
  • references/services/functions/global-rules.md配套文件
  • references/services/functions/lambda-to-functions.md配套文件
  • references/services/functions/runtimes/csharp.md配套文件
  • references/services/functions/runtimes/java.md配套文件
  • references/services/functions/runtimes/javascript.md配套文件
  • references/services/functions/runtimes/powershell.md配套文件
  • references/services/functions/runtimes/python.md配套文件
  • references/services/functions/runtimes/typescript.md配套文件
  • references/workflow-details.md配套文件

代码和说明中提到的操作

连接外部网站
SKILL.md:23来自说明文档打开原文件
7. **Report progress to user** — During long-running operations (deployments, image pushes), provide resource-level status updates so the user is never left waiting without feedback — see [workflow-details.md](references/workflow-details.md 8. **Audit service discovery in app code** — Kubernetes DNS names (e.g., `http://order-service:3001`) do not resolve in Container Apps. During assessment, scan source code for hardcoded hostnames/ports in HTTP clients and flag them for env-var-driven URL injection
references/services/app-service/app-engine-to-app-service.md:180来自说明文档打开原文件
- [GCP to Azure services comparison](https://learn.microsoft.com/en-us/azure/architecture/gcp-professional/)- [App Service overview](https://learn.microsoft.com/en-us/azure/app-service/overview)
references/services/app-service/app-engine-to-app-service.md:181来自说明文档打开原文件
- [GCP to Azure services comparison](https://learn.microsoft.com/en-us/azure/architecture/gcp-professional/)- [App Service overview](https://learn.microsoft.com/en-us/azure/app-service/overview)- [Cosmos DB migration options](https://learn.microsoft.com/en-us/azure/cosmos-db/migration-choices)
读取密钥或账号配置
references/services/app-service/beanstalk-to-app-service.md:161来自说明文档打开原文件
| Secrets Manager refs | Key Vault | Secrets with rotation || `.env` file | App Settings + Key Vault | Split by sensitivity |
references/services/app-service/code-migration.md:57来自说明文档打开原文件
> ⚠️ **Port**: App Service injects `PORT` env var. Always bind to `process.env.PORT || 8080`.
references/services/app-service/code-migration.md:64来自说明文档打开原文件
const appInsights = require('applicationinsights');appInsights.setup(process.env.APPLICATIONINSIGHTS_CONNECTION_STRING)  .setAutoCollectRequests(true)
运行命令
references/services/container-apps/cloudrun-deployment-guide.md:9来自说明文档打开原文件
### Bash
references/services/container-apps/cloudrun-deployment-guide.md:11来自说明文档打开原文件
```bashset -euo pipefail
references/services/container-apps/cloudrun-deployment-guide.md:26来自说明文档打开原文件
### PowerShell
修改文件
references/services/container-apps/fargate-deployment-guide.md:113来自说明文档打开原文件
secret_file="$(mktemp)"trap 'rm -f "$secret_file"' EXITaws secretsmanager get-secret-value --secret-id <secret-id> --region <region> \
references/services/container-apps/fargate-deployment-guide.md:118来自说明文档打开原文件
  --file "$secret_file"rm -f "$secret_file"trap - EXIT
references/services/container-apps/spring-deployment-guide.md:102来自说明文档打开原文件
SECRET_FILE=$(mktemp)trap 'shred -u "$SECRET_FILE" 2>/dev/null || rm -f "$SECRET_FILE"' EXITread -s -p "Enter database password: " DB_PASSWORD
读取了多少行
4,615
文件校验值(用于核对版本)
95ae05d14c7ca0c3a1a7d4dccbacaab8d3e52ee5ba69241785f0df75abd71242