> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/scan-fix-and-prevent/fix/prioritize-issues-for-fixing/ignore-issues/exclude-files-and-ignore-issues-faqs.md).

# Exclude files and ignore issues FAQs

Frequently asked questions about excluding files and ignoring issues in Snyk

There are many considerations in determining how excluding files and ignoring issues will work, depending on several factors:

* How the Project was imported: through an SCM integration, or through the CLI or an IDE
* The scanning method being used: Open Source, Code, Container, or IaC
* How the test is being done, in the UI, or through the CLI or an IDE
* How the exclude or ignore was set: in a policy, through the UI or the API, or in the `.snyk` file

This document collects questions the support team receives frequenty and provides the answers.

## Questions related to scanning methods

### How do I ignore issues and vulnerabilities in Code (SAST) scans?

You cannot use the `.snyk` file to ignore a specific Snyk Code finding. For Snyk Code, the `.snyk` file excludes files and directories from the scan; it does not suppress individual findings.

To ignore a Snyk Code finding, use one of the methods in [How to ignore a Snyk Code finding](/scan-fix-and-prevent/fix/prioritize-issues-for-fixing/ignore-issues.md#how-to-ignore-a-snyk-code-finding).

With [Consistent Ignores for Snyk Code](/scan-fix-and-prevent/fix/prioritize-issues-for-fixing/ignore-issues/consistent-ignores-for-snyk-code.md), ignores created with `snyk ignore create` apply to CLI and IDE test runs. They do not apply to SCM (stateful) tests run through the Import API, and they do not support CLI Upload projects. A policy scoped by Project attributes does not apply in the CLI or IDE when no Snyk Project is available. To display ignored findings, run `snyk code test --include-ignores`.

The `snyk-to-html` tool displays all issues for Code scans, whether the issues are ignored or not.

### How do I avoid scanning certain files for Open Source scans?

* Use the --`exclude` option when scanning with the CLI to omit scanning directories or files but not paths. This option excludes all directories or all files with specified names. For details, see [the --exclude option](https://docs.snyk.io/developer-tools/snyk-cli/commands/test#exclude-less-than-name-greater-than-less-than-name-greater-than-...greater-than) in the CLI `test` command help.
* If you import a Project through an SCM integration, add the folders to exclude in the **Exclude folders** field of the import window. You can exclude folders only. For details, see [Stage 2: Import Project](https://docs.snyk.io/developer-tools/integrations/scm-integrations/deployment-recommendations#stage-2-import-projects) in Git repositories deployment recommendations.
* You cannot use an `exclude` block in a `.snyk` file for Open Source scans except for unmanaged scans. For details, see [Ignore files or folders using glob expression - Snyk Code and `unmanaged`only](https://docs.snyk.io/developer-tools/snyk-cli/commands/ignore#ignore-files-or-folders-using-glob-expression-snyk-code-and-unmanaged-only).

### How do I avoid scanning certain files for Code scans?

* Use an exclude in a `.snyk` file to omit all scanning of certain files or folders from a Snyk Code scan. For details, see the [`--file-path` option for the `snyk ignore` command](https://docs.snyk.io/developer-tools/snyk-cli/commands/ignore#file-path-less-than-path_to_resource-greater-than), [Ignore files or folders using glob expression - Snyk Code and `unmanaged`only](https://docs.snyk.io/developer-tools/snyk-cli/commands/ignore#ignore-files-or-folders-using-glob-expression-snyk-code-and-unmanaged-only), and [Exclude directories and files from Snyk Code CLI tests](https://docs.snyk.io/developer-tools/snyk-cli/scan-and-maintain-projects-using-the-cli/snyk-cli-for-snyk-code/exclude-directories-and-files-from-snyk-code-cli-tests).
* When you import a repository to test using Snyk Code, use an `exclude:` statement in the `.snyk` file to omit certain directories and files from the import. For details see For details see [Exclude directories and files from Snyk Code CLI tests](https://docs.snyk.io/developer-tools/snyk-cli/scan-and-maintain-projects-using-the-cli/snyk-cli-for-snyk-code/exclude-directories-and-files-from-snyk-code-cli-tests).
* A `.snyk` file with file or folder exclusions and contained in the root directory of your repository or SCM will exclude those files and folders from being scanned when you import using an SCM.
* The CLI `--exclude` option used with `snyk test` and `snyk monitor` does not apply for Code scans.
* The Exclude Folders option in the import windows in the Web UI does not apply for Code scans.
* The `.snyk` file does not apply for excluding files and directories from IDE scanning of Code.
* For Code and Container scans only., you can use exclusion globs in API import, including an import with the `snyk-api-import` tool. This exclusion works the same way as an SCM integration exclusion.

### Can I ignore a Snyk Code finding by rule ID in the `.snyk` file?

No. The `ignore` block in the `.snyk` file does not accept a Snyk Code rule ID, and there is no `.snyk` syntax for ignoring a Code finding by rule ID and file path. The `ignore` block applies to Snyk Open Source, Snyk Container, and Snyk IaC issues only.

To ignore a specific Snyk Code finding, use the Snyk Web UI or the `snyk ignore create` command. For details, see [How do I ignore issues and vulnerabilities in Code (SAST) scans?](#how-do-i-ignore-issues-and-vulnerabilities-in-code-sast-scans)

### How do I avoid scanning certain files for Container scans?

See the last bullet in the previous section and the [`--exclude-app-vulns`](https://docs.snyk.io/developer-tools/snyk-cli/commands/container-test#exclude-app-vulns), [`--exclude-base-image-vulns`](https://docs.snyk.io/developer-tools/snyk-cli/commands/container-test#exclude-base-image-vulns), and [`--exclude-node-modules`](https://docs.snyk.io/developer-tools/snyk-cli/commands/container-test#exclude-node-modules)options in the `snyk container test` help.

### How do I avoid scanning certain files for IaC scans?

See [IaC exclusions using the command line](https://docs.snyk.io/developer-tools/snyk-cli/scan-and-maintain-projects-using-the-cli/snyk-cli-for-iac/iac-exclusions-using-the-command-line).

## Question related to ways excludes and ignores are set

Why do ignores in the `.snyk` file in the root directory of my monorepo apply to all Projects when I scan with the CLI but not when I import using my SCM?

For SCM scanning, the `.snyk` file must be present in each relevant subdirectory. See [Monorepos and complex Project considerations](https://docs.snyk.io/scan-fix-and-prevent/fix/prioritize-issues-for-fixing/ignore-issues/pages/9glmQ5scbAaqPr49sLVE#use-the-.snyk-file-with-monorepos-and-complex-projects) with the `.snyk` file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/scan-fix-and-prevent/fix/prioritize-issues-for-fixing/ignore-issues/exclude-files-and-ignore-issues-faqs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
