First scan
Basic scanning
Scan with the remote rulesets, which SCANOSS curates and maintains. This is the recommended setup:Common use cases
In CI/CD, fail the build when the scan finds anything:rules block:
annotate re-runs detection against a cached graph fragment instead of rebuilding the graph:
scan when the source code has changed, and annotate when only the rules have changed. On a large library, a re-scan that took several minutes takes a fraction of that time with annotate. annotate also accepts --scanner-jobs and --opengrep-mode, and honors SCANOSS_SCANNER_JOBS and SCANOSS_OPENGREP_MODE, for its OpenGrep detection process, so its annotations keep matching scan --export-graph-fragment.
Configuration
You can configure Crypto Finder with command-line flags, environment variables, or configuration files.scanoss.json:
Command-line arguments
For a complete list of commands and options, run
crypto-finder --help.
Checking your version
Advanced topics
Scoping detection to changed files
Detection, call graph construction, and dependency root discovery all share one matcher,--exclude. If you exclude the files a change didn’t touch, they also drop out of the call graph. A changed file’s own findings can then flip from reachable to unreachable, because their callers were excluded too.
--detect-paths-from <file> scopes only the detection pass. The call graph, reachability, and dependency root discovery still read the whole target, so callers outside the list are still seen and reachability stays correct. <file> is a plain text file with one path per line, relative to the target. Pass - to read the list from stdin:
--exclude, the default exclusions, and .gitignore, as in a full scan, so the scope never includes a file that a full scan would skip. The option has these limitations:
- OpenGrep only. Semgrep doesn’t implement the scoping interface and returns
invalid_arguments. - With
--scan-dependencies, Crypto Finder still scans dependencies in full. The path list scopes only the target’s own files. - Crypto Finder skips a listed file that no longer exists, such as one deleted in the diff, instead of failing. A listed directory, or a path outside the target, is an error.
- An empty or all-deleted list scans nothing. It never falls back to scanning the whole target.
Reachability without dependency resolution
Without--scan-dependencies, or when it resolves no dependencies, crypto-finder has no set of “user packages” to classify reachability against. Every finding, including those in your own first-party code, then reports not_applicable instead of reachable or unreachable. This is a problem for an incremental or CI re-scan that skips dependency resolution on purpose because no manifest or lockfile changed.
--export-callgraph-project-reachability builds that set from the target’s own source packages instead. First-party findings then get the same reachable or unreachable verdicts that a full --scan-dependencies run would give them. The flag never classifies findings in dependency code, which still need --scan-dependencies. It also treats every source file under the target as first-party. A vendored package that the default exclusions don’t cover is therefore misclassified as project code instead of being attributed to a dependency.
Since 0.50.0, when a module has a recognized entry point (main, a Python __main__ guard or console script, a package.json main or bin target, or a framework entry point such as a Flask route or an axum handler), an application function that nothing calls is treated as dead code rather than as a chain root, so crypto that only such a function reaches reads unreachable. A module with no entry point keeps the previous behavior. Since 0.51.0, a name in a comment or inside a longer string literal, an inert built-in marker such as #[allow(dead_code)], @functools.lru_cache or @Deprecated, and a Java instance method of a class the application never creates no longer keep such a function a root. See Call graph export for which uncalled functions stay roots.
Leave this flag off when scanning a library on its own. A function with no
caller in that case is public API, not dead code, and treating the library
as a self-contained project would misclassify it as unreachable.
Features
Crypto Finder supports OpenGrep (recommended) and Semgrep as configurable scan engines. Semgrep adds taint analysis, which tracks data flow across procedures. By default, OpenGrep runs in core mode, which callsopengrep-core directly and skips the Python wrapper’s startup and rule loading.
In C and C++ codebases, Crypto Finder removes findings inside statically dead preprocessor regions, such as #if 0, #ifdef, and #ifndef blocks, to avoid false positives. It does this automatically whenever it detects C or C++ files, with no extra flags. C and C++ findings in a component of another language, such as C code bundled in a Python package, report c or c++ as their language.
Call graph construction and --export-callgraph reachability cover C, C++, Go, Java, JavaScript/TypeScript, Python, and Rust. Recursive dependency scanning (--scan-dependencies) currently resolves third-party packages for Go, Java (Maven/Gradle), Python (pip), Rust (Cargo), and Node (npm). See Dependency scanning.
Crypto Finder fetches SCANOSS-maintained rulesets from the SCANOSS API and caches them locally. If the remote is unavailable, it uses the local cache instead. You can combine the remote rulesets with local custom rules, and configure Crypto Finder with CLI flags, environment variables, or a scanoss.json configuration file.
Output is JSON or a CycloneDX 1.7 CBOM. Official Docker images run in GitHub Actions, GitLab CI, Jenkins, and other CI/CD platforms.
The remote ruleset cache has a configurable time-to-live (TTL). When the remote is unavailable, Crypto Finder falls back to expired cache entries. Pass --strict to turn that fallback off.