IF Commons GitHub

logical/grc

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0006-machine-probe-grc FR-001, 0006-machine-probe-grc FR-002, 0006-machine-probe-grc FR-003

The policies of the probe as evidence for controls (0006-machine-probe-grc): what the policy pack found on each machine becomes the results of grc, each for the controls the policy cites that a framework has, and each policy becomes a check that asks one question of a machine and is fresh for a day. A machine that was never observed is in scope for every policy and shows none of them: a gap for each, never a pass. Pure: the framework is given as the identifiers of its controls.

import { resultsFor } from "./grc.ts";
resultsFor([], { id: "nist-800-53", version: "5.2.0", controls: ["SC-28"] }, "2026-11-21T00:00:00Z"); // { kind: "ok", value: { results: [], checks: [] } }

Source: commons/machine-probe/src/logical/grc.ts

3 of 12 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.PolicyRowtypeno test imports it
type PolicyRow = { readonly id: string; readonly status: "pass" | "fail" | "warn" | "accepted" | "waiting"; readonly controls: readonly string[]; readonly detail: string };

One policy's finding for one machine, as the check of an asset gives it.

logical.AssetPoliciestypeno test imports it
type AssetPolicies = { readonly asset: string; readonly observedAt: string | null; readonly rows: readonly PolicyRow[] };

What was found on one machine: when it was observed (nothing where it never was) and each policy's finding.

logical.FrameworkControlstypeno test imports it
type FrameworkControls = { readonly id: string; readonly version: string; readonly controls: Iterable<string> };

The framework the controls are of: its identifier, its version and the identifiers of its controls.

logical.Evidencetypeno test imports it
type Evidence = { readonly results: readonly Outcome[]; readonly checks: readonly Check[] };

The results and the checks.

logical.urnOfconstno test imports it
const urnOf: (f: Pick<FrameworkControls, "id" | "version">, control: string) => string

The URN of a control of a framework, as grc writes it.

logical.resultsForfunctionno test imports it
function resultsFor(assets: readonly AssetPolicies[], framework: FrameworkControls, now: string): Result<Evidence, string>

The results and checks of what the probes found, for the controls of one framework, at an instant.

PolicyRowtypeno test imports it
type PolicyRow = { readonly id: string; readonly status: "pass" | "fail" | "warn" | "accepted" | "waiting"; readonly controls: readonly string[]; readonly detail: string };

One policy's finding for one machine, as the check of an asset gives it.

AssetPoliciestype
type AssetPolicies = { readonly asset: string; readonly observedAt: string | null; readonly rows: readonly PolicyRow[] };

What was found on one machine: when it was observed (nothing where it never was) and each policy's finding.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

FrameworkControlstypeno test imports it
type FrameworkControls = { readonly id: string; readonly version: string; readonly controls: Iterable<string> };

The framework the controls are of: its identifier, its version and the identifiers of its controls.

Evidencetypeno test imports it
type Evidence = { readonly results: readonly Outcome[]; readonly checks: readonly Check[] };

The results and the checks.

urnOfconst
const urnOf: (f: Pick<FrameworkControls, "id" | "version">, control: string) => string

The URN of a control of a framework, as grc writes it.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

resultsForfunction
function resultsFor(assets: readonly AssetPolicies[], framework: FrameworkControls, now: string): Result<Evidence, string>

The results and checks of what the probes found, for the controls of one framework, at an instant.

Imported by 3 tests of the run (3 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.