Skip to main content

Overview

The .cybeignore file lets you exclude specific files or directories from SAST vulnerability reports. It uses the same syntax as .gitignore, so it is familiar and easy to use.
To suppress a single finding on one precise line instead of a whole file, use an inline cybedefend-ignore comment.

How It Works

Create a .cybeignore file in your project’s root directory to define exclusion patterns. Vulnerabilities found in matching files are automatically filtered from scan results.

Where CybeDefend Looks

The scanner reads the first file it finds, in this order:
.cybedefend is deprecated. It still works and nothing breaks today, but it collides with the .cybedefend/ directory that VibeDefend creates for config.json — a single path cannot be both a file and a directory. Rename your file to .cybeignore; the contents do not change.
If your repository is linked with VibeDefend, you already have a .cybedefend/ directory. You have two options, and they behave identically:
  • Put your patterns in .cybeignore at the project root (recommended), or
  • Put them in .cybedefend/ignore, alongside config.json.

Usage

Creating a .cybeignore File

Create a file named .cybeignore in your project root:

Migrating from .cybedefend

Renaming the file is the whole migration — the syntax is unchanged:
If you use VibeDefend and the root path is taken by the .cybedefend/ directory, move your patterns inside it instead:

Supported Patterns

The syntax is identical to .gitignore: Negation is the tool for excluding a whole class while keeping one member of it under review:

Scope

.cybeignore filters every finding produced by the SAST/IaC scanner binary:
Excluding a file also hides its secret findings. Gitleaks runs as a second pass inside the same scanner and shares the same exclusion list, so a path you exclude here stops being reported for hardcoded credentials too — including credentials a later commit adds to that file.This matters most for the patterns people reach for first. **/*.spec.ts or tests/ will silence Gitleaks across your whole test suite, which is exactly where fixture credentials — and the occasional real one pasted in by mistake — tend to live.
When only a few findings in a file are false positives, prefer inline cybedefend-ignore comments over listing the whole file here: the exclusion stays scoped to the lines you reviewed, and the rest of the file keeps being scanned.

Common Use Cases

Ignore Test Code

Ignore Third-Party Code

Ignore Demo/Example Code

Ignore Configuration Templates

Best Practices

Use .cybeignore responsibly. Don’t ignore real vulnerabilities in production code.

Exclude Files, Not Findings You Dislike

A file-level exclusion is right when the whole file is out of scope for SAST — a test fixture, a vendored dependency, a demo. When a finding is a false positive but the file also holds production code, use an inline cybedefend-ignore comment instead, so the rest of the file stays under review.

Document Your Exclusions

Always add comments explaining why files are excluded:

Include in Code Reviews

  • Add .cybeignore to your repository
  • Review changes in pull requests
  • Regularly audit exclusion patterns

Verify What You Wrote

.cybeignore uses the gitignore engine, so git itself can check your patterns before you commit them:
Every path it prints is a file that will drop out of your SAST results. If a production file appears in that list, your pattern is too broad.

Monitor Impact

Check scan logs to see which file was loaded and how many vulnerabilities were filtered:

Troubleshooting

Patterns Not Matching

  • Use **/ for recursive matching: **/bad/**
  • Ensure correct path separators (always /)
  • Check that .cybeignore is in the project root
  • Review scan logs for path details

File Not Found

  • Verify .cybeignore is included in your repository — it must be committed, not gitignored
  • Check file permissions
  • Ensure the file is at the project root level
  • If you have a .cybedefend/ directory, the legacy root file cannot exist; use .cybeignore or .cybedefend/ignore

Nothing Is Being Filtered

Look for the loader line in your scan logs. [IgnoreFilter] no .cybeignore file found means no candidate was readable at all — most often the file was never committed, or it sits in a subdirectory rather than the project root.

Example Configuration

Here’s a comprehensive example:
The .cybeignore file is processed during scanning. Excluded vulnerabilities won’t appear in your reports or affect your project metrics.