Skip to content

v0.3.0 - Seed Database, Expanded Ruleset, CLI Overhaul

Choose a tag to compare

@emiliano-go emiliano-go released this 24 Jul 18:52
· 280 commits to master since this release
0ff6747

TL;DR

Cold-start INCONCLUSIVE eliminated via an auto-imported novelty seed. 14 new detection rules (R039-R059), 4 new context rules (C004-C007), and a homograph detection rewrite. CLI overhaul with rich tiered inspect output, override management, seed import, and rules linting. PKGBUILD maintainer now correctly extracted from the # Maintainer: comment (was silently returning None).

Added

  • Novelty seed database: bundled seed.db.gz (178k source URLs, maintainer counts) auto-imported on first run. Removes the cold-start penalty where every Medium verdict was downgraded to INCONCLUSIVE because maturity was permanently zero.
  • 14 detection rules (R039-R059): eval with dynamic content, shell -c with dynamic payload, shell network redirection (/dev/tcp), download-then-execute, base64 blob decode, interpreter one-liner with network access, binary encoding pipe, source URL uses IP address, source URL on non-standard port, source URL on free registrar TLD, compiler hardening disabled, setuid/setgid bit (in and outside $pkgdir), persistence unit outside package root, git clone with variable branch, download-then-source, TLS verification disabled, write outside package root.
  • 4 context rules (C004-C007): checksum removed for unchanged source (CRITICAL), binary artifact from untrusted source (MEDIUM), maintainer change with new source domain (HIGH), command substitution in source array (CRITICAL).
  • CLI inspect overhaul: rich tiered score breakdown (structural, priors, novelty, verification), source URL table with bucket classification, suppressed rules display, deceptive codepoint description panel.
  • CLI override: add/rm/list rule suppressions with scoped package support. FATAL-severity findings can never be suppressed.
  • CLI seed-db: import the bundled novelty seed or a custom seed file, with force-reimport support.
  • CLI lint-rules: validate rules.toml for unreachable or over-broad patterns, detect missing shipped rules.
  • CLI config sync-rules: append newly shipped rules to an existing rules.toml, optionally replace superseded shipped patterns (user-edited rules are never touched).
  • [seed] and [rules] config sections: auto_import toggle, experimental flag to gate new rules before calibration.
  • Override system filter_triggered_rules now returns suppressed rule dicts: with reason and scope, so the report can show what was hidden and why.
  • describe_fatal_codepoints(): reports offset and Unicode name of each deceptive character a FATAL finding matched.

Fixed

  • PKGBUILD maintainer was always None: fetcher was reading .SRCINFO (which never carries a maintainer= field in AUR mirrors). Now reads # Maintainer: from PKGBUILD with .SRCINFO as fallback, restoring maintainer_changed, maintainer novelty weight, and C006.
  • Homograph detection bypass via punycode: xn-- encoded confusables (e.g. github.xn--githb-6rd.com) were not decoded before analysis. New mixed-script detection also catches non-ASCII Latin diacritics within the same script.
  • Legitimate IDN false positives: Japanese (Han + kana), Korean (Han + Hangul), and all-Cyrillic domains are no longer flagged as homographs.
  • fallback_verdict claimed clean packages were suspicious: was showing "No suspicious patterns detected" even on packages scoring 100/100 with CRITICAL rules. Now lists the top 3 signals by severity and says "No risk signals fired" on clean packages.
  • trustsight config show now prints all scoring weights: previously only showed LLM settings.
  • SHA256=('SKIP') no longer earns verification or pinning credit: a skipped checksum was being credited as checksum_present (-10) and checksum_pinned (-5) while also firing R004.
  • Corpus mirror-check CI: was failing due to drift between corpus.lock and benign-corpus/. Lock regenerated from on-disk state.

Updated

  • CLI output: review now shows a 4-column table (Package, Score, Risk, Verdict) with caption noting how many packages exceeded the CLEAN threshold. inspect groups findings by evidence tier (A/B/C/D). Risk table sorted by score descending.
  • CLI history: table uses SIMPLE_HEAD style; score breakdown shown as sub-table when --score-breakdown is passed.
  • Novelty weights: recalibrated after tier C went live: url_first_in_package 10->5, url_first_globally 15->10, maintainer_first_in_package 20->15. Prevents a borderline package from jumping straight to High.
  • Homograph detection in buckets.py: completely rewritten with _script_of(), _decode_punycode(), and compatible script groups.
  • Rule engine: supports experimental flag, function-name scoping (build(), pkgver(), etc.), and added_only filter for raw-line rules.
  • detect_verification_evidence: now takes checksum_behavior parameter so SKIP is never incorrectly credited.
  • Docs: all stale weighting values and rule ranges corrected across 7 doc pages; missing first_seen and suppressed_rules fields documented in report schema.
  • rebaseline.py: new --order chain|filename and --warm flags for true commit-order replay with observation counting.
  • build_corpus.py: validates existing bare repos, handles git clone timeouts (6h), cleans up partial clones on interrupt.
  • Packaging: AUR PKGBUILD now follows Arch packaging guidelines: single-quoted strings, python-pytest in makedepends, no --no-isolation, description under 80 chars, no self-referencing.

Stats

  • 19 commits since v0.2.1
  • 574 tests, all passing (was 267)
  • 21 new rules (14 detection + 4 context + restored C006/C007 from prior work)
  • 178k seed URLs: auto-imported on first run, no manual step needed
  • 100% FATAL recall preserved, CRITICAL p5 unchanged at 40