Policy Reference

Policies let you define security and compliance baselines for your .NET projects. Create a .rorix.yml file in your repository root to configure rules that are enforced during scans.

CI gates: Use a tested CLI release or the GitHub Action. Key-based scans require an API read key. Validate the Azure DevOps task in your own pipeline before making it required.

If you are setting up your first CI gate, start with a policy that blocks only the highest-risk issues:

version: 1
policies:
  max-severity: critical
  fail-on-typosquat: true

Once the team is comfortable with the signal, add blocked licenses, score thresholds, or a stricter severity threshold.

Example Configuration

# .rorix.yml
version: 1
policies:
  max-severity: high
  max-vulnerability-count: 0
  block-licenses:
    - GPL-2.0-only
    - GPL-3.0-only
    - AGPL-3.0-only
  fail-on-typosquat: true
  fail-on-outdated-major: true
  min-score: 70

Rules

| Rule | Type | Default | Description | | --- | --- | --- | --- | | max-severity | string | critical | Highest allowed severity: low, moderate, high, or critical. Findings above it fail. | | max-vulnerability-count | number | — | Maximum number of vulnerabilities allowed. Set to 0 for zero tolerance. | | block-licenses | string[] | — | SPDX license identifiers that are not permitted. | | allow-licenses | string[] | — | The only SPDX license identifiers that are permitted. Cannot be combined with block-licenses. | | fail-on-typosquat | boolean | true | Fail when a dependency is flagged as a potential typosquat. | | fail-on-outdated-major | boolean | false | Fail when a dependency is behind by a major version. | | min-score | number | — | Minimum security score from 0 through 100. |

License Rules

Use either block-licenses or allow-licenses.

  • Identifiers are matched by license family, case-insensitively: GPL-3.0, GPL-3.0-only, GPL-3.0-or-later and GPL-3.0+ are treated as the same license. Blocking GPL-3.0-only also blocks GPL-3.0-or-later. LGPL-3.0-only is a different family and is not blocked by GPL-3.0-only.
  • Compound SPDX expressions are evaluated: with MIT OR GPL-3.0-only you may choose MIT, so the package is blocked only when every alternative uses a blocked license. With AND, any blocked license blocks the package.
  • block-licenses does not fail packages whose license is missing or is not a valid SPDX expression, because nothing shows they are blocked. Review those in the license inventory.
  • Weak copyleft licenses such as MPL-2.0 and LGPL-3.0 are reported as warnings to review. Listing one in allow-licenses records that review, so packages using it no longer raise the warning.
  • allow-licenses fails a package unless at least one alternative of its expression uses only allowed licenses. Packages with a missing, URL-only or non-SPDX license fail. A WITH exception, such as GPL-2.0-only WITH Classpath-exception-2.0, must be listed exactly.
# Permissive licenses only
version: 1
policies:
  allow-licenses: [MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Zlib, MS-PL, BSL-1.0]

The dashboard preview and rorix policy apply the same license rules. allow-licenses and family matching in the CLI require Rorix.Cli 0.1.5 or later; older CLI versions compare block-licenses entries exactly and reject allow-licenses.

Using Policies in CI

The GitHub Action and Azure DevOps Marketplace task support policy gates. Review your baseline before enabling a blocking rule and validate the Azure task in your own pipeline.

With the CLI

export RORIX_API_KEY=rxk_...
rorix policy . --config .rorix.yml

rorix policy exits with code 1 when a rule is violated. rorix scan --policy .rorix.yml --exit-code also fails on any vulnerability, not just on policy violations.

In GitHub Actions

- name: Rorix Policy Check
  uses: rorix-io/rorix-scan-action@v1
  with:
    api-key: ${{ secrets.RORIX_API_KEY }}
    command: policy
    policy-file: .rorix.yml

In Azure DevOps

- task: RorixScan@0
  displayName: 'Rorix Policy Check'
  inputs:
    apiKey: $(RORIX_API_KEY)
    command: policy
    policyFile: .rorix.yml
    path: $(Build.SourcesDirectory)

Severity Levels

Severity levels are ordered from lowest to highest:

  1. low — informational findings with minimal risk
  2. moderate — moderate risk, should be addressed in a reasonable timeframe
  3. high — significant risk, should be fixed first
  4. critical — severe risk, requires immediate attention

When max-severity is set to high, any critical vulnerability fails the policy check. Findings at high or below are allowed.