Static supply-chain security detector for mooncakes.io packages: typo-squatting, hooks, network/process/fs abuse and obfuscation
| Family | Rules | Highlights |
|---|---|---|
| Source | S01–S08 | raw-IP/hardcoded exfil endpoints, credential paths, shell execution, base64 payload decoding with content inspection (urls / shells / downloaders → Critical), env sniffing, persistence writes |
| Hooks | S06 | pre-build command-chain classification: pipe-to-shell, command substitution, base64-decode-exec, reverse-shell indicators |
| Artifacts | S10 | binary magic detection (ELF/PE/Mach-O), disguised executables (benign extension + binary magic), embedded downloader/reverse-shell strings inside binaries, nested archives, shebang scripts |
| Combo | S99 | network + credential/obfuscation in the same file escalates to Critical |
moon check
moon test
moon build --target native --releaseENGINE=$(find _build/native/release -type f -executable | head -1)
# scan an extracted package directory
"$ENGINE" scan /tmp/pkg --module owner/name --version 0.1.0
# outputs: human (default) | json | sarif | md
"$ENGINE" scan /tmp/pkg --json
"$ENGINE" scan /tmp/pkg --format sarif > report.sarif
"$ENGINE" scan /tmp/pkg --format md >> "$GITHUB_STEP_SUMMARY"
# explain the score, rule by rule
"$ENGINE" scan /tmp/pkg --explain
# CI gate: non-zero exit when the verdict reaches the threshold
"$ENGINE" scan /tmp/pkg --fail-on malicious
# rule catalog
"$ENGINE" rules| Flag | Meaning |
|---|---|
| --module m | registry module name (enables authoritative-name checks) |
| --version v | package version recorded in the report |
| --hotlist file | popular-module list (default: builtin top-100 snapshot) |
| --min-severity s | low\|medium\|high\|critical filter |
| --format s | human\|json\|sarif\|md |
| --explain | print the score breakdown |
| --fail-on s | suspicious\|malicious CI exit gate |
./examples/scan_canaries.sh- run: |
git clone --depth 1 https://github.com/<you>/mooncake-audit /tmp/auditor
cd /tmp/auditor && moon build --target native --release
ENGINE=$(find _build/native/release -type f -executable | head -1)
"$ENGINE" scan "$PKG_DIR" --module "$PKG_NAME" --fail-on suspiciousmoon test # 111 tests: unit + canary e2e
moon fmt # format
moon info # refresh pkg.generated.mbti (public API surface)Install
Download zipStatic supply-chain security detector for mooncakes.io packages: typo-squatting, hooks, network/process/fs abuse and obfuscation