IF Commons GitHub

logical/rules

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-policy-gate FR-006

Builders and a baseline of rules (0002-policy-gate FR-006): require, forbid and oneOf make a rule from an attribute and what it must be, so a policy reads as the facts it states; the baseline is a small set that holds for any estate (nothing in the clear, nothing open to the world on an administrative port, storage encrypted, an owner named, a certificate not close to its end, an image that is not floating). Each names the controls of SP 800-53 it gives evidence for.

import { BASELINE } from "./rules.ts";
BASELINE.length > 0; // true

Source: commons/gate/src/logical/rules.ts

4 of 8 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.requirefunctionno test imports it
function require(m: Meta, attribute: string, test: (v: Value) => boolean, expected: string): Rule

A rule that an attribute must be there and satisfy a test.

logical.forbidfunctionno test imports it
function forbid(m: Meta, attribute: string, test: (v: Value) => boolean, what: string): Rule

A rule that an attribute, where it is there, must not satisfy a test.

logical.oneOffunctionno test imports it
function oneOf(m: Meta, attribute: string, allowed: readonly (string | number | boolean)[]): Rule

A rule that an attribute must be one of the values.

logical.BASELINEconstno test imports it
const BASELINE: readonly Rule[]

The baseline: rules that hold for any estate.

requirefunction
function require(m: Meta, attribute: string, test: (v: Value) => boolean, expected: string): Rule

A rule that an attribute must be there and satisfy a test.

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

forbidfunction
function forbid(m: Meta, attribute: string, test: (v: Value) => boolean, what: string): Rule

A rule that an attribute, where it is there, must not satisfy a test.

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

oneOffunction
function oneOf(m: Meta, attribute: string, allowed: readonly (string | number | boolean)[]): Rule

A rule that an attribute must be one of the values.

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

BASELINEconst
const BASELINE: readonly Rule[]

The baseline: rules that hold for any estate.

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

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