Install
openclaw skills install @huaweiclouddev/huawei-cloud-skill-auditAudit Huawei Cloud skills for quality, security, and compliance using a two-check pipeline: skillspector (AI security) and gitleaks (credential leak). Generates structured reports with issue details and fix strategies. Triggers include: "审计技能","技能审计","检查技能质量","扫描技能问题","技能安全审计", "audit skill","check skill quality","scan skills for issues","skill audit", "华为云技能审计","技能合规检查","skill gate","质量门禁","技能检查", "audit huawei cloud skill","verify skill compliance","技能质量检查","跑审计","安全扫描".
openclaw skills install @huaweiclouddev/huawei-cloud-skill-auditTwo-check security pipeline for auditing Huawei Cloud skills — security gate.
Scan a single Huawei Cloud skill directory or a folder of skills, run two security gates, and generate a structured report with issue details and fix strategies.
Two checks:
| # | Tool | Check Content | Implementation |
|---|---|---|---|
| 1 | skillspector | AI skill security scanner: 47 rules / 439 patterns across 17 categories (prompt injection, data exfiltration, privilege escalation, supply chain, behavioral AST, taint tracking, MCP analysis, YARA) | Built-in (pure Python, 47 rules + AST analysis) |
| 2 | gitleaks | Credential leak scan: 222 rules detecting hardcoded API keys, passwords, private keys, tokens, and 800+ credential formats | Built-in (pure Python, 222 rules + Shannon entropy) |
markdownlint-cli2 --fix during remediationskillspector and gitleaks are built-in (pure Python) — no external binary or pip install needed. External binaries are used as fallback if available on PATH.
To skip fallback auto-install of external binaries, use --no-install flag.
Input (skill path or folder)
│
├── Discover Skills ──── Find SKILL.md in target or subdirectories
│
├── Run Two Checks ────
│ 1. skillspector → AI security scan (47 rules, 439 patterns)
│ 2. gitleaks → Credential leak detection
│
├── Build Report ────
│ Section 1: Scanned Skills
│ Section 2: Issue Summary (by severity)
│ Section 3: Issue Details (per-issue)
│ Section 4: Fix Strategies (per rule/category)
│
└── Gate Verdict ──── PASS or FAIL
| Level | Analyzers | Speed | Use Case |
|---|---|---|---|
critical | CRITICAL severity rules only (P5 harmful content) | Fast | Strictest gate, default |
high | CRITICAL + ERROR severity rules | Fast | Block high-risk issues |
quick | Pattern matching only (all static regex rules) | Fast | Quick pre-commit check |
standard | All static analyzers (quick + AST + taint tracking) | Medium | CI/CD gate |
deep | Standard + MCP analysis (least privilege, tool poisoning, rug pull) | Slower | Pre-release full audit |
Severity filtering applies only to SkillSpector. gitleaks always reports all findings regardless of scan level.
This skill does not directly invoke hcloud CLI commands. It audits skill directories locally. However, when verifying a skill's functionality after audit, the standard KooCLI format applies:
hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]
python3 scripts/skill_audit.py --target /path/to/my-skill
python3 scripts/skill_audit.py --target /path/to/skills-folder
python3 scripts/skill_audit.py --target /path/to/skills --scan-level quick
python3 scripts/skill_audit.py --target /path/to/skills --checks skillspector
python3 scripts/skill_audit.py --target /path/to/skills --skip-checks gitleaks
python3 scripts/skill_audit.py \
--target /path/to/skill-or-folder \
--scan-level standard \
--skillspector /path/to/skillspector \
--gitleaks /path/to/gitleaks \
--node-bin /opt/nvm/versions/node/v18.20.8/bin
Available --scan-level values: critical (default), high, quick, standard, deep.
Available --checks: skillspector, gitleaks.
Use --skip-checks to exclude specific checks.
| Parameter | Required | Description | Example |
|---|---|---|---|
--target | Yes | Single skill dir or parent folder of skills | /home/user/.hermes/skills/huawei-cloud-ecs-manage |
--output-dir | No | Report output directory (default: parent of target) | --output-dir ./reports |
--scan-level | No | Scan depth: critical/high/quick/standard/deep (default: critical) | --scan-level deep |
--checks | No | Comma-separated checks to run (default: all);可用值仅 skillspector,gitleaks。与 --skip-checks 互斥,不可同时使用 | --checks skillspector |
--skillspector | No | SkillSpector binary path override | --skillspector ~/.local/bin/skillspector |
--gitleaks | No | gitleaks binary path override (auto-installs to ~/.local/bin when missing) | --gitleaks ~/.local/bin/gitleaks |
--skip-checks | No | Comma-separated checks to skip;与 --checks 互斥,不可同时使用 | --skip-checks gitleaks |
--no-install | No | Skip auto-install of tools | --no-install |
SKILL_QUALITY_ENDPOINT | No | Quality-report server URL (see Quality Reporting below) | https://skillsapi.developer.myhuaweicloud.com/api/quality/report |
SKILL_QUALITY_DISABLE | No | Set to 1 to disable quality reporting entirely (local debugging) | 0 |
SKILL_QUALITY_TIMEOUT | No | Report HTTP timeout in seconds (non-blocking) | 3 |
SKILL_QUALITY_TRIGGER | No | Trigger type reported (agent / workflow / auto / manual) | agent |
This Skill integrates skill_quality_sdk.py (vendored,
zero third-party dependency) for execution quality reporting. Every skill_audit.py
run automatically reports one record — skill name (huawei-cloud-skill-audit),
status (success / biz_fail / sys_fail), error code, cost, target path,
scan level, checks, and findings count — to the skillsopr operations console,
enabling usage/statistics counting of the audit skill itself.
scripts/skill_audit.py): the entire audit flow runs inside a
quality_context block (imported from the vendored SDK), which reports on every
exit path:
status=successstatus=biz_fail, error_code=U01--checks / --skip-checks combination → status=biz_fail, error_code=U02status=biz_fail, error_code=U03status=sys_fail with inferred error codepython3 is already a hard prerequisite.| Prefix | Category | Examples |
|---|---|---|
| U | User input | U01 missing param, U02 bad param, U03 no data found |
| C | Configuration | C01 missing AK/SK/env |
| N | Network | N01 timeout, N02 connection refused |
| B | Code bug | B01 null pointer, B04 version mismatch |
| P | Platform | P01 scheduler error, P02 resource insufficient |
Reporting is non-blocking and fails silently — it never interrupts the Skill main flow.
Disable via SKILL_QUALITY_DISABLE=1 for local testing.
Report is saved as skill-gate-report-<timestamp>.txt in the parent directory of the scanned path.
| Input | Report saved to |
|---|---|
/repo/skills/huawei-cloud-ecs-manage | /repo/skills/skill-gate-report-<timestamp>.txt |
/repo/skills | /repo/skill-gate-report-<timestamp>.txt |
Four sections:
| Rule | Fix |
|---|---|
| P1-P5 (Prompt Injection) | Do not embed user-controllable input in system prompts; use template variables with explicit escaping |
| E1-E4 (Data Exfiltration) | Remove external URLs; use env vars for API endpoints; restrict network access in tool definitions |
| PE1-PE3 (Privilege Escalation) | Avoid sudo/root commands; use capability-based permissions; do not disable security controls |
| AST1-AST3 (Behavioral AST) | Replace exec()/eval() with safer alternatives; use importlib with allowlists |
| YR1-YR4 (YARA) | Remove reverse shell/webshell patterns; move server functionality to separate controlled service |
| SC1-SC6 (Supply Chain) | Pin dependency versions with hashes; update vulnerable dependencies |
| LP1-LP4 (MCP Least Privilege) | Reduce MCP tool permissions to minimum required |
| TP1-TP4 (MCP Tool Poisoning) | Validate MCP tool metadata against manifest |
| Rule | Fix |
|---|---|
| generic-api-key | Replace hardcoded API key/secret with os.environ.get("VAR") or ${VAR}; add to .gitleaksignore if false positive |
| private-key | Remove hardcoded private key; load from file or secret manager at runtime; add key file to .gitignore |
| (other rules) | Replace hardcoded credential with environment variable or secret manager reference; see https://gitleaks.io/docs/secrets |
After running the audit and getting a FAIL, follow this sequence:
Markdown style and SKILL.md spec issues are not audited by this skill; use external tools like
markdownlint-cli2 --fixonly if you need to fix markdown style separately.
jobs:
skill-gate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Run audit
run: python3 scripts/skill_audit.py --target . --output-dir .
- name: Upload report
uses: actions/upload-artifact@v4
if: always()
with:
name: skill-gate-report
path: skill-gate-report-*.txt
The built-in checks use their bundled rule sets — no external config required:
scripts/checks/skillspector_rules.json — skillspector rules (47 rules / 439 patterns)scripts/checks/gitleaks_rules.json — gitleaks rules (222 rules).markdownlint.json and skillcheck.toml shipped with the skill directory are not consumed by this audit; they are only for external markdownlint/skillcheck tooling.
skillspector runs with --no-llm mode (static analysis only). Gaps:
| Analyzer | What it detects | What it MISSES in --no-llm mode |
|---|---|---|
| Pattern matching (P1-P5, E1-E4, PE1-PE3) | Prompt injection, data exfiltration, privilege escalation patterns | LLM-generated obfuscated variants |
| AST analysis (AST1-AST3) | exec()/eval() calls, dynamic imports | Runtime-evaluated strings |
| YARA rules (YR1-YR4) | Reverse shell, webshell patterns | Encoded/obfuscated payloads |
| Supply chain (SC1-SC6) | Vulnerable/pinned dependency issues | Transitive dependency exploits |
| Tool | Detects | Install |
|---|---|---|
| skillspector (built-in, --no-llm) | Prompt injection, reverse shell, command injection, data exfiltration, privilege escalation, supply chain | Auto-installed |
| gitleaks (built-in) | 800+ credential types: API keys, passwords, private keys, tokens | Auto-installed |
| gitcode-security-scanner | Generic keyword credentials, Chinese keywords, SQL injection, debug leakage | From DTSE-SKILL repo |
Recommended: Run both huawei-cloud-skill-audit AND gitcode-security-scanner for complete coverage.
Report is a plain text file with four sections (Scanned Skills, Issue Summary, Issue Details, Fix Strategies) followed by a Gate Verdict (PASS/FAIL).
python3 scripts/skill_audit.py --target /path/to/skill
# Fix issues from the report's Fix Strategies section, then re-run audit
python3 scripts/skill_audit.py --target /path/to/skill
# Gate Verdict: PASS = all checks passed
# Gate Verdict: FAIL = one or more checks have issues
references/iam-policies.md — IAM permissions required for skill auditreferences/verification-method.md — Detailed verification proceduresreferences/acceptance-criteria.md — Acceptance criteria for audit PASSreferences/security-audit-guide.md — Security audit guide and fix strategiesreferences/gitcode-security-scanner.md — Complementary scanner usage guidescripts/skill_quality_sdk.py — Vendored execution-quality reporting SDK (see Quality Reporting)huawei-cloud-skill-audit and gitcode-security-scanner for complete security coverage--no-git mode scans current file contents only, not git history| Scenario | Handling |
|---|---|
| Skill directory does not exist | Report error and terminate |
| Target has no SKILL.md and no subdirs with SKILL.md | Report error: no skills found |
| Built-in rules file missing | Auto-download fallback binary (skillspector/gitleaks) |
| Python version < 3.12 | External skillspector binary not available; builtin still works |
| Large repo produces huge report | Scan individual skills; use head/tail to read summary |
| gitleaks false positive | Add to .gitleaksignore file |
| skillspector exit code 1 | Risk score > 50; treated as finding source, not hard failure |