Install
openclaw skills install @huaweicloudskill/huawei-cloud-ecs-vulnerability-auditorAudit Huawei Cloud ECS instances for security vulnerabilities across host OS packages, running services, application dependencies (Java, Python, Node.js, PHP, Go), and container environments (Docker, containerd, Podman). Collects asset inventories remotely via Cloud Operations Center (COC), matches components against Known Exploited Vulnerabilities (KEVs) via the public db.gcve.eu API, and outputs an actionable remediation report. 触发词: ECS漏洞扫描, ECS漏洞发现, 主机漏洞扫描, 容器漏洞发现, ECS资产收集, KEV漏洞检测, ecs vulnerability audit, ecs vuln scan, gcve vulnerability auditor
openclaw skills install @huaweicloudskill/huawei-cloud-ecs-vulnerability-auditorAudit Huawei Cloud ECS instances across host operating systems, active network services, application language runtimes, and container workloads for known and actively exploited vulnerabilities:
ServiceAgencyForCOC cross-service agency trusting op_svc_coc.dpkg/rpm), listening ports and process binaries (ss/netstat), application libraries (Java .jar manifests, pip, npm, composer), and container workloads (docker, podman).COC GetScriptJobBatch and extract the structured inventory between demarcated boundary markers (===ECS_ASSET_INVENTORY_START=== / ===END===).https://db.gcve.eu/api/ (/vulnerability/?product={product} for product CVEs, /kev for confirmed in-the-wild exploitation, and /epss for exploit prediction scoring).8.3.* to <8.3.36), extract CVSS scores with graceful fallback policies, and extract official vulnerability disclosure dates.Tool chain: Huawei Cloud KooCLI (hcloud) + Python 3 + https://db.gcve.eu/api/.
hcloud) authenticated with AK/SK — see CLI Installation GuideACTIVE state)https://db.gcve.eu/api from the auditing environment — see GCVE API ReferenceOne-time per-account setup. Authorize COC to operate on ECS instances:
KeystoneListAuthDomains and extract the domain id.CreateAgency with name ServiceAgencyForCOC and trust domain op_svc_coc.
agency.id. Proceed to step 3.KeystoneListPermissions for each of the 4 roles: IAM ReadOnlyAccess, RMS ReadOnlyAccess, DCS UserAccess, COCServiceAgencyPolicy. If any role is not found, stop — the account may lack access.AssociateAgencyWithAllProjectsPermission for each of the 4 role IDs.
NovaListServersDetails to obtain the instance UUID and region. Ensure the instance is in ACTIVE state.scripts/collect_assets.sh as a temporary COC shell script via COC CreateScript.COC ExecuteScript.COC GetScriptJobInfo until status reaches SUCCESS.COC GetScriptJobBatch to obtain the batch instance execution details:
hcloud COC GetScriptJobBatch --cli-region=<region> --execute_uuid="<execute_uuid>" --batch_index=1 --limit=10
===ECS_ASSET_INVENTORY_START===
{ ... json inventory ... }
===ECS_ASSET_INVENTORY_END===
scripts/query_gcve.py can directly ingest this batch JSON response, raw log text, or extracted JSON file.Run the intelligence engine scripts/query_gcve.py against the collected inventory:
--product <name> (or -p <name>) to audit a specific product (e.g. --product nginx or --product php).--product is omitted, query_gcve.py automatically audits ALL discovered network services, application libraries, container workloads, and core system packages.https://db.gcve.eu/api/vulnerability/?product={product}&per_page=20&date_sort=published&sort_order=desc.affected ranges (lessThan, lessThanOrEqual, version prefixes)./api/kev?vuln_id={cve} for active in-the-wild exploitation evidence and /api/epss/{cve} for exploit probability.Render findings ranked by threat severity:
date_published) and update date.Delete temporary COC scripts and remote temporary files:
COC DeleteScript./tmp/ecs_assets_inventory.json on the target host.Placeholder values:
| Placeholder | Linux / macOS | Windows (PowerShell) |
|---|---|---|
<hcloud> | hcloud | hcloud |
<temp_dir> | /tmp | $env:TEMP |
<region> | cn-north-4 | cn-north-4 |
[!NOTE] Command syntax conforms to the latest KooCLI standard without legacy
/v2.1or/v3URL suffixes. Usehcloud <service> <operation> --helpto confirm parameters on your local version.
# 1. Check/setup COC IAM authorization (one-time per account)
<hcloud> IAM KeystoneListAuthDomains
<hcloud> IAM CreateAgency \
--agency.domain_id="<domain_id>" \
--agency.name="ServiceAgencyForCOC" \
--agency.trust_domain_name="op_svc_coc" \
--agency.description="Agency for COC remote script execution and asset auditing" \
--agency.duration="FOREVER"
<hcloud> IAM KeystoneListPermissions --display_name="<role_name>"
<hcloud> IAM AssociateAgencyWithAllProjectsPermission \
--agency_id="<agency_id>" --domain_id="<domain_id>" --role_id="<role_id>"
# 2. Resolve ECS instance details by IP
<hcloud> ECS NovaListServersDetails --ip="<ecs_ip>"
# 3. Check existing COC scripts
<hcloud> COC ListScripts --cli-region=<region> --name_like="ecs_asset_collector" --limit=10
# 4. Create COC script via JSON input (ensure UTF-8 without BOM on Windows)
cat > <temp_dir>/coc_collector_create.json << 'EOF'
{
"body": {
"name": "ecs_asset_collector",
"type": "SHELL",
"description": "Read-only asset collector for ECS vulnerability auditing",
"content": "#!/usr/bin/env bash\n...",
"properties": {
"risk_level": "LOW",
"version": "1.0.0"
}
}
}
EOF
<hcloud> COC CreateScript --cli-region=<region> --cli-jsonInput=<temp_dir>/coc_collector_create.json
# 5. Execute script on target instance
cat > <temp_dir>/coc_collector_execute.json << 'EOF'
{
"path": {"script_uuid": "<script_uuid>"},
"body": {
"execute_batches": [{
"batch_index": 1,
"rotation_strategy": "CONTINUE",
"target_instances": [{
"region_id": "<region>",
"resource_id": "<instance_id>"
}]
}],
"execute_param": {
"execute_user": "root",
"timeout": 180,
"success_rate": 100
}
}
}
EOF
<hcloud> COC ExecuteScript --cli-region=<region> --cli-jsonInput=<temp_dir>/coc_collector_execute.json
# 6. Poll job status
<hcloud> COC GetScriptJobInfo --cli-region=<region> --execute_uuid="<execute_uuid>"
# 7. Retrieve execution log output
<hcloud> COC GetScriptJobBatch --cli-region=<region> --execute_uuid="<execute_uuid>" --batch_index=1 --limit=10 > <temp_dir>/coc_batch_output.json
# 8. Run GCVE Intelligence Audit & Generate Report (audits all components by default)
python scripts/query_gcve.py --inventory=<temp_dir>/coc_batch_output.json --output-format=markdown
# Optional: Audit a specific product only
python scripts/query_gcve.py --inventory=<temp_dir>/coc_batch_output.json --product=nginx
# 9. Cleanup COC script
<hcloud> COC DeleteScript --cli-region=<region> --script_uuid="<script_uuid>"
| Parameter | Required | Default | Description |
|---|---|---|---|
ecs_instance_id | Conditional | None | ECS Instance UUID; required if ecs_ip is not provided |
ecs_ip | Conditional | None | ECS Elastic IP; required if ecs_instance_id is not provided |
region | No | cn-north-4 | Huawei Cloud region where ECS and COC reside |
product | No | None | Specific product to audit (e.g. php, nginx). If omitted, all discovered assets are audited |
output_format | No | markdown | Report format: markdown or json |
cleanup | No | true | Automatically clean up COC scripts and remote files |
The skill provides structured progress updates across each audit phase:
| Phase | Output Content |
|---|---|
| Target & IAM | Target ECS ID, IP address, OS flavor, and COC agency status |
| Asset Collection | Count of discovered OS packages, listening services, Java/Python/Node dependencies, and containers |
| Result Retrieval | Confirmation of log retrieval from GetScriptJobBatch with marker extraction |
| KEV Matching | Identified Known Exploited Vulnerabilities (KEVs), EPSS scores, CVSS severity, publication dates, and version matches |
| Remediation Report | Full Markdown report with executive summary, CVE breakdown, and specific remediation commands |
| Cleanup | Deletion confirmation for COC script and temporary files |