IF Commons GitHub

Pentest: authorization

0004Active

0004-pentest-authorization · owner if · domain commons

Requirements

FR-001checkpassing

An engagement MUST be in force only when the commit that holds it was accepted by the signers of the fleet (with the approval its controlled path asks for), the file is the one committed, and the instant is within its window (from and not after the end); an engagement that is unsigned, modified, refused or blocked, or whose window is not open, MUST be not in force, with every reason said.

Enforced (check): .github: cd commons/pentest && bun run verify — suite/authorization.test.ts

Proved by: pentest/suite/authorization.test.ts

Written in: pentest/src/logical/authorize.ts

Tests: passed: suite/authorization.test.ts an engagement is in force only when it was accepted, is the committed file and the window

FR-002checkpassing

An action (one technique on one asset) MUST be allowed only when the engagement is in force, the technique is one the engagement grants and no technique that is never granted, and the asset is in its scope; a technique that is never granted or is no technique MUST be refused whatever else is true; and passive, which sends nothing to a target, MUST be allowed without an engagement in force, and the answer MUST say so. Every answer MUST say why in a sentence.

Enforced (check): .github: cd commons/pentest && bun run verify — suite/authorization.test.ts

Proved by: pentest/suite/authorization.test.ts

Written in: pentest/src/logical/authorize.ts

Tests: passed: suite/authorization.test.ts an action is allowed only in force, with a granted technique, on an asset in scope; a tech

FR-003checkpassing

The scope MUST be the assets of the include question less those of the exclude question, each read from a column named asset of its answer; it MUST be a problem where a question is refused or has no such column, where an asset is not one the estate has, and where the scope is empty.

Enforced (check): .github: cd commons/pentest && bun run verify — suite/authorization.test.ts

Proved by: pentest/suite/authorization.test.ts

Written in: pentest/src/logical/scope.ts

Tests: passed: suite/authorization.test.ts the scope is the include question less the exclude question, read from the column asset, a

Acceptance scenarios

  1. Given a signed engagement in its window with probe granted, When probe on an asset in scope is asked, Then it is allowed, per FR-002.
  2. Given the same engagement a day after its window, When it is asked again, Then it is refused because the window ended, per FR-001.

Out of scope

  • Judging signatures: the library change-control does, and gives the verdict (accepted, refused, blocked).
  • Asking the estate: the caller does.

Edge cases

  • An asset both included and excluded is out of scope and is reported as excluded, per FR-003.

Assumptions

  • The instant now is the clock of the machine that asks; a test that must hold against a hostile clock is outside this library.

Open questions

  • None.

Key entities

  • Signature, Standing, Answer, Scope.

Success criteria

SC-001success criterion

The tests of the library pass.

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

Pentest: the engagement, Pentest: the passive checks

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