Skip to main content

Excluding Files from Scans

When creating a project, you can optionally exclude certain folders or files from the scan process under the Location properties.

Note

The information here applies to SAST versions 9.2, 9.3, 9.4, and 9.5.

Enter a list of the folders or files that you want to exclude from the scan, using the syntax rules and guidelines in the following tables.

Table 5. Exclusion List Syntax Rules

Separate the items in the list with commas (,).

The list is not case sensitive.

The directory delimiters, forward slash (/) and backslash (\), are inter-changeable.

The following wildcards are allowed:

  • An asterisk (*) matches zero or more characters

  • A question mark (?) matches one character



Table 6. Avoid...

Special characters that are not supported in Windows.

Beginning a path with either a forward slash (/) or backslash (\) (this syntax is not correct, and it therefore prevents any exclusions).

Entering double asterisks (**) (this syntax is not correct, and it therefore prevents any exclusions).

Scanning two files with the same name.



Table 7. Examples

Sample Path

Explanation

HelloWorld\master\Prod

Excludes all the files and subfolders under the Prod folder, but all the files and subfolders above are included in the scan.

HelloWorld\master\Prod\*

Excludes all the subfolders, and files in those subfolders, under the Prod folder, but all the files directly in the Prod folder are scanned.

HelloWorld\abc*

Excludes all folders with names that start with 'abc' (for example, abc, abc1, abc2, and abcdefghi).

HelloWorld\abc?

Excludes all folders with names that start with 'abc' and end with a single character (for example, abc1, abc2, and abcd).

HelloWorld\abc*/*

Excludes all subfolders in folders with names that start with 'abc', but all the files directly in the folders that start with 'abc' are scanned.

HelloWorld\*abc

Excludes all folders with names that end with 'abc' (for example, abc, 1abc, 2abc, and ZYXWabc).

HelloWorld\?abc

Excludes all folders with names that start with a single character and end with 'abc' (for example, 1abc, 2abc, and Zabc).

HelloWorld\*abc*

Excludes all folders that contain the characters 'abc' anywhere in their names (for example, 1abc23, abc, abc2, and 321abc123).



Table 8. Caution: Avoid the following common mistakes

Path

Explanation

\HelloWorld\master\Prod

Beginning a path with either a forward slash (/) or backslash (\) is not correct.

HelloWorld\master\Prod\**

Using double asterisks (**) is not correct.

**\HelloWorld\master\Prod

Using double asterisks (**) is not correct.