Skip to content

Commit

Permalink
Remove brimcap capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskerr committed Feb 12, 2025
1 parent fc0935a commit 71a02f5
Show file tree
Hide file tree
Showing 28 changed files with 17 additions and 797 deletions.
2 changes: 1 addition & 1 deletion apps/zui/src/core/zq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const zq = ((opts) => {
}) as typeof zed.zq

export const createReadableStream = ((opts) => {
return zed.createReadableStream({...opts, bin: zdeps.zq})
return zed.createReadableStream({...opts, bin: zdeps.superdb})
}) as typeof zed.createReadableStream
23 changes: 7 additions & 16 deletions apps/zui/src/domain/loads/handlers/preview-load-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,22 @@ import {createHandler} from "src/core/handlers"
import Current from "src/js/state/Current"
import LoadDataForm from "src/js/state/LoadDataForm"
import Pools from "src/js/state/Pools"
import {quickLoadFiles} from "./quick-load-files"
import Modal from "src/js/state/Modal"

export const previewLoadFiles = createHandler(
"loads.previewLoadFiles",
async (
{dispatch, invoke, select},
opts: {files: string[]; poolId?: string}
) => {
const files = await invoke("loads.getFileTypes", opts.files)
async ({dispatch, select}, opts: {files: string[]; poolId?: string}) => {
const lakeId = select(Current.getLakeId)
const pool = select(Pools.get(lakeId, opts.poolId))
const poolId = pool ? pool.id : null

if (files.length === 1 && files[0].type === "pcap") {
quickLoadFiles({files: files.map((f) => f.path), poolId})
if (select(LoadDataForm.getShow)) {
// The preview load is already opened
dispatch(LoadDataForm.addFiles(opts.files))
} else {
if (select(LoadDataForm.getShow)) {
// The preview load is already opened
dispatch(LoadDataForm.addFiles(opts.files))
} else {
dispatch(LoadDataForm.setFiles(opts.files))
dispatch(LoadDataForm.setPoolId(poolId))
dispatch(Modal.show("preview-load"))
}
dispatch(LoadDataForm.setFiles(opts.files))
dispatch(LoadDataForm.setPoolId(poolId))
dispatch(Modal.show("preview-load"))
}
}
)
1 change: 0 additions & 1 deletion apps/zui/src/domain/loads/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export type LoadFormData = {
export type LoadsOperations = {
"loads.create": typeof ops.create
"loads.preview": typeof ops.preview
"loads.getFileTypes": typeof ops.getFileTypes
"loads.abortPreview": typeof ops.abortPreview
"loads.abort": typeof ops.abort
"loads.paste": typeof ops.paste
Expand Down
1 change: 0 additions & 1 deletion apps/zui/src/domain/loads/operations/create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {createOperation} from "src/core/operations"
import * as zui from "src/zui"
import {Pool} from "src/models/pool"
import {ZedScript} from "src/models/zed-script"
import {LoadFormData} from "../messages"
import {errorToString} from "src/util/error-to-string"
import {deriveName} from "src/domain/pools/utils"
Expand Down
16 changes: 0 additions & 16 deletions apps/zui/src/domain/loads/operations/get-file-types.ts

This file was deleted.

1 change: 0 additions & 1 deletion apps/zui/src/domain/loads/operations/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from "./get-file-types"
export * from "./preview"
export * from "./create"
export * from "./abort"
Expand Down
2 changes: 0 additions & 2 deletions apps/zui/src/models/snapshot/source-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export class SourceSet {
.concat(mainText)
.filter((snippet) => snippet.trim().length)
.forEach((snippet) => this.appendSource(snippet))

if (!this.sources.length) this.appendSource("*")
}

appendSource(text: string) {
Expand Down
27 changes: 0 additions & 27 deletions apps/zui/src/plugins/brimcap/analyze.ts

This file was deleted.

126 changes: 0 additions & 126 deletions apps/zui/src/plugins/brimcap/cli.ts

This file was deleted.

3 changes: 0 additions & 3 deletions apps/zui/src/plugins/brimcap/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
export const pluginNamespace = "brimcap"
export const yamlConfigPropName = "yamlConfigPath"
export const suricataLocalRulesPropName = "suricataLocalRulesPath"
export const pcapFolderPropName = "pcapExtractionFolderPath"
47 changes: 0 additions & 47 deletions apps/zui/src/plugins/brimcap/configurations.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/zui/src/plugins/brimcap/configure-zeek-pool.ts

This file was deleted.

19 changes: 1 addition & 18 deletions apps/zui/src/plugins/brimcap/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
import {PluginContext} from "src/zui"
import {activateBrimcapLoader} from "./loader"
import {activateSuricataUpdater} from "./suricata/update"
import {activateDownloadPacketsCommand} from "./packets/download"
import {activatePacketsMenuItem} from "./packets/menu-item"
import {activateBrimcapConfigurations} from "./configurations"
import {activateSuricataCorrelations} from "./suricata/correlations"
import {activateZeekCorrelations} from "./zeek/correlations"
import {activateStorage} from "./storage"

export function activate(ctx: PluginContext) {
const {root, suricata} = activateStorage(ctx)

// suricataupdater and suricatarunner (run by "brimcap analyze")
// both consult BRIM_SURICATA_USER_DIR.
process.env.BRIM_SURICATA_USER_DIR = suricata

activatePacketsMenuItem()
activateDownloadPacketsCommand(root)
export function activate(_ctx: PluginContext) {
activateSuricataCorrelations()
activateZeekCorrelations()
activateBrimcapLoader(root)
activateBrimcapConfigurations()
activateSuricataUpdater()
}
Loading

0 comments on commit 71a02f5

Please sign in to comment.