n8n-nodes-binalyze-air
Version:
Binalyze AIR nodes for automating DFIR with n8n workflows
218 lines (217 loc) • 6.56 kB
TypeScript
import { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-workflow';
import { AirCredentials } from '../../../../credentials/AirApi.credentials';
export interface Asset {
_id: string;
name: string;
ipAddress: string;
platform: string;
version: string;
onlineStatus: string;
managedStatus: string;
isolationStatus: string;
groupId?: string;
groupFullPath?: string;
policy?: string;
tags?: string[];
organizationId: number;
lastSeen?: string;
createdAt?: string;
updatedAt?: string;
}
export interface AssetsResponse {
success: boolean;
result: {
entities: Asset[];
filters: Array<{
name: string;
type: string;
options: string[];
filterUrl: string | null;
}>;
sortables: string[];
totalEntityCount: number;
currentPage: number;
pageSize: number;
previousPage: number;
totalPageCount: number;
nextPage: number;
};
statusCode: number;
errors: string[];
}
export interface GetAssetResponse {
success: boolean;
result: Asset;
statusCode: number;
errors: string[];
}
export interface AssetTask {
_id: string;
taskId: string;
name: string;
type: string;
endpointId: string;
endpointName: string;
organizationId: number;
status: string;
recurrence: string | null;
progress: number;
durations: {
processing?: number;
} | null;
duration: number | null;
caseIds: string[];
metadata: {
purged: boolean;
hasCaseDb: boolean;
hasCasePpc: boolean;
hasDroneData: boolean;
};
createdAt: string;
createdBy: string;
updatedAt: string;
response: {
errorMessage: string | null;
caseDirectory: string | null;
matchCount: string | null;
result: any;
} | null;
}
export interface AssetTasksResponse {
success: boolean;
result: {
entities: AssetTask[];
filters: Array<{
name: string;
type: string;
options: string[];
filterUrl: string | null;
}>;
sortables: string[];
totalEntityCount: number;
currentPage: number;
pageSize: number;
previousPage: number;
totalPageCount: number;
nextPage: number;
};
statusCode: number;
errors: string[];
}
export interface AddTagsRequest {
tags: string[];
filter: {
searchTerm?: string;
name?: string;
ipAddress?: string;
groupId?: string;
groupFullPath?: string;
label?: string;
managedStatus?: string[];
isolationStatus?: string[];
platform?: string[];
issue?: string[];
onlineStatus?: string[];
tags?: string[];
version?: string;
policy?: string;
includedEndpointIds?: string[];
excludedEndpointIds?: string[];
organizationIds: number[];
connectionRouteId?: number;
hasConnectionRoute?: boolean;
caseId?: string;
awsRegions?: string[];
azureRegions?: string[];
agentInstalled?: boolean;
isServer?: boolean;
};
}
export interface RemoveTagsRequest {
tags: string[];
filter: {
searchTerm?: string;
name?: string;
ipAddress?: string;
groupId?: string;
groupFullPath?: string;
label?: string;
managedStatus?: string[];
isolationStatus?: string[];
platform?: string[];
issue?: string[];
onlineStatus?: string[];
tags?: string[];
version?: string;
policy?: string;
includedEndpointIds?: string[];
excludedEndpointIds?: string[];
organizationIds?: number[];
connectionRouteId?: number;
hasConnectionRoute?: boolean;
caseId?: string;
awsRegions?: string[];
azureRegions?: string[];
agentInstalled?: boolean;
isServer?: boolean;
};
}
export interface TagsOperationResponse {
success: boolean;
result: any;
statusCode: number;
errors: string[];
}
export interface DeviceActionFilter {
searchTerm?: string;
name?: string;
ipAddress?: string;
label?: string;
managedStatus?: string[];
isolationStatus?: string[];
platform?: string[];
tags?: string[];
includedEndpointIds?: string[];
organizationIds: number[];
caseId?: string;
isServer?: boolean;
}
export interface RebootRequest {
filter: DeviceActionFilter;
}
export interface ShutdownRequest {
filter: DeviceActionFilter;
}
export interface IsolationRequest {
enabled: boolean;
filter: DeviceActionFilter;
}
export interface DeviceActionTask {
_id: string;
taskId: string;
name: string;
type: string;
endpointId: string;
endpointName: string;
organizationId: number;
status: string;
createdAt: string;
createdBy: string;
updatedAt: string;
}
export interface DeviceActionResponse {
success: boolean;
result: DeviceActionTask[];
statusCode: number;
errors: string[];
}
export declare const api: {
getAssets(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, organizationIds?: string | string[], queryParams?: Record<string, string | number>): Promise<AssetsResponse>;
getAssetById(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, id: string): Promise<GetAssetResponse>;
getAssetTasks(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, id: string, queryParams?: Record<string, string | number | string[]>): Promise<AssetTasksResponse>;
addTagsToAssets(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, data: AddTagsRequest): Promise<TagsOperationResponse>;
removeTagsFromAssets(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, data: RemoveTagsRequest): Promise<TagsOperationResponse>;
rebootAssets(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, data: RebootRequest): Promise<DeviceActionResponse>;
shutdownAssets(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, data: ShutdownRequest): Promise<DeviceActionResponse>;
setIsolationOnAssets(context: IExecuteFunctions | ILoadOptionsFunctions, credentials: AirCredentials, data: IsolationRequest): Promise<DeviceActionResponse>;
};