Skip to main content

Configuration Priority

Settings are applied in the following priority order (highest to lowest):
  1. Command-line flags (e.g., --api-key, --scanner)
  2. Environment variables (e.g., SCANOSS_API_KEY)
  3. Config file (~/.scanoss/crypto-finder/config.json)
  4. Project settings (scanoss.json in target directory)
  5. Default values

Application Configuration

Config File Location

Setting Up Configuration

Use the configure command to set persistent application settings:

Config File Format

Environment Variables

Java Runtime Selection

For Java dependency scans and call graph export, Crypto Finder can select a specific JDK major per scan:
  • CLI: --java-jdk-major and repeatable --java-jdk-home <major>=<path>
  • Environment/config: SCANOSS_JAVA_JDK_MAJOR, SCANOSS_JAVA_JDK_HOMES, or the matching config file keys
  • Supported majors: 8, 11, 17, 21
  • Standalone CLI default: auto (use ambient JAVA_HOME when available)
Example:

FindingsCache Backend

Crypto Finder caches per-dependency scan results in a FindingsCache so warm scans skip the OpenGrep work for already-analysed dependencies. Two backends are supported: Selecting the backend:
  • CLI: --findings-cache=disk or --findings-cache=postgres
  • Environment: SCANOSS_FINDINGS_CACHE_BACKEND=postgres
  • Config file: findings_cache_backend: postgres
When postgres is selected, the connection string MUST be provided via SCANOSS_FINDINGS_CACHE_DSN. The scan exits with a clear error if it is missing — there is no silent fallback to disk, because a misconfigured fleet would otherwise lose cache sharing without surfacing the bug. The table is bootstrapped on first use (idempotent CREATE TABLE IF NOT EXISTS); no separate migration step is required. The default table name is findings_cache; override with SCANOSS_FINDINGS_CACHE_TABLE if you run multiple deployments in the same database. Example:
Behaviour notes:
  • The cache key includes the rules hash, so changing rules invalidates entries automatically — no manual eviction needed.
  • Failures of the disk backend are non-fatal (a warning is logged and the scan continues without caching). Failures of the postgres backend (missing DSN, unreachable database, schema bootstrap error) are fatal.
  • The Postgres pool is opened per crypto-finder scan invocation and closed when the scan finishes. For long-lived workers, reuse a single binary process where possible to amortise pool setup.

Project Configuration (scanoss.json)

The scanoss.json file in your project directory configures scan behavior and skip patterns.

File Location

Place scanoss.json in the root of the directory you’re scanning:

Configuration Schema

Crypto Finder follows the SCANOSS Settings Schema.

Basic Example

Skip Patterns

Skip patterns control which files and directories are excluded from scanning.

Default Skip Patterns

The following patterns are automatically excluded: Version Control:
  • .git/
  • .svn/
  • .hg/
  • .bzr/
Dependencies:
  • node_modules/
  • vendor/
  • venv/
  • virtualenv/
  • __pycache__/
Build Artifacts:
  • dist/
  • build/
  • target/
  • *.min.js
  • *.min.css
Archives:
  • *.zip
  • *.tar
  • *.tar.gz
  • *.tar.bz2
  • *.jar
  • *.war
  • *.ear
Binaries:
  • *.exe
  • *.dll
  • *.so
  • *.dylib
  • *.bin
Generated / vendored stubs:
  • shaded/
  • *OuterClass.java
  • *_pb2.py, *_pb2_grpc.py
  • *.pb.go, zz_generated*.go
  • *_pb.js, *_pb.ts
  • *.pb.cc, *.pb.h, *.grpc.pb.cc, *.grpc.pb.h
  • Files whose header is the protocol-buffer compiler marker (or prost/bindgen), except protobuf runtimes scanned as the target artifact
For the complete list, see Default Skip Patterns.

Custom Skip Patterns

Pattern Types

  1. Directory patterns (end with /):
  2. File extension patterns:
  3. Specific file patterns:
  4. Path patterns:

Size Limits

Configure maximum file size to scan:

Advanced Configuration Examples

Monorepo Configuration

For large monorepos with multiple subprojects:

Frontend Project Configuration

Optimized for JavaScript/TypeScript projects:

Backend Project Configuration

Optimized for Java/Python/Go projects:

CI/CD Optimized Configuration

Minimal scanning for fast CI/CD pipelines:

Scanner Configuration

Choosing a Scanner

Crypto Finder supports multiple scanners. Select via command-line flag:

Cross-File Analysis (Semgrep Pro)

When using the Semgrep scanner, you can enable cross-file (interfile) analysis with the --interfile flag. This adds the --pro flag to the underlying Semgrep command, enabling Semgrep Pro features such as cross-file taint tracking and type inference.
Note: The --interfile flag is only supported with --scanner semgrep. Using it with other scanners will result in an error. A valid Semgrep Pro license is required.

Language Detection

Automatic Detection

By default, crypto-finder uses go-enry to automatically detect project languages.

Manual Override

Override detected languages when needed:

Supported Languages

The scanner supports rules for:
  • C/C++
  • C#
  • Go
  • Java
  • JavaScript/TypeScript
  • Kotlin
  • PHP
  • Python
  • Ruby
  • Rust
  • Swift
  • And more…
Language detection ensures only relevant rules are loaded, improving scan performance.

Timeout Configuration

Default Timeout

Default scan timeout: 10 minutes

Custom Timeout

Output Configuration

Output Destination

Output Format

Logging Configuration

Verbosity Levels