mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
53f57c44db
## Addresses #12636 – follow-up work for PR #12713 - Update Platforms column to render the user-selected platforms for a query if any, otherwise those that are compatible <img width="686" alt="Screenshot 2023-07-14 at 6 03 06 PM" src="https://github.com/fleetdm/fleet/assets/61553566/abd1f079-bdfe-45be-b1dd-58eb903672ef"> - Clean up typing and names around this column - Encapsulate logic for query automations column cells into new QueryAutomationsStatusIndicator component - Increase modularity and decrease coupling of StatusIndicator - Cleanly handle overflowing queries table due to very long query name <img width="512" alt="Screenshot 2023-07-14 at 6 07 20 PM" src="https://github.com/fleetdm/fleet/assets/61553566/6e970038-0aac-4f71-b21d-ececfa66b94f"> - Small copy and layout fixes - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
177 lines
4.0 KiB
TypeScript
177 lines
4.0 KiB
TypeScript
import PropTypes from "prop-types";
|
|
import { OsqueryPlatform } 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?: OsqueryPlatform[];
|
|
requires_user_context?: boolean;
|
|
}
|
|
|
|
export interface IOsQueryTable {
|
|
name: string;
|
|
description: string;
|
|
url: string;
|
|
platforms: OsqueryPlatform[];
|
|
evented: boolean;
|
|
cacheable: boolean;
|
|
columns: IQueryTableColumn[];
|
|
examples?: string;
|
|
notes?: string;
|
|
hidden?: boolean;
|
|
}
|
|
|
|
// Also used for testing
|
|
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", "chrome"],
|
|
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,
|
|
platforms: ["macOS", "Windows", "Linux"],
|
|
},
|
|
{
|
|
name: "uid_signed",
|
|
description: "User ID as int64 signed (Apple)",
|
|
type: "bigint",
|
|
hidden: false,
|
|
required: false,
|
|
index: false,
|
|
platforms: ["macOS", "Windows", "Linux"],
|
|
},
|
|
{
|
|
name: "gid_signed",
|
|
description: "Default group ID as int64 signed (Apple)",
|
|
type: "bigint",
|
|
hidden: false,
|
|
required: false,
|
|
index: false,
|
|
platforms: ["macOS", "Windows", "Linux"],
|
|
},
|
|
{
|
|
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,
|
|
platforms: ["macOS", "Windows", "Linux"],
|
|
},
|
|
{
|
|
name: "directory",
|
|
description: "User's home directory",
|
|
type: "text",
|
|
hidden: false,
|
|
required: false,
|
|
index: false,
|
|
platforms: ["macOS", "Windows", "Linux"],
|
|
},
|
|
{
|
|
name: "shell",
|
|
description: "User's configured default shell",
|
|
type: "text",
|
|
hidden: false,
|
|
required: false,
|
|
index: false,
|
|
platforms: ["macOS", "Windows", "Linux"],
|
|
},
|
|
{
|
|
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,
|
|
platforms: ["Windows"],
|
|
},
|
|
{
|
|
name: "is_hidden",
|
|
description: "IsHidden attribute set in OpenDirectory",
|
|
type: "integer",
|
|
hidden: false,
|
|
required: false,
|
|
index: false,
|
|
platforms: ["macOS"],
|
|
},
|
|
{
|
|
name: "pid_with_namespace",
|
|
description: "Pids that contain a namespace",
|
|
type: "integer",
|
|
hidden: true,
|
|
required: false,
|
|
index: false,
|
|
},
|
|
{
|
|
name: "email",
|
|
description: "Email",
|
|
type: "text",
|
|
hidden: false,
|
|
required: false,
|
|
index: false,
|
|
platforms: ["chrome"],
|
|
},
|
|
],
|
|
notes: "",
|
|
examples:
|
|
"List users that have interactive access via a shell that isn't false.\n```\nSELECT * FROM users WHERE shell!='/usr/bin/false';\n```",
|
|
};
|