VulnCheck.Types.Finding (VulnCheck v1.0.1)

Copy Markdown View Source

The verdict produced for one advisory against the scanned project.

Summary

Functions

Returns true when the finding is active (not suppressed by a valid ignore rule).

Returns the primary CVE identifier of the finding when known.

Computes the stable SHA-256 fingerprint of a finding from its advisory id, package, verdict and target routine.

Fingerprints the finding would have under each of its identifiers. A baseline recorded while the advisory was known by an alias (for example its GitHub id before the records of one CVE were merged) still matches.

All reason codes.

Verdicts in report order (most actionable first).

Types

reason()

@type reason() ::
  :call_chain_proven
  | :daemon_call_chain
  | :active_network_daemon
  | :unresolved_dynamic_dispatch
  | :missing_symbol_granularity
  | :missing_beam_debug_info
  | :package_retired
  | :non_prod_dependency
  | :otp_version_unaffected
  | :otp_app_not_started
  | :adapter_not_configured
  | :module_not_loaded
  | :function_not_called

t()

@type t() :: %VulnCheck.Types.Finding{
  advisory_id: String.t(),
  aliases: [String.t()],
  context_routines: [VulnCheck.Types.MFA.t()],
  cvss_method: String.t() | nil,
  cvss_score: float() | nil,
  cvss_source: String.t() | nil,
  cvss_vector: String.t() | nil,
  cwes: [String.t()],
  fingerprint: String.t(),
  fixed_versions: [String.t()],
  git_match_status: :confirmed | :uncertain | nil,
  installed_version: String.t(),
  package: String.t(),
  package_scope: :prod | :build_only | :non_prod,
  reason: reason(),
  reason_detail: String.t(),
  recommended_fix: String.t() | nil,
  references: [String.t()],
  severity: VulnCheck.Types.Advisory.severity(),
  summary: String.t(),
  suppressed: boolean(),
  suppression_expired: boolean(),
  suppression_expires: String.t() | nil,
  suppression_reason: String.t() | nil,
  target_mfa: VulnCheck.Types.MFA.t() | nil,
  trace: [VulnCheck.Types.TraceHop.t()],
  verdict: verdict()
}

verdict()

@type verdict() :: :reachable | :potentially_reachable | :unreachable | :retired

Functions

active?(finding)

@spec active?(t()) :: boolean()

Returns true when the finding is active (not suppressed by a valid ignore rule).

cve_id(finding)

@spec cve_id(t()) :: String.t() | nil

Returns the primary CVE identifier of the finding when known.

fingerprint(advisory_id, package, verdict, target_mfa)

@spec fingerprint(String.t(), String.t(), verdict(), VulnCheck.Types.MFA.t() | nil) ::
  String.t()

Computes the stable SHA-256 fingerprint of a finding from its advisory id, package, verdict and target routine.

fingerprints(finding)

@spec fingerprints(t()) :: [String.t()]

Fingerprints the finding would have under each of its identifiers. A baseline recorded while the advisory was known by an alias (for example its GitHub id before the records of one CVE were merged) still matches.

reasons()

@spec reasons() :: [reason()]

All reason codes.

verdicts()

@spec verdicts() :: [verdict()]

Verdicts in report order (most actionable first).