logical.Verdicttypeno test imports ittype Verdict = { readonly status: "pass" | "fail" | "warn" | "unknown"; readonly detail: string };What a policy found: the finding and what was found.
The policy pack for a machine that is observed and not managed (Stolos 067-adopt): each policy reads an observation and says pass, fail, warn or unknown, with the fix in words for the machine's operating system, and names the controls of NIST SP 800-53 Rev 5 (the public anchor, by identifier) it gives evidence for, so that no result is without a control. A policy that does not apply to what was observed gives no result.
import { POLICIES } from "./policies.ts";
POLICIES.find((p) => p.id === "disk-encryption")?.controls; // ["CRY-07"]logical.Verdicttypeno test imports ittype Verdict = { readonly status: "pass" | "fail" | "warn" | "unknown"; readonly detail: string };What a policy found: the finding and what was found.
logical.Policytypeno test imports ittype Policy = {
readonly id: string;
readonly title: string;
readonly controls: readonly string[];
/** The verdict, or nothing where the policy does not apply to what was observed. */
readonly assert: (o: Observed, now: string) => Verdict | undefined;
readonly fix: (o: Observed) => string;
};One policy: its id, what it requires, the SP 800-53 Rev 5 controls it gives evidence for, how it judges an observation and how to make it pass on that machine.
logical.supportedOsfunctionno test imports itfunction supportedOs(o: Observed): boolean | undefinedWhether the version of the operating system is still supported by its maker (a starter table), or nothing where it is not known.
logical.POLICIESconstno test imports itconst POLICIES: readonly Policy[]The policy pack, in the order its results are shown.
logical.PolicyResulttypeno test imports ittype PolicyResult = PolicyOutcome & { readonly title: string; readonly detail: string; readonly fix: string };A policy's result for one observation, with how to make it pass.
logical.evaluatefunctionno test imports itfunction evaluate(o: Observed, now: string): readonly PolicyResult[]Every policy that applies to an observation, in order, with its verdict, the controls it gives evidence for and how to make it pass; the instant now says how old the observation may be.
Verdicttypeno test imports ittype Verdict = { readonly status: "pass" | "fail" | "warn" | "unknown"; readonly detail: string };What a policy found: the finding and what was found.
Policytypeno test imports ittype Policy = {
readonly id: string;
readonly title: string;
readonly controls: readonly string[];
/** The verdict, or nothing where the policy does not apply to what was observed. */
readonly assert: (o: Observed, now: string) => Verdict | undefined;
readonly fix: (o: Observed) => string;
};One policy: its id, what it requires, the SP 800-53 Rev 5 controls it gives evidence for, how it judges an observation and how to make it pass on that machine.
supportedOsfunctionfunction supportedOs(o: Observed): boolean | undefinedWhether the version of the operating system is still supported by its maker (a starter table), or nothing where it is not known.
POLICIESconstconst POLICIES: readonly Policy[]The policy pack, in the order its results are shown.
PolicyResulttypeno test imports ittype PolicyResult = PolicyOutcome & { readonly title: string; readonly detail: string; readonly fix: string };A policy's result for one observation, with how to make it pass.
evaluatefunctionfunction evaluate(o: Observed, now: string): readonly PolicyResult[]Every policy that applies to an observation, in order, with its verdict, the controls it gives evidence for and how to make it pass; the instant now says how old the observation may be.