Rule Conditions

A policy rule matches on facts about the alert, grouped into three families:

  • Location — where the dependency was found: which repository, which manifest file.
  • Artifact — the package itself: ecosystem, name, namespace, version, publication date, and Socket's health scores.
  • Finding — what the alert itself says: its type, severity, CVE identifier, reachability, and so on.

A rule can combine as many conditions as you like. All conditions in a rule must hold for the rule to match.

Location fields

FieldDescriptionValues
RepositoryRepository full name. Available on exceptions only — a rule's repositories come from the policy it belongs toe.g. my-org/payments-api
Manifest fileRepository-relative path of the manifest or lockfile that declared the dependencye.g. services/api/package.json

Some dependencies cannot be attributed to a manifest file — this varies by ecosystem. A rule that conditions on the manifest file will not match a dependency Socket could not attribute, so use manifest conditions for narrowing rather than for catch-alls.

Artifact fields

FieldDescriptionValues
EcosystemPackage ecosystemnpm, pypi, maven, gem, golang, nuget, cargo, composer, github, vscode, huggingface
NamePackage name, without the namespacee.g. express
NamespacePackage namespace or scope; empty for unscoped packagese.g. @angular
VersionPackage versione.g. 4.17.1
Date publishedWhen the version was publishedAn absolute date, or a relative window such as the last 7 days
Overall scoreSocket overall health score0100
License scoreSocket license score0100
Maintenance scoreSocket maintenance score0100
Quality scoreSocket quality score0100
Vulnerability scoreSocket vulnerability score0100
Supply chain scoreSocket supply chain score0100

Finding fields

FieldDescriptionValues
Alert typeThe specific Socket alertAny alert type, e.g. criticalCVE, malware, installScripts
CategoryThe risk family the alert belongs tosupplyChainRisk, vulnerability, quality, maintenance, license, other
SeverityThe alert's severitycritical, high, medium, low
PrioritySocket's composite priority for the findingcritical, high, medium, low
CVSSCVSS base score0.010.0
CVE IDCVE identifiere.g. CVE-2024-29041
GHSA IDGitHub Security Advisory identifiere.g. GHSA-xvch-5gv4-984h
ReachabilityWhether the vulnerable code is reachablereachable, maybe_reachable, unreachable, pending, missing_support, direct_dependency, undeterminable_reachability, unknown, error
Fix availableWhether an upstream fixed version existstrue / false
CISA KEVWhether the CVE is in the CISA Known Exploited Vulnerabilities catalogtrue / false
Patch statusSocket patch availability, distinct from an upstream fixpatch_unavailable, patch_available, patch_applied

Operators

Each condition uses an operator appropriate to its field:

OperatorApplies toMeaning
is / is notAll fieldsExact match, or its negation. Also accepts a list of values, matching if any of them do.
at least / at mostNumbersInclusive comparison
greater than / less thanNumbersExclusive comparison
starts with / ends with / includesTextSubstring matching
before / afterDatesDate comparison

Fields that carry a fixed set of values — severity, category, reachability, ecosystem — offer those values as a picker rather than free text.

Version matching is exact, prefix, suffix, or substring. There are no version ranges, so express "the 4.x line" as a version that starts with 4..

Exceptions

An exception carves a case out of a rule that would otherwise match it. Exceptions are how you express "block critical CVEs everywhere except the sandbox repository" as one rule instead of two.

A rule with exceptions matches when its conditions hold and none of its exceptions do. Exceptions offer the same fields and operators as conditions, plus one extra: Repository — because a rule's repositories already come from the policy it belongs to, repository only makes sense as an opt-out, so the editor offers it there and not in conditions.

The Rule Editor

Rules are created and edited from Policies in the Socket dashboard.

Opening a policy shows its rules in evaluation order, with custom rules above the baseline rules. From there you can:

  • Add a rule — give it a name, choose the action, then build its conditions and any exceptions field by field.
  • Reorder rules — move a rule up or down, or send it to the first or last position. Because the first match wins, this directly changes behavior.
  • Edit or delete a rule — changes take effect on subsequent scans.

The editor builds the rule visually, so you do not need to write the underlying selector by hand. Rules created through the API can be edited in the dashboard as long as their conditions map onto the visual editor's fields; anything more intricate is shown read-only, and you can replace it with a new rule if you need to change it.

Related Pages

  • Policies — how rules are evaluated and what their actions do.
  • Vigil Selectors — the same conditions written as JSON, for the API.
  • Baseline Presets — the default rules underneath your custom ones.

Did this page help you?