DocsSecurity & ComplianceSuppression Rules

Suppression Rules

Suppress known noise (a CVE not applicable to your configuration, a package in a test path) with a single, justified and revocable rule that applies to current and future findings and leaves an audit trail on every finding it touches.


Overview

Closing the same known case finding by finding is repeated work and leaves no single decision behind. A suppression rule is that decision: criteria, an action (false_positive or risk_accepted), a justification, an optional expiry and its author. Managers and admins create and deactivate rules on the Suppression Rules page (sidebar Security → Suppression Rules, /dashboard/security/rules); every authenticated user can read them. The table lists, newest first, the criteria, the action, the justification, how many findings the rule suppresses now, the author, the expiry and the state (Active, Expired or Inactive), with Deactivate on active rules for managers and admins. A rule is never edited nor deleted, and a deactivated rule cannot be reactivated: create a new rule instead.

  • Criteria are all optional, at least one is required, and they are combined with AND
  • cve: CVE findings whose identifier is that CVE (case-insensitive)
  • package: details.package or details.matched_software (case-insensitive); ecosystem: details.ecosystem (case-insensitive)
  • path_prefix: details.path starts with the prefix (e.g. /srv/app/tests/)
  • environment (deployment environment), team_ref (owner team) and asset_uid: the asset of the finding. A deleted environment or team does not widen the rule: it simply matches nothing
Suppression rules with state and suppressed findings

Creating a Rule

"New rule" opens a dialog with the criteria, the action, the justification (required, at most 2000 characters) and the expiry day. The expiry is optional for false_positive (empty: never expires) and required for risk_accepted, within SECURITY_RISK_ACCEPTANCE_MAX_DAYS (default 180) days; it is the end of the chosen local day. "Preview" shows "This rule would suppress N current findings" (open or acknowledged now); "Create rule" is enabled only after a preview of the current values, and any change invalidates it. Field errors from the API are shown under their field.

Note: The preview counts only the current findings: future findings matching the rule are suppressed when a scan creates or reopens them.

Current and Future Findings

Once the rule is committed, the Celery task apply_suppression_rule moves the matching open and acknowledged findings to the action status (they leave the work queue, is_active=false) in batches of 500, with a system status_changed event each: reason "Suppressed by rule #<id>: <justification>", metadata {cause: suppression_rule, rule_id, action, expires_at}. A risk_accepted rule also sets the risk acceptance of the finding: its expiry, its justification and its author as approver. If the task cannot be queued the rule is applied inline.

  • Resolved, false positive and risk accepted findings are never suppressed
  • Idempotent: a finding that already has an event of the rule (metadata.rule_id) is skipped, so a finding a user reopened after the rule is not suppressed again by it
  • Future findings: a scan that creates a finding, or reopens one (reopened_by_scan), applies the live rules in the same transaction. The timeline shows created (to open) followed by the suppression event. With several matching rules the oldest (lowest id) wins
  • The finding exposes suppression_rule (the id of the rule holding it suppressed now, or null) in the list and the detail
  • Any user decision (reopen, resolve, false positive, accept risk, one at a time or in bulk) takes the finding out of the rule: suppression_rule becomes null

Expiry and Deactivation

The daily task sync_suppression_rules (beat entry sync-suppression-rules) releases the findings held by a deactivated or expired rule. When another live rule with the same action matches a finding, the finding stays suppressed and moves to that rule with a suppression_changed event ("Suppression moved from rule #A to rule #B", metadata cause suppression_rule_transferred, rule_id, previous_rule_id). Otherwise it goes back to open with a system status_changed event ("Suppression rule #A disattivata" or "… scaduta", cause suppression_rule_deactivated or suppression_rule_expired). Then every live rule is applied again: a rule with a different action suppresses the findings just reopened, in the same run. Deactivating a rule queues the task immediately; the task is idempotent.

Note: expire_risk_acceptances ignores the findings held by a rule: their acceptance ends with the rule.

API

GET /api/v1/security/suppression-rules/ (paginated, newest first) and GET /api/v1/security/suppression-rules/<id>/ return the criteria, environment_name, team_name, action, justification, expires_at, is_active, state (active, expired or inactive), created_by, created_by_username, created_at, deactivated_at, deactivated_by_username and suppressed_count (findings the rule holds suppressed now). POST /api/v1/security/suppression-rules/ (manager or admin) creates a rule (201); with "dry_run": true it only answers {"matched": N}. No criterion returns 400 on non_field_errors; a missing, past or too far expiry returns 400 on expires_at. POST /api/v1/security/suppression-rules/<id>/deactivate/ deactivates the rule; an already deactivated rule returns 409. Viewers get 403 on both.

# Preview
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"cve": "CVE-2026-1234", "action": "false_positive", "justification": "Module disabled", "dry_run": true}' \
  "https://idp.example.com/api/v1/security/suppression-rules/"

# Deactivate rule 12
curl -X POST -H "Authorization: Bearer $TOKEN" "https://idp.example.com/api/v1/security/suppression-rules/12/deactivate/"

Example Event

The event a rule writes on a suppressed finding (GET /api/v1/security/findings/<id>/events/, see /docs/security/finding-timeline):

{
  "event": "status_changed", "actor_type": "system",
  "from_status": "open", "to_status": "false_positive",
  "reason": "Suppressed by rule #12: CVE non applicabile, modulo disabilitato",
  "metadata": {"cause": "suppression_rule", "rule_id": 12, "action": "false_positive", "expires_at": null}
}