sql/extensions/osquery-atc/atc
Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0027-sql-osquery-atc FR-001, 0027-sql-osquery-atc FR-002, 0027-sql-osquery-atc FR-003, 0027-sql-osquery-atc FR-004
osquery Automatic Table Construction (commons data 0027-sql-osquery-atc): the configuration that makes tables of osquery from tables of a local SQLite database, made from a logical schema, with what osquery refuses refused first.
What osquery does, as read in its documentation of Automatic Table Construction (auto_table_construction in the configuration): query and path are required and columns is a list; every column is text to osquery; a column named path in any case is refused, because osquery adds a path column of its own; the platforms it names are darwin, linux, posix, windows, any and all; and a path may hold % for any one directory. The configuration made here was checked against that and by running each entry's query on a database built from the same source; it was not run in osquery.
Source: commons/data/sql/extensions/osquery-atc/atc.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.
function atc(schema: LogicalSchema, entries: readonly AtcEntry[], options: AtcOptions): Result<Atc, readonly AtcError[]>
The configuration of a set of entries.
| Parameter | What it is |
|---|
schema | the logical schema of the database |
entries | the entries |
options | the dialect (SQLite's), naming and schema |
Returns: the configuration, or why not
Imported by 4 tests of the run (4 passed, 0 failed): the library's results
Atcinterfaceno test imports itinterface Atc
The configuration.
| Member | Type | What it is |
|---|
config | { readonly auto_table_construction: Readonly<Record<string, AtcConfigEntry>>; } | |
json | string | The configuration as JSON, the same bytes every time. |
AtcConfigEntryinterfaceno test imports itinterface AtcConfigEntry
An entry as osquery reads it.
| Member | Type | What it is |
|---|
query | string | |
path | string | |
columns | readonly string[] | |
platform? | "all" | "any" | "darwin" | "linux" | "posix" | "windows" | |
interface AtcEntry
An osquery table made from a table of the database.
| Member | Type | What it is |
|---|
name | string | The name of the table in osquery. |
table | string | The table of the database, by the words of its name. |
columns | readonly string[] | The columns, by the words of their names, in the order the query gives them. |
path | string | The path of the database on the host, % standing for any one directory. |
platform? | "all" | "any" | "darwin" | "linux" | "posix" | "windows" | |
Imported by 4 tests of the run (4 passed, 0 failed): the library's results
AtcErrortypeno test imports ittype AtcError =
| { readonly kind: "unsupported"; readonly why: string }
| { readonly kind: "unknown-table"; readonl… (701 characters)
type AtcError =
| { readonly kind: "unsupported"; readonly why: string }
| { readonly kind: "unknown-table"; readonly entry: string; readonly table: string }
| { readonly kind: "unknown-column"; readonly entry: string; readonly column: string }
| { readonly kind: "name"; readonly entry: string }
| { readonly kind: "duplicate"; readonly entry: string }
| { readonly kind: "path-column"; readonly entry: string; readonly column: string }
| { readonly kind: "no-columns"; readonly entry: string }
| { readonly kind: "platform"; readonly entry: string; readonly platform: string }
| { readonly kind: "path"; readonly entry: string; readonly path: string; readonly platform: Platform };
Why an automatic table construction cannot be made, as a value.
AtcOptionsinterfaceno test imports itinterface AtcOptions
What a configuration is made with.
| Member | Type | What it is |
|---|
dialect | Dialect | |
naming? | Naming | |
schema? | string | The schema the tables are in, as the database was built with it. |
const POSIX_PATH: RegExp
A path on POSIX, and one on Windows (a drive or a share).
Imported by 4 tests of the run (4 passed, 0 failed): the library's results
const WINDOWS_PATH: RegExp
Matches a Windows path: a drive letter and a separator, or a UNC share.
Imported by 4 tests of the run (4 passed, 0 failed): the library's results