Ignore Options
Overview
Section titled “Overview”The .olympix-ignore.json file allows users to specify which vulnerabilities should be ignored in specific files and lines within their repository. This file must be placed at the root of the repository to be recognized and applied across all tools.
File Structure
Section titled “File Structure”The .olympix-ignore.json file follows a structured JSON format as shown below:
{ "IgnoredVulnerabilities" : { "<DETECTOR-SLUG>" : { "<FILENAME>" : [<LINENUM>, ...] }, ... }, "IgnoredPaths" : [ "<PATH_PATTERN>", ... ]}Explanation:
Section titled “Explanation:”IgnoredVulnerabilities: A dictionary where each key is a detector slug representing a specific vulnerability type.<DETECTOR-SLUG>: A string representing the detector slug, e.g.,abi-encode-packed-dynamic-types. You can get the slug by running theolympix show-vulnerabilitiescommand in the CLI.<FILENAME>: The path to the file where the vulnerability is ignored.[<LINENUM>, ...]: An array of line numbers in the specified file where the vulnerability is ignored.
IgnoredPaths: An array of filepaths that specify what all paths should the analyzer ignore.- For each of the entries in the array, the analyzer will ignore any filepaths that start with that entry.
Example
Section titled “Example”Here is an example .olympix-ignore.json file:
{ "IgnoredVulnerabilities" : { "abi-encode-packed-dynamic-types" : { "src/contracts/FraxlendPairDeployer.sol" : [255, 300, 450], "src/contracts/AnotherContract.sol" : [120, 180] }, "reentrancy" : { "src/contracts/SafeContract.sol" : [75, 150, 225], "src/contracts/CriticalModule.sol" : [90, 200] } }, "IgnoredPaths": [ "src/contracts/external", "src/contracts/vendors", "src/contracts2/DontScanMe.sol" ]}Ignore Comment
Section titled “Ignore Comment”In any line of your code that you want to be ignore by the analyzer, you can add the following comments:
//#olympix-ignore- This will disable this line for all detectors.//#olympix-ignore-<DETECTOR-SLUG>- This will only disable that detector for that line.
To effectively ignore vulnerabilities, ensure that:
- The file is committed to the repository root.
- The specified detector slugs, filenames, and line numbers match the vulnerability reports.
The ignore file will soon be deprecated, plese refer to the ConfigOptions section to use the most up to date version.