Skip to content

Ignore Options

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.

The .olympix-ignore.json file follows a structured JSON format as shown below:

{
"IgnoredVulnerabilities" : {
"<DETECTOR-SLUG>" : {
"<FILENAME>" : [<LINENUM>, ...]
}, ...
},
"IgnoredPaths" : [
"<PATH_PATTERN>",
...
]
}
  • 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 the olympix show-vulnerabilities command 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.

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"
]
}

In any line of your code that you want to be ignore by the analyzer, you can add the following comments:

  1. //#olympix-ignore - This will disable this line for all detectors.
  2. //#olympix-ignore-<DETECTOR-SLUG> - This will only disable that detector for that line.

To effectively ignore vulnerabilities, ensure that:

  1. The file is committed to the repository root.
  2. 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.