Skip to main content

Overview

What it Does

Blocking rules are guardrails that define which findings should fail a pull request check or CI pipeline. This helps ensure that your codebase adheres to your organization’s security and quality standards. You can create three types of blocking rules:
  • Code Vulnerability Rules: Block PRs based on security vulnerabilities, code-quality findings, or both
  • Dependency Vulnerability Rules: Block PRs based on vulnerable dependencies found by SCA scanning
  • License Compliance Rules: Block dependencies with specific SPDX licenses or license families

Who it’s For

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.

Key Features and Benefits

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.
For dependency vulnerability rules, define an inclusive CVSS score range to block vulnerable dependencies based on their CVSS score.
Block dependencies by specific SPDX license IDs or by the Copyleft, Permissive, and Commercial license families.
Apply blocking rules to specific projects, project tags, 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.

Rule Types

Blocking rules support three distinct types to provide comprehensive security coverage:

Code Vulnerability

Blocks pull requests based on security vulnerabilities, code-quality findings, or both.Configure by:
  • Selecting an issue type: All, Vulnerabilities, or Code Quality
  • 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.

Dependency Vulnerability

Blocks pull requests based on vulnerable dependencies found by software composition analysis (SCA).Configure by:
  • Setting urgency/severity levels (Critical, High, Medium, Low)
  • Or setting an inclusive CVSS score range from 0.0 to 10.0
Use this to prevent the introduction of packages with known security vulnerabilities, ensuring your supply chain remains secure.

License Compliance

Blocks pull requests or CI pipelines when a dependency uses a denied license.Configure by:
  • Selecting one or more license families: Copyleft, Permissive, or Commercial
  • Entering specific SPDX license IDs, such as AGPL-3.0
Use this to enforce your organization’s open-source and commercial license policy.

How it Works with GitHub

Prerequisite You must have installed and configured the Corgea GitHub App with appropriate repository permissions.
1

Pull Request Submission

Developer submits a pull request with code changes
2

Automated Analysis

System analyzes code changes against active blocking rules
3

Rule Validation

If violations are found, pull request is automatically blocked
4

Developer Notification

Developer receives detailed notification about rule violations
5

Resolution

Developer must fix violations and mark them as Fixed, or mark them as False Positive or Accepted Risk before merge is allowed

How it Works with Azure DevOps

Prerequisite Make sure the Azure DevOps integration with Corgea is configured and you have the necessary permissions.
1

Pull Request Submission

A developer submits a pull request with code changes in Azure DevOps.
2

Automated Analysis

The system evaluates the code changes against the active blocking rules set in Corgea.
3

Rule Validation

If violations are found, the pull request is automatically blocked.
Developer cannot merge the PR until it is resolved.
4

Developer Notification

The developer receives a link to view detailed information about the failed issues on the Corgea Scan page.
5

Resolution

The developer must resolve the violations by fixing them or marking them as False Positive or Accepted Risk before the merge can proceed.

Usage Guide

Creating a New Blocking Rule

1

Initiate Creation

Click the “Add Blocking Rule” button
2

Choose Rule Type

Select the type of blocking rule:
  • Code Vulnerability: Block pull requests based on code security issues (SAST findings)
  • Dependency Vulnerability: Block pull requests based on vulnerable dependencies (SCA findings)
  • License Compliance: Block dependencies based on denied SPDX licenses or license families
Add Blocking Rule modal with Applies To, rule types, and Issue Type
3

Basic Information

Enter the rule name and description, then choose Applies To:
  • Pull Requests automatically enforces the rule in pull request checks.
  • CI enforces the rule only when a pipeline names it with corgea scan --block-on <slug>. CI rules do not block pull requests.
New rules default to Pull Requests. Corgea generates the slug from the rule name and displays it in the rules list.
Add Blocking Rule modal with CI selected and License Compliance configured
4

Configure Settings

For Code Vulnerability rules: Choose an Issue Type to apply the rule to All findings, Vulnerabilities only, or Code Quality findings only. All is the default and preserves the behavior of existing rules. Then select urgency levels (Critical, High, Medium, or Low) and/or target CWEs; at least one of these must be defined for the rule to be valid.For Dependency Vulnerability rules: Choose whether to filter by severity or CVSS score. Select urgency levels (Critical, High, Medium, or Low), or enter a minimum and maximum CVSS score from 0.0 to 10.0 to block vulnerable dependencies within that inclusive range.For License Compliance rules: Select at least one denied license family (Copyleft, Permissive, or Commercial) or enter one or more SPDX license IDs. A dependency is blocked when any reported license matches a selected family or specific ID.
5

Set Scope

Choose applicable projects and/or project tags (optional). A rule applies when a project is selected directly or has any selected tag. If no projects or tags are selected, the rule applies to all projects.
6

Save

Review and click “Create”

Managing Existing Rules

Use search to find rules by name or settings, or filter the list by project tag or Applies To target. The rules table shows each rule’s slug in the ID column and surfaces the project scope, rule type, and Pull Requests or CI target under Triggers On. Select a slug to copy it for use in a CI command. Rules without a project or tag scope apply to all projects, and longer scope lists are grouped behind a +N more tooltip.
Blocking rules list showing slug, Triggers On chips, and CI badge

Enforcing Rules in CI

Create an active rule with Applies To set to CI, then pass its slug to the scan command. Name rules for the condition that trips them — for example criticals, not no-criticals — so --block-on reads as a direct assertion. --block-on requires Corgea CLI 1.10.0 or later.
To enforce multiple CI rules, provide their slugs as a comma-separated list. The command fails when a finding violates any named rule. An unknown slug, inactive rule, or rule that applies to pull requests is treated as a configuration error rather than being skipped. --block-on is supported only by the BLAST scanner and cannot be combined with --fail or --fail-on.
  1. Locate rule in table
  2. Click “Edit” button
  3. Modify settings as needed
  4. Click “Update” to save

Viewing Rules on scans

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:
  1. For individual issues, you can see which blocking rules were triggered in the issue details:
This makes it easy to understand which rules are affecting your scans and specific issues, helping you identify why certain changes may be blocked.

Examples

Rule Type: Code VulnerabilityCreate 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.
Rule Type: Code VulnerabilitySelect Code Quality as the issue type, then 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.
Rule Type: Dependency VulnerabilityCreate 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.
Rule Type: Dependency VulnerabilityCreate a rule that filters by CVSS score, such as 7.0 to 10.0, to block pull requests that introduce vulnerable dependencies within that score range.
Rule Type: License ComplianceSelect the Copyleft family to block dependencies whose reported licenses belong to that family. Add specific SPDX IDs when your policy needs a narrower denylist.

Best Practices

Implementation Tips

  • Start with essential rules and gradually expand
  • For Dependency Vulnerability rules, begin with Critical severity only or a focused CVSS range, then expand as your team adjusts
  • For Code Vulnerability rules, focus on the most impactful CWEs first (e.g., injection flaws, authentication issues)
  • Regular review and updates
  • Clear documentation and team training
  • Encourage feedback and collaboration
  • Strategic use of urgency levels
  • Consider project tags when the same rule should cover a group of related projects

Troubleshooting

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