scanoss.json file contains project information and BOM (Bill of Materials) rules. It allows you to include, remove or replace components in the BOM before and after scanning.
What Can You Do With It?
The settings file lets you:- Define Your Scope Control exactly which files get scanned and which don’t, saving time and processing power.
- Set Scanning Depth Choose how thoroughly you want to analyze your code, from quick scans to deep dives.
- Configure Detection Rules Fine-tune how components are identified in your codebase.
- Customise Output Format Get results that match your needs, whether it’s detailed reports or focused summaries.
- Manage Component Information Control how your software components are identified and represented.
How It Helps
- Efficiency: Skip unnecessary files and focus on what matters
- Accuracy: Guide the scanner to make better decisions
- Flexibility: Adapt the scanning process to your specific needs
- Consistency: Maintain standardized scanning across your projects
Schema Overview
Download a sample settings file here: scanoss-settings-schema.json The settings file consists of two main sections:Project Information
Theself section contains basic information about your project:
Settings
Thesettings object allows you to configure various aspects of the scanning process. Currently, it provides control over which files should be skipped during scanning through the skip property.
Skip configuration
Theskip object lets you define rules for excluding files from being scanned or fingerprinted. This can be useful for improving scan performance and avoiding unnecessary processing of certain files.
Properties
Patterns use the same syntax as .gitignore files. For more details, refer to the gitignore pattern documentation. skip.patterns.scanning: A list of file patterns to exclude from scanning.| Property | Description |
|---|---|
| Type | Array of strings |
| Required | No |
| Property | Description |
|---|---|
| Type | Array of strings |
| Required | No |
| Property | Description |
|---|---|
| Type | Object |
| Required | No |
- patterns (array of strings) — List of glob patterns to apply the min/max size rule
- min (integer) — Minimum file size in bytes
- max (integer, required) — Maximum file size in bytes
| Property | Description |
|---|---|
| Type | Object |
| Required | No |
- patterns (array of strings) — List of glob patterns to apply the min/max size rule
- min (integer) — Minimum file size in bytes
- max (integer, required) — Maximum file size in bytes
Pattern Format Rules
- Patterns are matched relative to the scan root directory
- A trailing slash indicates a directory (e.g.,
path/matches only directories) - An asterisk
*matches anything except a slash - Two asterisks
**match zero or more directories (e.g.,path/**/foldermatchespath/to,path/to/folder,path/to/folder/b) - Range notations like
[0-9]match any character in the range - Question mark
?matches any single character except a slash
Complete Example
Here’s a comprehensive example combining pattern and size-based skipping.BOM
Thebom section defines rules for modifying the BOM before and after scanning. It contains three main operations:
Include Rules
Rules for adding context when scanning. These rules will be sent to the SCANOSS API meaning they have more chance of being considered part of the resulting scan.Remove Rules
Rules for removing files from results after scanning. These rules will be applied to the results file after scanning. The post processing happens on the client side.Replace Rules
Rules for replacing components after scanning. These rules will be applied to the results file after scanning. The post processing happens on the client side.Important Notes
Matching Rules- Full Match: Requires both PATH and PURL to match. It means the rule will be applied ONLY to the specific file with the matching PURL and PATH.
- Partial Match: Matches based on either: - File path only (PURL is optional). It means the rule will be applied to all files with the matching path. - PURL only (PATH is optional). It means the rule will be applied to all files with the matching PURL.
- All paths should be specified relative to the scanned directory
- Use forward slashes (
/) as path separators
/project/src, then:
component.jsis a valid pathlib/utils.pyis an invalid path and will not match any files
src/component.jsis a valid pathlib/utils.pyis a valid path
- Format:
pkg:<type>/<namespace>/<name>@<version> - Examples: -
pkg:npm/vue@2.6.12-pkg:golang/github.com/golang/go@1.17.3 - Must be valid and include all required components
- Version is strongly recommended but optional