Documentation Index
Fetch the complete documentation index at: https://docs.cybedefend.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Policy Management feature provides a Policy as Code approach to security governance. Define your security requirements in YAML or JSON, and CybeDefend will automatically evaluate every scan against your policies.Hierarchical Policies
Organization → Team → Project hierarchy ensures policies cascade appropriately
Policy as Code
Version-controlled YAML/JSON policies that integrate with your GitOps workflow
Async Evaluation
Non-blocking BullMQ-based worker for fast policy evaluation
Compliance Tracking
Full audit trail and compliance history for governance reporting
Key Features
Policy Hierarchy
Policies are applied in a hierarchical manner, ensuring organizational standards cannot be bypassed:A policy at a higher level cannot be disabled by a policy at a lower level. Lower-level policies can only add stricter rules.
Automatic Vulnerability Filtering
During policy evaluation, certain vulnerabilities are automatically ignored to focus on active security risks:| Status | Description |
|---|---|
not_exploitable | Manually reviewed and marked as not posing a security risk |
resolved / fixed | Already fixed in the source code |
ignored / accepted_risk | Risks that have been formally accepted by the organization |
Policy Configuration
Policies are defined in YAML format with complete metadata. Here’s a full example:Policies require 1-15 rules and support a maximum of 30 exclusions.
Rule Types
| Type | Description | Valid Values |
|---|---|---|
severity | Vulnerability severity level | critical, high, medium, low, info |
cvss_score | CVSS score (0-10) | Numeric value (e.g., 7.5, 9.0) |
cwe_check | CWE identifier | String (e.g., CWE-89, CWE-79) |
owasp_category | OWASP Top 10 category | String (e.g., A01:2021, A03:2021) |
scanner_type | Type of scanner | sast, secret, sca, container, iac, cicd |
vulnerability_age_days | Days since detection | Numeric value |
is_new_vulnerability | Whether vulnerability is new | Boolean (true/false) |
branch | Git branch name (supports glob) | String (e.g., main, feature/*) |
composite_and | Combine rules with AND logic | Array of sub-rules |
composite_or | Combine rules with OR logic | Array of sub-rules |
Operators
| Operator | Description | Example |
|---|---|---|
eq | Equals (exact match) | severity eq critical |
neq | Not equals | severity neq info |
gt | Greater than | cvss_score gt 7.0 |
lt | Less than | vulnerability_age_days lt 30 |
gte | Greater than or equal | cvss_score gte 9.0 |
lte | Less than or equal | vulnerability_age_days lte 7 |
in | In list | severity in [critical, high] |
not_in | Not in list | cwe_check not_in [CWE-1, CWE-2] |
Actions
| Action | Description | CI/CD Exit Code |
|---|---|---|
block | Blocks the pipeline, creates violation record | 1 |
warn | Creates violation record, doesn’t block | 0 |
Composite Rules
Use composite rules to combine multiple conditions:AND Logic (All conditions must match)
OR Logic (Any condition can match)
Exclusions
Exclusions allow you to skip policy evaluation for specific files or patterns:**matches any number of directories*matches any characters except/?matches a single character
Policy Examples
Branch-Based Policy (Production Protection)
Multi-Scanner Organization Policy
CI/CD Integration
GitHub Actions
Use the official CybeDefend GitHub Action with policy evaluation enabled:Policy Evaluation Options
| Option | Default | Description |
|---|---|---|
policy_check | true | Enable/disable policy evaluation after scan |
policy_timeout | 300 | Timeout in seconds for policy evaluation |
show_policy_vulns | true | Show affected vulnerabilities in output |
show_all_policy_vulns | false | Show all vulnerabilities (no limit) |
GitLab CI
Use the CybeDefend CLI directly with policy evaluation:CLI Policy Flags
| Flag | Default | Description |
|---|---|---|
--policy-check | true | Enable/disable policy evaluation |
--policy-timeout | 300 | Timeout in seconds for evaluation |
--show-policy-vulns | true | Show affected vulnerabilities |
--show-all-policy-vulns | false | Show all vulnerabilities without limit |
Example Output
If any policy has a BLOCK action with violations, the CLI exits with code
1, failing the pipeline. WARN actions are informational only and don’t affect the exit code.Managing Violations
When a policy violation occurs, you have two options to resolve it:Change Vulnerability Status
Change the vulnerability status from “open” to “ignored” with a justification. The vulnerability will be excluded from future policy evaluations.
Best Practices
Start with Warning-Only Mode
Start with Warning-Only Mode
When rolling out policies, start with
action: warn to understand the impact before switching to action: block.Use Expiring Exclusions
Use Expiring Exclusions
Always set expiration dates on exclusions to prevent permanent security gaps:
Layer Policies Appropriately
Layer Policies Appropriately
- Organization level: Global security requirements (e.g., no exposed secrets)
- Team level: Team-specific standards (e.g., frontend vs backend rules)
- Project level: Project-specific exclusions only
Version Control Your Policies
Version Control Your Policies
Store policy YAML files in your repository:
Related: API Reference - Policy Management · Managing Vulnerabilities · CI/CD Integrations