Skip to content

Commit 06512d5

Browse files
(feature+fix) Add source to suricata ingestor. Correct endpoint for gcp mirroring (metlo-labs#62)
1 parent b5e92b6 commit 06512d5

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

backend/src/suricata_setup/gcp-services/gcp_setup.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,7 @@ export async function push_files({
840840
id,
841841
instance_url,
842842
...rest
843-
}: RESPONSE["data"]): Promise<RESPONSE> {
844-
const endpoint = "api/v1/log-request/single"
843+
}: RESPONSE["data"]): Promise<RESPONSE> {
845844
const instance_name = instance_url.split("/").at(-1)
846845
let [key, raw] = createApiKey(`Metlo-collector-${id}`)
847846
key.for = API_KEY_TYPE.GCP
@@ -863,7 +862,7 @@ export async function push_files({
863862

864863
put_data_file(
865864
format(filepath_ingestor_in, [
866-
`${process.env.BACKEND_URL}/${endpoint}`,
865+
`${process.env.BACKEND_URL}`,
867866
raw,
868867
]),
869868
filepath_ingestor_out,

ingestors/suricata/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export interface RESPONSE {
119119
sourcePort: number
120120
destination: string
121121
destinationPort: number
122+
metloSource: string,
122123
}
123124
}
124125

ingestors/suricata/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export function prepareResponse(
8989
sourcePort: alert.src_port,
9090
destination: alert.dest_ip,
9191
destinationPort: alert.dest_port,
92+
metloSource: "suricata"
9293
},
9394
}
9495
return resp

0 commit comments

Comments
 (0)