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.
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:
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
.cybeignoreat the project root (recommended), or - Put them in
.cybedefend/ignore, alongsideconfig.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:.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:
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
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 inlinecybedefend-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
.cybeignoreto 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:
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
.cybeignoreis in the project root - Review scan logs for path details
File Not Found
- Verify
.cybeignoreis 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.cybeignoreor.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.