#!/usr/bin/env python3 """AppSecBench top-level orchestrator. Runs the full pipeline: build -> validate -> statistics. Usage: python appsecbench.py # build + validate + statistics python appsecbench.py --no-build # validate + statistics only """ from __future__ import annotations import argparse import subprocess import sys from pathlib import Path ROOT = Path(__file__).resolve().parent SCRIPTS = ROOT / "scripts" def run(mod: str, *extra) -> int: cmd = [sys.executable, str(SCRIPTS / mod)] + list(extra) print(f"\n>>> {' '.join(cmd)}") return subprocess.call(cmd) def main(): ap = argparse.ArgumentParser(description="AppSecBench pipeline orchestrator") ap.add_argument("--no-build", action="store_true", help="skip generation, only validate+stats") ap.add_argument("--no-validate", action="store_true") ap.add_argument("--no-stats", action="store_true") args = ap.parse_args() if not args.no_build: if run("build.py") != 0: print("BUILD FAILED"); return 1 if not args.no_validate: if run("validate.py") != 0: print("VALIDATION FAILED"); return 1 if not args.no_stats: if run("statistics.py") != 0: print("STATISTICS FAILED"); return 1 print("\nAppSecBench pipeline complete.") return 0 if __name__ == "__main__": raise SystemExit(main())