IF Commons GitHub

Linux observation: the shapes

0002Active

0002-linux-observe-shapes · owner if · domain commons

Requirements

FR-001checkpassing

A user MUST be read as its name and, only where the requirement declares them, its uid, comment, shell, home and the groups it names that the user is in (in the order the requirement names them); a group as its name; a service as its name, whether it is running and whether it starts at boot, and a service MUST always be there to ask about; nothing MUST be there where the line of the passwd or group database is.

Enforced (check): .github: cd commons/linux-observe && bun run verify — suite/observe.test.ts

Proved by: linux-observe/suite/observe.test.ts

Written in: linux-observe/src/logical/shapes.ts

Tests: passed: suite/observe.test.ts a user, a group and a service are read in the shape declared: only the fields declared, th

FR-002checkpassing

A file and a directory MUST be read from their stat as their path and, as far as the requirement declares them, the owner, the group and the mode (written as long as the requirement writes it), and a file also its content; a file that is a directory, and a directory that is a file, MUST NOT be there.

Enforced (check): .github: cd commons/linux-observe && bun run verify — suite/observe.test.ts

Proved by: linux-observe/suite/observe.test.ts

Written in: linux-observe/src/logical/shapes.ts

Tests: passed: suite/observe.test.ts a file and a directory are read with their owner, group and mode as declared (a mode as lo

FR-003checkpassing

An authorized key MUST be the requirement itself where the key file holds its line and nothing where it does not (the key file being the requirement's path or the account's .ssh/authorized_keys); a package MUST be there where its status says installed, with its version where the requirement names one; a setting of the system MUST be read from where it is held (the time zone from where /etc/localtime points, the keyboard layout from XKBLAYOUT and the locale from LANG) and be nothing where it is not held.

Enforced (check): .github: cd commons/linux-observe && bun run verify — suite/observe.test.ts

Proved by: linux-observe/suite/observe.test.ts

Written in: linux-observe/src/logical/shapes.ts

Tests: passed: suite/observe.test.ts a key, a package and a setting of the system are read from what holds them, and are not th

Acceptance scenarios

  1. Given a user in the passwd database, When it is read, Then only the fields the requirement declares are in the shape, per FR-001.

Out of scope

Edge cases

  • A requirement that says less is satisfied by more, because a field it does not declare is not read, per FR-001.

Assumptions

  • The machine is Ubuntu or Debian with systemd, as the programs read assume.

Open questions

  • None.

Key entities

  • Shape, Observation.

Success criteria

SC-001success criterion

A machine made as an order declares is observed equal to the order.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No company fact is asserted here
  • [x] Every open item is marked, not silently decided

Cited by

Linux observation: observing a machine

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