| title | description |
|---|---|
Blocking Rules |
Blocking rules help enforce security and quality standards by preventing non-compliant code from being merged. |
Blocking rules are powerful guardrails that allow you to define specific conditions under which pull requests should be blocked from being merged. This helps ensure that your codebase adheres to your organization's security and quality standards by preventing potentially risky or non-compliant code changes from being merged.
You can create two types of blocking rules:
- Code Vulnerability Rules: Block PRs based on code security issues found by SAST scanning
- Dependency Vulnerability Rules: Block PRs based on vulnerable dependencies found by SCA scanning
Blocking rules are primarily designed for:
- Development teams
- Project managers
- Security professionals
This feature is particularly useful for organizations with strict compliance requirements or those working on mission-critical applications where code quality and security are paramount.
Define rules based on Common Weakness Enumerations (CWEs) to block pull requests that introduce specific types of vulnerabilities or code quality issues. Assign urgency levels (e.g., critical, high, medium, low) to different types of issues, allowing you to prioritize and handle them accordingly. Apply blocking rules to specific projects or across your entire organization, giving you granular control over which projects are subject to which rules. Easily create, edit, and delete blocking rules through a user-friendly interface, ensuring your rules stay up-to-date with your evolving requirements. Toggle the status of blocking rules to temporarily enable or disable them as needed, without losing their configurations.Blocking rules support two distinct types to provide comprehensive security coverage:
Blocks pull requests based on **code security issues** found by static application security testing (SAST).Configure by:
- Selecting specific CWE (Common Weakness Enumeration) categories
- Setting urgency/severity levels
Use this to prevent issues like SQL injection, XSS, insecure cryptography, and other code-level vulnerabilities.
Configure by:
- Setting urgency/severity levels (Critical, High, Medium, Low)
Use this to prevent the introduction of packages with known security vulnerabilities, ensuring your supply chain remains secure.
Developer cannot merge the PR until it is resolved.
<Frame>
<img src="/images/azure-devops_merging_blocked.png" style={{ borderRadius: '0.5rem' }} />
</Frame>
For **Dependency Vulnerability** rules: Select urgency levels (Critical, High, Medium, or Low) to block pull requests with vulnerable dependencies matching those severity levels
You can view blocking rules that apply to your scans in two places:
1. On the scan details page, you'll see a "Blocking Rules" section showing all rules that were evaluated:
<Frame>
<img src="/images/blocking_rules_scan_details.png" style={{ borderRadius: '0.5rem' }} />
</Frame>
2. For individual issues, you can see which blocking rules were triggered in the issue details:
<Frame>
<img src="/images/blocking_rule_issue_details.png" style={{ borderRadius: '0.5rem' }} />
</Frame>
This makes it easy to understand which rules are affecting your scans and specific issues, helping you identify why certain changes may be blocked.
Create a rule targeting CWE-326 (Inadequate Encryption Strength) and CWE-327 (Use of a Broken or Risky Cryptographic Algorithm) with "Critical" urgency to prevent weak encryption usage.
Set up a rule for CWE-398 (Indicator of Poor Code Quality) and CWE-477 (Use of Obsolete Functions) with "Medium" urgency to maintain code standards.
Create a rule with "Critical" and "High" urgency levels selected to automatically block any pull request that introduces dependencies with critical or high-severity vulnerabilities. This ensures your supply chain remains secure and prevents known vulnerable packages from entering your codebase.
If a pull request is unexpectedly blocked, verify the active rules and their configurations first.
- Unexpected blocking behavior - Rule targeting issues - Project scope problems - Check rule configurations - Verify CWE targeting - Confirm project settings - Contact support if needed



