licence_audit/vulnerability_command

Types

pub type CheckCompleteness {
  CheckComplete
  CheckIncomplete
}

Constructors

  • CheckComplete
  • CheckIncomplete
pub type CheckOutcome {
  CheckOutcome(
    configuration: config.Policy,
    today: String,
    packages: List(manifest.SbomEntry),
    gate: VulnGateOutcome,
  )
}

Constructors

Service failures retain placeholders; worker failures remain runtime errors.

pub type DetailFailure {
  DetailFailure(
    id: String,
    reason: String,
    runtime_failed: Bool,
    failure: error.Error,
  )
}

Constructors

  • DetailFailure(
      id: String,
      reason: String,
      runtime_failed: Bool,
      failure: error.Error,
    )
pub type GateReport {
  NoGateReport
  SkippedSourcesOnly
  Findings(
    threshold: osv.Severity,
    block_unknown: Bool,
    reviews_enabled: Bool,
  )
}

Constructors

  • NoGateReport
  • SkippedSourcesOnly
  • Findings(
      threshold: osv.Severity,
      block_unknown: Bool,
      reviews_enabled: Bool,
    )
pub type PurlPair =
  #(manifest.SbomEntry, String)
pub type ScanOutcome {
  ScanOutcome(
    configuration: config.Policy,
    today: String,
    rows: List(VulnRow),
    packages: List(manifest.SbomEntry),
    skipped_packages: List(String),
    scopes: dict.Dict(String, manifest.Scope),
    queried_packages: Int,
    coverage: exception.Coverage,
    status: ScanStatus,
  )
}

Constructors

pub type ScanStatus {
  EmptyScan
  BatchFailed(error.Error)
  DetailsFetched(review: Result(Nil, error.Error))
}

Constructors

Findings and coverage are independent of completeness and final exit status.

pub type VulnGateOutcome {
  VulnGateOutcome(
    status: Result(VulnGateStatus, error.Error),
    scan_started: Bool,
    report: GateReport,
    queries: List(#(manifest.SbomEntry, List(String))),
    occurrences: List(VulnOccurrence),
    details: List(#(String, osv.Vulnerability)),
    detail_failures: List(DetailFailure),
    unsupported_packages: List(String),
    coverage: exception.Coverage,
    reporter: progress.Reporter,
  )
}

Constructors

pub type VulnGateStatus {
  GateNotEvaluated
  GateUnavailable(error.Error)
  GateEvaluated(
    verdict: VulnVerdict,
    completeness: CheckCompleteness,
  )
}

Constructors

pub type VulnOccurrence {
  VulnOccurrence(
    package: manifest.SbomEntry,
    vulnerability: osv.Vulnerability,
    decision: exception.Decision,
    blocking: option.Option(Bool),
  )
}

Constructors

pub type VulnPair =
  #(manifest.SbomEntry, List(String))
pub type VulnRow {
  VulnRow(
    package: manifest.SbomEntry,
    vulnerabilities: List(osv.Vulnerability),
    decisions: List(exception.Decision),
    failures: List(DetailFailure),
  )
}

Constructors

pub type VulnVerdict {
  NoBlockingAdvisories
  BlockingKnownSeverity
  BlockingUnknownSeverity
}

Constructors

  • NoBlockingAdvisories
  • BlockingKnownSeverity
  • BlockingUnknownSeverity

Values

pub fn check(
  packages: List(manifest.SbomEntry),
  options: cli.Options,
  configuration: config.Policy,
  batch_fetcher: fn(List(String)) -> Result(
    List(osv.BatchEntry),
    osv.Error,
  ),
  detail_fetcher: fn(String) -> Result(
    osv.Vulnerability,
    osv.Error,
  ),
  reporter: progress.Reporter,
  today: String,
) -> VulnGateOutcome
pub fn fetch_vulnerabilities(
  ids: List(String),
  detail_fetcher: fn(String) -> Result(
    osv.Vulnerability,
    osv.Error,
  ),
  reporter: progress.Reporter,
) -> #(
  List(osv.Vulnerability),
  List(DetailFailure),
  progress.Reporter,
)
pub fn format_vuln_detail_failures_output(
  failures: List(DetailFailure),
) -> String
pub fn load_policy(
  options: cli.Options,
  project_root: String,
) -> Result(config.Policy, config.Error)
pub fn not_evaluated(
  reporter: progress.Reporter,
) -> VulnGateOutcome
pub fn run(
  options: cli.VulnsOptions,
  batch_fetcher: fn(List(String)) -> Result(
    List(osv.BatchEntry),
    osv.Error,
  ),
  detail_fetcher: fn(String) -> Result(
    osv.Vulnerability,
    osv.Error,
  ),
  reporter: progress.Reporter,
) -> #(Result(ScanOutcome, error.Error), progress.Reporter)
pub fn run_check(
  options: cli.Options,
  batch_fetcher: fn(List(String)) -> Result(
    List(osv.BatchEntry),
    osv.Error,
  ),
  detail_fetcher: fn(String) -> Result(
    osv.Vulnerability,
    osv.Error,
  ),
  reporter: progress.Reporter,
) -> #(Result(CheckOutcome, error.Error), progress.Reporter)
pub fn unique_vuln_ids(
  entries: List(osv.BatchEntry),
) -> List(String)
pub fn with_excluded_vulns(
  coverage: exception.Coverage,
  excluded: List(#(String, String)),
) -> exception.Coverage
✨ Search Document