fleet/frontend/interfaces/osquery_table.ts
Gabriel Hernandez a950e9d095
Feat/update query doc sidepanel (#8214)
* create new components for query side panel

* add reusable icon component that uses svg for icons

* integrate with new osquery_fleet_schema.json data

* update UI to work with osquery_fleet_schema.json

* add remark-gfm to safely support direct urls in markdown

* move fleet ace into markdown component so we can render code with ace editor

* add testing for new query sidebar

* remove incomplete tests for query sidepanel
2022-10-14 17:45:57 +01:00

155 lines
3.3 KiB
TypeScript

import PropTypes from "prop-types";
import { IOsqueryPlatform } from "./platform";
export default PropTypes.shape({
columns: PropTypes.arrayOf(
PropTypes.shape({
description: PropTypes.string,
name: PropTypes.string,
type: PropTypes.string,
})
),
description: PropTypes.string,
name: PropTypes.string,
platform: PropTypes.string,
});
export type ColumnType =
| "integer"
| "bigint"
| "double"
| "text"
| "unsigned_bigint";
export interface IQueryTableColumn {
name: string;
description: string;
type: ColumnType;
hidden: boolean;
required: boolean;
index: boolean;
platforms?: IOsqueryPlatform[];
requires_user_context?: boolean;
}
export interface IOsQueryTable {
name: string;
description: string;
url: string;
platforms: IOsqueryPlatform[];
evented: boolean;
cacheable: boolean;
columns: IQueryTableColumn[];
examples?: string;
notes?: string;
}
export const DEFAULT_OSQUERY_TABLE: IOsQueryTable = {
name: "users",
description:
"Local user accounts (including domain accounts that have logged on locally (Windows)).",
url: "https://github.com/osquery/osquery/blob/master/specs/users.table",
platforms: ["darwin", "linux", "windows"],
evented: false,
cacheable: false,
columns: [
{
name: "uid",
description: "User ID",
type: "bigint",
hidden: false,
required: false,
index: false,
},
{
name: "gid",
description: "Group ID (unsigned)",
type: "bigint",
hidden: false,
required: false,
index: false,
},
{
name: "uid_signed",
description: "User ID as int64 signed (Apple)",
type: "bigint",
hidden: false,
required: false,
index: false,
},
{
name: "gid_signed",
description: "Default group ID as int64 signed (Apple)",
type: "bigint",
hidden: false,
required: false,
index: false,
},
{
name: "username",
description: "Username",
type: "text",
hidden: false,
required: false,
index: false,
},
{
name: "description",
description: "Optional user description",
type: "text",
hidden: false,
required: false,
index: false,
},
{
name: "directory",
description: "User's home directory",
type: "text",
hidden: false,
required: false,
index: false,
},
{
name: "shell",
description: "User's configured default shell",
type: "text",
hidden: false,
required: false,
index: false,
},
{
name: "uuid",
description: "User's UUID (Apple) or SID (Windows)",
type: "text",
hidden: false,
required: false,
index: false,
},
{
name: "type",
description:
"Whether the account is roaming (domain), local, or a system profile",
type: "text",
hidden: true,
required: false,
index: false,
},
{
name: "is_hidden",
description: "IsHidden attribute set in OpenDirectory",
type: "integer",
hidden: false,
required: false,
index: false,
},
{
name: "pid_with_namespace",
description: "Pids that contain a namespace",
type: "integer",
hidden: true,
required: false,
index: false,
},
],
};