IF Commons GitHub

osquery ATC

0027Active

0027-sql-osquery-atc · owner if · domain data

The configuration

FR-001checkpassing

atc MUST make, from a logical schema, the SQLite dialect and entries (a table name for osquery, a table and columns by the words of their names, the path of the database and optionally a platform), a configuration of auto_table_construction entries and the text of it as JSON, the same bytes every time with the entries in the order of their names, and MUST give errors as values for a table or column the schema does not have, a dialect that is not SQLite's, two entries with one name, and a name that is not lower-case letters, digits and underscores that begins with a letter.

Enforced (check): .github: cd commons/data && bun run verify — suite/osquery-atc.test.ts: the configuration has an entry for each table in the order of their names, whose query selects its columns, written by the dialect, from its table, and it is the same bytes every time; suite/osquery-atc.test.ts: what osquery refuses is an error as a value: another dialect, an unknown table or column, a name, a duplicate, a column called path, no columns, a platform and a path that does not fit its platform

Proved by: data/suite/osquery-atc.test.ts

Written in: data/sql/extensions/osquery-atc/atc.ts, data/sql/extensions/osquery-atc/mod.ts

Tests: passed: suite/osquery-atc.test.ts the configuration has an entry for each table in the order of their names, whose query sel; passed: suite/osquery-atc.test.ts what osquery refuses is an error as a value: another dialect, an unknown table or column,

FR-002checkpassing

An entry's query MUST be SELECT of its columns, written and quoted by the dialect and in the order given, from its table, and its columns MUST be the same names in the same order, so that the query gives exactly the columns the entry says.

Enforced (check): .github: cd commons/data && bun run verify — suite/osquery-atc.test.ts: the configuration has an entry for each table in the order of their names, whose query selects its columns, written by the dialect, from its table, and it is the same bytes every time

Proved by: data/suite/osquery-atc.test.ts

Written in: data/sql/extensions/osquery-atc/atc.ts

Tests: passed: suite/osquery-atc.test.ts the configuration has an entry for each table in the order of their names, whose query sel

FR-003checkpassing

A column that is written as path (in any case) MUST be refused, as an error value, because osquery adds a path column of its own; an entry with no columns MUST be refused; and a platform MUST be one of darwin, linux, posix, windows, any or all, an entry with none applying to all.

Enforced (check): .github: cd commons/data && bun run verify — suite/osquery-atc.test.ts: what osquery refuses is an error as a value: another dialect, an unknown table or column, a name, a duplicate, a column called path, no columns, a platform and a path that does not fit its platform; suite/osquery-atc.test.ts: a column that is written as path, in any case, is refused because osquery adds a path column of its own

Proved by: data/suite/osquery-atc.test.ts

Written in: data/sql/extensions/osquery-atc/atc.ts

Tests: passed: suite/osquery-atc.test.ts what osquery refuses is an error as a value: another dialect, an unknown table or column, ; passed: suite/osquery-atc.test.ts a column that is written as path, in any case, is refused because osquery adds a path colu

FR-004checkpassing

A path MUST be absolute for its platform (a drive or a share for windows, a leading / for darwin, linux and posix, either for any and all or none), where % stands for any one directory, and anything else MUST be an error value.

Enforced (check): .github: cd commons/data && bun run verify — suite/osquery-atc.test.ts: what osquery refuses is an error as a value: another dialect, an unknown table or column, a name, a duplicate, a column called path, no columns, a platform and a path that does not fit its platform

Proved by: data/suite/osquery-atc.test.ts

Written in: data/sql/extensions/osquery-atc/atc.ts

Tests: passed: suite/osquery-atc.test.ts what osquery refuses is an error as a value: another dialect, an unknown table or column,

Behind it

FR-005checkpassing

Every entry's query MUST run on a SQLite database built from the same schema and rows (the ephemeral target of 0025), and the columns it gives MUST be those of the entry; this is what the tests do, since osquery is not run.

Enforced (check): .github: cd commons/data && bun run verify — suite/osquery-atc.test.ts: every entry's query runs on a SQLite database built from the same schema and rows and gives the columns the entry says

Proved by: data/suite/osquery-atc.test.ts

Tests: passed: suite/osquery-atc.test.ts every entry's query runs on a SQLite database built from the same schema and rows and give

Out of scope

  • Running osquery.
  • The types of values osquery reads: they are text to osquery, a boolean being 1 or 0.

Edge cases

  • An entry for a table in a schema qualifier: the dialect has no schemas, so the schema's words come first in the table's name, per FR-002.

Assumptions

  • The rules of the format are as read in osquery's documentation.

Open questions

OQ-1open question

Whether osquery accepts every path form listed; only the documented ones are.

Key entities

  • Entry - an osquery table made from a table of the database.
  • Configuration - the auto_table_construction object and its JSON.

Success criteria

SC-001success criterion

osquery reads the rows of a database that is built from the same source as the configuration that names its columns.

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

Data, sql/extensions/osquery-atc/atc

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