CSMOCK(1)

πŸ“¦
version 3.8.7 Β· 5 versions
, in epel 9

πŸ’… CSMOCK(1) Β· User Commands Β· csmock πŸ’…

okay bestie, welcome to CSMOCK(1) β€” the csmock page, fresh from the User Commands section and ready to spill all the static-analysis tea β˜•βœ¨

πŸŽ€ NAME πŸŽ€

csmock β€” run static analysis of the given SRPM using mock. literally that’s the whole vibe πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

csmock takes your SRPM and sends it through static analyzers using mock. here’s the usage, copied exactly so nobody loses a single flag 🫢

usage: csmock [-h] [-r MOCK_PROFILE] [-t TOOLS] [-a] [-l] [--install
       INSTALL]

       [-o OUTPUT] [-f] [-j JOBS] [--rpm-build-opts RPM_BUILD_OPTS]
       [--cswrap-timeout CSWRAP_TIMEOUT] [-U EMBED_CONTEXT]
       [--warning-rate-limit WARNING_RATE_LIMIT] [--limit-msg-len
       LIMIT_MSG_LEN] [-k] [--skip-init] [--skip-build] [--use-ldpwrap]
       [--no-clean | --scrub-on-exit] [--no-scan] [--run-check]
       [--no-run-check] [--print-defects] [--no-print-defects]
       [--base-srpm BASE_SRPM] [--base-root BASE_MOCK_PROFILE]
       [--root-override MOCK_ROOT_OVERRIDE] [--hermetic-build LOCKFILE
       REPO_DIRECTORY] [--skip-patches | --diff-patches | -c SHELL_CMD]
       [--known-false-positives KNOWN_FALSE_POSITIVES] [--kfp-git-url
       KFP_GIT_URL] [--use-login-shell] [--no-use-login-shell]
       [--version] [--bandit-scan-build] [--no-bandit-scan-build]
       [--bandit-scan-install] [--no-bandit-scan-install]
       [--bandit-evt-filter BANDIT_EVT_FILTER] [--bandit-severity-filter
       {LOW,MEDIUM,HIGH}] [--cbmc-add-flag CBMC_ADD_FLAG]
       [--cbmc-timeout CBMC_TIMEOUT] [--clang-add-flag CLANG_ADD_FLAG]
       [--use-host-cppcheck] [--cppcheck-add-flag CPPCHECK_ADD_FLAG]
       [--divine-add-flag DIVINE_ADD_FLAG] [--divine-timeout
       DIVINE_TIMEOUT] [--strace-add-flag STRACE_ADD_FLAG]
       [--valgrind-add-flag VALGRIND_ADD_FLAG] [--valgrind-timeout
       VALGRIND_TIMEOUT] [--symbiotic-add-flag SYMBIOTIC_ADD_FLAG]
       [--symbiotic-timeout SYMBIOTIC_TIMEOUT] [--gitleaks-bin-url
       GITLEAKS_BIN_URL] [--gitleaks-cache-dir GITLEAKS_CACHE_DIR]
       [--gitleaks-config GITLEAKS_CONFIG] [--gitleaks-rate-limit
       GITLEAKS_RATE_LIMIT] [--gitleaks-limit-msg-len
       GITLEAKS_LIMIT_MSG_LEN] [--gitleaks-refresh]
       [--infer-analyze-add-flag INFER_ANALYZE_ADD_FLAG]
       [--infer-archive-path INFER_ARCHIVE_PATH] [--infer-filter]
       [--no-infer-filter] [--infer-biabduction-filter]
       [--no-infer-biabduction-filter] [--infer-inferbo-filter]
       [--no-infer-inferbo-filter] [--infer-uninit-filter]
       [--no-infer-uninit-filter] [--infer-dead-store-severity]
       [--no-infer-dead-store-severity] [--infer-timeout INFER_TIMEOUT]
       [--pylint-scan-build] [--no-pylint-scan-build]
       [--pylint-scan-install] [--no-pylint-scan-install]
       [--pylint-evt-filter PYLINT_EVT_FILTER] [--semgrep-metrics
       SEMGREP_METRICS] [--semgrep-rules-repo SEMGREP_RULES_REPO]
       [--semgrep-verbose] [--semgrep-scan-opts SEMGREP_SCAN_OPTS]
       [--shellcheck-scan-build] [--no-shellcheck-scan-build]
       [--shellcheck-scan-install] [--no-shellcheck-scan-install]
       [--shellcheck-batch SHELLCHECK_BATCH] [--shellcheck-timeout
       SHELLCHECK_TIMEOUT] [--snyk-bin-url SNYK_BIN_URL | --snyk-bin
       SNYK_BIN] [--snyk-auth SNYK_AUTH] [--snyk-cache-dir
       SNYK_CACHE_DIR] [--snyk-refresh] [--snyk-timeout SNYK_TIMEOUT]
       [--snyk-code-test-opts SNYK_CODE_TEST_OPTS]
       [--unicontrol-bidi-only] [--unicontrol-notests] [-w
       GCC_WARNING_LEVEL] [--gcc-analyze] [--gcc-analyzer-bin
       GCC_ANALYZER_BIN] [--gcc-analyze-add-flag GCC_ANALYZE_ADD_FLAG]
       [--gcc-set-env] [--gcc-sanitize-address | --gcc-sanitize-leak |
       --gcc-sanitize-thread | --gcc-sanitize-undefined] [--gcc-add-flag
       GCC_ADD_FLAG] [--gcc-add-c-only-flag GCC_ADD_C_ONLY_FLAG]
       [--gcc-add-cxx-only-flag GCC_ADD_CXX_ONLY_FLAG] [--gcc-del-flag
       GCC_DEL_FLAG] [SRPM]

🌸 positional arguments: 🌸

  • SRPM β€” the source RPM package that the static analyzers are gonna scan, bestie πŸŽ€

πŸ’– optional arguments: πŸ’–

  • -h, --help β€” show this help message and exit, iconic behavior ✨
  • -r MOCK_PROFILE, --root MOCK_PROFILE β€” the mock profile to use; defaults to mock’s default πŸ’…
  • -t TOOLS, --tools TOOLS β€” comma-separated list of tools to enable (use --listavailable-tools to see the list of available tools) πŸ› οΈ
  • -a, --all-tools β€” enable all stable csmock plug-ins (use --listavailable-tools to see the list of available tools) πŸ‘‘
  • -l, --list-available-tools β€” list available tools and exit πŸ“‹
  • --install INSTALL β€” space-separated list of packages to install into the chroot πŸ“¦
  • -o OUTPUT, --output OUTPUT β€” name of the tarball or directory to put the results to 🎁
  • -f, --force β€” overwrite the resulting file or directory if it exists already πŸ’₯
  • -j JOBS, --jobs JOBS β€” maximal number of jobs running in parallel (passed to 'make') πŸƒ
  • --rpm-build-opts RPM_BUILD_OPTS β€” shell-quoted options passed to rpm-build 🧰
  • --cswrap-timeout CSWRAP_TIMEOUT β€” maximal amount of time taken by analysis of a single module [s] ⏱️
  • -U EMBED_CONTEXT, --embed-context EMBED_CONTEXT β€” embed a number of lines of context from the source file for the key event (defaults to 3). πŸ”
  • --warning-rate-limit WARNING_RATE_LIMIT β€” stop processing a warning if the count of its occurrences exceeds the specified limit (defaults to 1024). 🚦
  • --limit-msg-len LIMIT_MSG_LEN β€” limit length of diagnostic messages by the specified number of chars (defaults to 512). βœ‚οΈ
  • -k, --keep-going β€” continue as much as possible after an error 🫢
  • --skip-init β€” do not run 'mock --init' before the scan (may lead to unpredictable scan results) πŸ™ˆ
bestie, --skip-init can make scan results unpredictable β€” you’ve been warned πŸ’€
  • --skip-build β€” do not run %build and %install sections [EXPERIMENTAL] πŸ§ͺ
  • --use-ldpwrap β€” use ldpwrap instead of csexec-loader [EXPERIMENTAL] πŸ§ͺ
  • --no-clean β€” do not clean chroot when it becomes unused 🧹
  • --scrub-on-exit β€” scrub all caches after the scan 🧼
  • --no-scan β€” do not analyze any package, just check versions of the analyzers πŸ‘€
  • --run-check β€” run the %check section of specfile (disabled by default) βœ…
  • --no-run-check β€” disables --run-check ❌
  • --print-defects β€” print the resulting list of defects (default if connected to a tty) πŸ–¨οΈ
  • --no-print-defects β€” disables --print-defects πŸ™…
  • --base-srpm BASE_SRPM β€” perform a differential scan against the specified base package πŸ†š
  • --base-root BASE_MOCK_PROFILE β€” mock profile to use for the base scan (use only with --base-srpm) 🧬
  • --root-override MOCK_ROOT_OVERRIDE β€” override the build root directory for mock (disables yum and root cache) πŸ—οΈ
  • --hermetic-build LOCKFILE REPO_DIRECTORY β€” perform a hermetic (fully offline) build using a pregenerated lockfile and offline RPM repository (see mock --hermetic-build) πŸ“΄
  • --skip-patches β€” skip patches not annotated by %{?_rawbuild} (vanilla build) 🍦
  • --diff-patches β€” scan with/without patches and diff the lists of defects πŸ”¬
  • -c SHELL_CMD, --shell-cmd SHELL_CMD β€” use shell command to build the given tarball (instead of SRPM) 🐚
  • --known-false-positives KNOWN_FALSE_POSITIVES β€” suppress known false positives loaded from the given file (defaults to "/usr/share/csmock/known-falsepositives.js" if available) 🚫
  • --kfp-git-url KFP_GIT_URL β€” known false positives git URL (optionally taking a revision delimited by #) 🌐
  • --use-login-shell β€” use login shell for build (default) 🐚
  • --no-use-login-shell β€” disables --use-login-shell 🚫
  • --version β€” print the version of csmock and exit 🏷️
  • --bandit-scan-build β€” make bandit scan files in the build directory (disabled by default) πŸ•΅οΈ
  • --no-bandit-scan-build β€” disables --bandit-scan-build πŸ™…
  • --bandit-scan-install β€” make bandit scan files in the install directory (enabled by default) πŸ“¦
  • --no-bandit-scan-install β€” disables --bandit-scan-install πŸ™…
  • --bandit-evt-filter BANDIT_EVT_FILTER β€” report only Bandit defects whose key event matches the given regex (defaults to '^B[0-9]+') 🎯
  • --bandit-severity-filter {LOW,MEDIUM,HIGH} β€” suppress Bandit defects whose severity level is below given level (default 'LOW') ⚠️
  • --cbmc-add-flag CBMC_ADD_FLAG β€” append the given flag when invoking cbmc (can be used multiple times) 🧩
  • --cbmc-timeout CBMC_TIMEOUT β€” maximal amount of time taken by analysis of a single process [s] ⏱️
  • --clang-add-flag CLANG_ADD_FLAG β€” append the given flag when invoking clang static analyzer (can be used multiple times) 🧩
  • --use-host-cppcheck β€” use statically linked cppcheck installed on the host (automatically enables the Cppcheck plug-in) πŸ–₯️
  • --cppcheck-add-flag CPPCHECK_ADD_FLAG β€” append the given flag when invoking cppcheck (can be used multiple times) 🧩
  • --divine-add-flag DIVINE_ADD_FLAG β€” append the given flag when invoking divine (can be used multiple times) 🧩
  • --divine-timeout DIVINE_TIMEOUT β€” maximal amount of time taken by analysis of a single process [s] ⏱️
  • --strace-add-flag STRACE_ADD_FLAG β€” append the given flag when invoking strace (can be used multiple times) 🧩
  • --valgrind-add-flag VALGRIND_ADD_FLAG β€” append the given flag when invoking valgrind (can be used multiple times) 🧩
  • --valgrind-timeout VALGRIND_TIMEOUT β€” maximal amount of time taken by analysis of a single process [s] ⏱️
  • --symbiotic-add-flag SYMBIOTIC_ADD_FLAG β€” append the given flag when invoking symbiotic (can be used multiple times) 🧩
  • --symbiotic-timeout SYMBIOTIC_TIMEOUT β€” maximal amount of time taken by analysis of a single process [s] ⏱️
  • --gitleaks-bin-url GITLEAKS_BIN_URL β€” URL to download gitleaks binary executable (in a .tar.gz) from πŸ”—
  • --gitleaks-cache-dir GITLEAKS_CACHE_DIR β€” directory where downloaded Gitleaks tarballs are cached across runs πŸ—‚οΈ
  • --gitleaks-config GITLEAKS_CONFIG β€” local configuration file to be used for gitleaks βš™οΈ
  • --gitleaks-rate-limit GITLEAKS_RATE_LIMIT β€” drop warnings if their count exceeds the specified limit 🚦
  • --gitleaks-limit-msg-len GITLEAKS_LIMIT_MSG_LEN β€” trim message if it exceeds max message length βœ‚οΈ
  • --gitleaks-refresh β€” force download of gitleaks binary executable (in a .tar.gz) from πŸ”„
  • --infer-analyze-add-flag INFER_ANALYZE_ADD_FLAG β€” appends the given flag (except '-o') when invoking 'infer analyze' (can be used multiple times)(default flags '--bufferoverrun', '--pulse') 🧩
  • --infer-archive-path INFER_ARCHIVE_PATH β€” use the given archive to install Infer (default is /opt/infer-linux*.tar.xz) πŸ“¦
  • --infer-filter β€” apply false positive filter (enabled by default) βœ…
  • --no-infer-filter β€” disables --infer-filter ❌
  • --infer-biabduction-filter β€” applies the false-positive bi-abduction filter, and bestie it’s enabled by default ✨
  • --no-infer-biabduction-filter β€” disables --infer-biabduction-filter, periodt πŸ’…
  • --infer-inferbo-filter β€” applies the false-positive inferbo filter (enabled by default) πŸ¦‹
  • --no-infer-inferbo-filter β€” disables --infer-inferbo-filter, no cap πŸ™ˆ
  • --infer-uninit-filter β€” applies the false-positive uninit filter (enabled by default) 🌸
  • --no-infer-uninit-filter β€” disables --infer-uninit-filter πŸŽ€
  • --infer-dead-store-severity β€” lowers dead store severity (enabled by default) πŸ’œ
  • --no-infer-dead-store-severity β€” disables --infer-dead-store-severity ⭐
  • --infer-timeout INFER_TIMEOUT β€” the maximal amount of time taken by Infer’s analysis phase, in seconds [s] (default 300) ⏳
  • --pylint-scan-build β€” makes pylint scan files in the build directory (disabled by default) πŸ”
  • --no-pylint-scan-build β€” disables --pylint-scan-build 🫢
  • --pylint-scan-install β€” makes pylint scan files in the install directory (enabled by default) ✨
  • --no-pylint-scan-install β€” disables --pylint-scan-install πŸ’€
  • --pylint-evt-filter PYLINT_EVT_FILTER β€” filters out Pylint defects whose key event matches the given regex (defaults to '^W[0-9]+', use '.*' to get all defects detected by Pylint) 🎯
  • --semgrep-metrics SEMGREP_METRICS β€” configures whether usage metrics are sent to the Semgrep server (defaults to off) πŸ“‰
  • --semgrep-rules-repo SEMGREP_RULES_REPO β€” the semgrep rules repo, assuming rules are located under the 'rules' sub-directory πŸ—‚οΈ
  • --semgrep-verbose β€” shows more details about what rules are running, which files failed to parse, etc. πŸ‘€
  • --semgrep-scan-opts SEMGREP_SCAN_OPTS β€” a space-separated list of additional options passed to the 'semgrep scan' command 🧚
  • --shellcheck-scan-build β€” makes shellcheck scan files in the build directory (disabled by default) 🐚
  • --no-shellcheck-scan-build β€” disables --shellcheck-scan-build πŸ’…
  • --shellcheck-scan-install β€” makes shellcheck scan files in the install directory (enabled by default) 🌈
  • --no-shellcheck-scan-install β€” disables --shellcheck-scan-install πŸ™ˆ
  • --shellcheck-batch SHELLCHECK_BATCH β€” maximum number of scripts scanned by a single shellcheck process (defaults to 1) πŸ“¦
  • --shellcheck-timeout SHELLCHECK_TIMEOUT β€” maximum amount of wall-clock time taken by a single shellcheck process, in seconds [s] (defaults to 30) ⏰
  • --snyk-bin-url SNYK_BIN_URL β€” URL to download the snyk binary executable πŸ”—
  • --snyk-bin SNYK_BIN β€” path to the local snyk binary executable (skips download) πŸ“
  • --snyk-auth SNYK_AUTH β€” file containing the snyk authentication token πŸ”‘
  • --snyk-cache-dir SNYK_CACHE_DIR β€” directory where downloaded snyk tarballs are cached across runs πŸ—„οΈ
  • --snyk-refresh β€” forces download of the snyk binary executable πŸ”„
  • --snyk-timeout SNYK_TIMEOUT β€” maximum amount of time taken by invocation of Snyk, in seconds [s] βŒ›
  • --snyk-code-test-opts SNYK_CODE_TEST_OPTS β€” a space-separated list of additional options passed to the 'snyk code test' command πŸ§ͺ
  • --unicontrol-bidi-only β€” looks for bidirectional control characters only ↔️
  • --unicontrol-notests β€” excludes tests (basically test.* as a component of path) 🚫
  • -w GCC_WARNING_LEVEL, --gcc-warning-level GCC_WARNING_LEVEL β€” adjusts the GCC warning level. -w0 means default flags, -w1 appends -Wall and -Wextra, and -w2 enables some other useful warnings. (automatically enables the GCC plugin) ⚠️
  • --gcc-analyze β€” runs gcc -fanalyzer in a separate process πŸ”¬
  • --gcc-analyzer-bin GCC_ANALYZER_BIN β€” uses a custom build of gcc to perform the scan. Absolute path to the binary must be provided. πŸ“Œ
  • --gcc-analyze-add-flag GCC_ANALYZE_ADD_FLAG β€” appends the given flag when invoking gcc -fanalyzer (can be used multiple times) βž•
  • --gcc-set-env β€” sets $CC and $CXX to gcc and g++, respectively, for the build πŸ› οΈ
  • --gcc-sanitize-address β€” enables %check and compiles with -fsanitize=address 🧼
  • --gcc-sanitize-leak β€” enables %check and compiles with -fsanitize=leak πŸ’§
  • --gcc-sanitize-thread β€” enables %check and compiles with -fsanitize=thread 🧡
  • --gcc-sanitize-undefined β€” enables %check and compiles with -fsanitize=undefined πŸŒͺ️
  • --gcc-add-flag GCC_ADD_FLAG β€” appends the given compiler flag when invoking gcc (can be used multiple times) 🧷
  • --gcc-add-c-only-flag GCC_ADD_C_ONLY_FLAG β€” appends the given compiler flag when invoking gcc for C (can be used multiple times) πŸ‡¨
  • --gcc-add-cxx-only-flag GCC_ADD_CXX_ONLY_FLAG β€” appends the given compiler flag when invoking gcc for C++ (can be used multiple times) βž•βž•
  • --gcc-del-flag GCC_DEL_FLAG β€” drops the given compiler flag when invoking gcc (can be used multiple times) βž–

🌈 OUTPUT FORMAT 🌈

If it’s not overridden by the --output option, csmock creates an archive NVR.tar.xz in the current directory for an SRPM named NVR.src.rpm (or NVR.tar.* if the --shell-cmd option is used). The archive contains a directory named NVR as the only top-level directory, containing these items, bestie:

  • scan-results.err β€” scan results encoded as plain-text (for source code editors) πŸ“
  • scan-results.html β€” scan results encoded as HTML (suitable for web browsers) 🌐
  • scan-results.js β€” scan results, including scan metadata, encoded using JSON 🧾
  • scan-results-summary.txt β€” total count of defects found by particular checkers πŸ”’
  • scan.ini β€” scan metadata encoded in the INI format βš™οΈ
  • scan.log β€” scan log file (useful for debugging scan failures) πŸͺ΅
  • debug β€” a directory containing additional data (intended for csmock debugging) 🐞
Note that external plug-ins of csmock may create additional files (not covered by this man page) in the directory with results. πŸ‘€

That’s the whole page, bestie β€” source/version csmock csmock-3.8.7-1.el9, dated June 2026. Now go scan something iconic πŸ’…βœ¨

πŸ“¦ where this page comes from