class
Analyzer::Clojure::Cli
- Analyzer::Clojure::Cli
- Analyzer
- Reference
- Object
Overview
Surfaces the command-line attack surface of Clojure programs as cli://
endpoints: clojure.tools.cli option specs, cli-matic config,
babashka.cli spec/dispatch tables, environ.core env lookups, and
command-line-args / (System/getenv). Line-scan, merged by URL.
Defined in:
analyzer/analyzers/clojure/cli.crConstant Summary
-
BB_CMDS =
/:cmds\s+\[([^\]]*)\]/ -
Whole
:cmds [...]vector (may hold several segments, e.g.["docker" "start"]). -
ENVIRON_ENV =
/\(\s*env\s+:([A-Za-z][\w-]*)/ -
ENVIRON_REFER_ENV =
/environ\.core\s*:refer\s*\[[^\]]*\benv\b/ -
envbound bare from environ.core:(:require [environ.core :refer [env]]). Never trust an alias (:as environ) or an unrelated local/param namedenv. -
GET_ENV =
/\(\s*System\/getenv\s+"([^"]+)"/ -
MARKERS =
/clojure\.tools\.cli\b|\(\s*(?:[\w.-]+\/)?parse-opts\b|\bcli-matic\b|\*command-line-args\*|\bbabashka\.cli\b/ -
NOTE environ.core is intentionally absent here. It's a generic 12-factor config-reading library used by web apps/workers/services just as much as CLIs (same category as bare System/getenv, below) — it must never gate CLI detection on its own. It only annotates params on a
cli://endpoint some OTHER marker below already established. -
MATIC_COMMAND =
/:command\s+"([^"]+)"/ -
MATIC_OPTION =
/:option\s+"([A-Za-z0-9][\w-]*)"/ -
NTH_ARGS =
/\(\s*nth\s+(?:\*command-line-args\*|args)\s+(\d+)/ -
TOOLS_CLI_LONG =
/"--([A-Za-z0-9][\w-]*)/ -
TOOLS_CLI_SPEC =
/\[\s*(?:(?:"-[A-Za-z0-9]"|nil)\s+)?"--/ -
WEB_RE =
/\b(?:compojure|ring\.adapter|reitit|io\.pedestal|httpkit|aleph)\b/