@j3r3mcdev/oast-server 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RawEvent, RawDnsEvent, RawSmtpEvent, RawTcpEvent, RawSsrfEvent, NormalizedHttpEvent, NormalizedDnsEvent, NormalizedSmtpEvent, NormalizedTcpEvent, NormalizedSsrfEvent, NormalizedWebhookEvent,
|
|
1
|
+
import { RawEvent, RawDnsEvent, RawSmtpEvent, RawTcpEvent, RawSsrfEvent, RawWebhookEvent, RawWebSocketEvent, RawApiEvent, NormalizedHttpEvent, NormalizedDnsEvent, NormalizedSmtpEvent, NormalizedTcpEvent, NormalizedSsrfEvent, NormalizedWebhookEvent, NormalizedWebSocketEvent, NormalizedApiEvent } from "../types/event.types";
|
|
2
2
|
export declare class EventNormalizer {
|
|
3
3
|
static normalizeDns(event: RawDnsEvent): NormalizedDnsEvent;
|
|
4
4
|
static normalizeHttp(event: RawEvent): NormalizedHttpEvent;
|
|
@@ -7,4 +7,5 @@ export declare class EventNormalizer {
|
|
|
7
7
|
static normalizeSsrf(raw: RawSsrfEvent): NormalizedSsrfEvent;
|
|
8
8
|
static normalizeWebhook(raw: RawWebhookEvent): NormalizedWebhookEvent;
|
|
9
9
|
static normalizeWebSocket(raw: RawWebSocketEvent): NormalizedWebSocketEvent;
|
|
10
|
+
static normalizeApi(raw: RawApiEvent): NormalizedApiEvent;
|
|
10
11
|
}
|
|
@@ -95,7 +95,7 @@ class EventNormalizer {
|
|
|
95
95
|
}
|
|
96
96
|
//
|
|
97
97
|
// -------------------------
|
|
98
|
-
//
|
|
98
|
+
// WEBHOOK
|
|
99
99
|
// -------------------------
|
|
100
100
|
//
|
|
101
101
|
static normalizeWebhook(raw) {
|
|
@@ -110,7 +110,7 @@ class EventNormalizer {
|
|
|
110
110
|
}
|
|
111
111
|
//
|
|
112
112
|
// -------------------------
|
|
113
|
-
//
|
|
113
|
+
// WEBSOCKET
|
|
114
114
|
// -------------------------
|
|
115
115
|
//
|
|
116
116
|
static normalizeWebSocket(raw) {
|
|
@@ -122,5 +122,22 @@ class EventNormalizer {
|
|
|
122
122
|
message: raw.message,
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
+
//
|
|
126
|
+
// -------------------------
|
|
127
|
+
// API (NOUVEAU)
|
|
128
|
+
// -------------------------
|
|
129
|
+
//
|
|
130
|
+
static normalizeApi(raw) {
|
|
131
|
+
return {
|
|
132
|
+
id: id_generator_1.IdGenerator.generate(),
|
|
133
|
+
type: "api",
|
|
134
|
+
timestamp: Date.now(),
|
|
135
|
+
sourceIp: raw.ip,
|
|
136
|
+
request: {
|
|
137
|
+
body: raw.body,
|
|
138
|
+
},
|
|
139
|
+
raw: raw.raw,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
125
142
|
}
|
|
126
143
|
exports.EventNormalizer = EventNormalizer;
|
package/package.json
CHANGED
|
@@ -4,15 +4,17 @@ import {
|
|
|
4
4
|
RawSmtpEvent,
|
|
5
5
|
RawTcpEvent,
|
|
6
6
|
RawSsrfEvent,
|
|
7
|
+
RawWebhookEvent,
|
|
8
|
+
RawWebSocketEvent,
|
|
9
|
+
RawApiEvent,
|
|
7
10
|
NormalizedHttpEvent,
|
|
8
11
|
NormalizedDnsEvent,
|
|
9
12
|
NormalizedSmtpEvent,
|
|
10
13
|
NormalizedTcpEvent,
|
|
11
14
|
NormalizedSsrfEvent,
|
|
12
15
|
NormalizedWebhookEvent,
|
|
13
|
-
RawWebhookEvent,
|
|
14
16
|
NormalizedWebSocketEvent,
|
|
15
|
-
|
|
17
|
+
NormalizedApiEvent,
|
|
16
18
|
} from "../types/event.types";
|
|
17
19
|
|
|
18
20
|
import { IdGenerator } from "./id-generator";
|
|
@@ -116,7 +118,7 @@ export class EventNormalizer {
|
|
|
116
118
|
|
|
117
119
|
//
|
|
118
120
|
// -------------------------
|
|
119
|
-
//
|
|
121
|
+
// WEBHOOK
|
|
120
122
|
// -------------------------
|
|
121
123
|
//
|
|
122
124
|
static normalizeWebhook(raw: RawWebhookEvent): NormalizedWebhookEvent {
|
|
@@ -132,7 +134,7 @@ export class EventNormalizer {
|
|
|
132
134
|
|
|
133
135
|
//
|
|
134
136
|
// -------------------------
|
|
135
|
-
//
|
|
137
|
+
// WEBSOCKET
|
|
136
138
|
// -------------------------
|
|
137
139
|
//
|
|
138
140
|
static normalizeWebSocket(raw: RawWebSocketEvent): NormalizedWebSocketEvent {
|
|
@@ -144,4 +146,22 @@ export class EventNormalizer {
|
|
|
144
146
|
message: raw.message,
|
|
145
147
|
};
|
|
146
148
|
}
|
|
149
|
+
|
|
150
|
+
//
|
|
151
|
+
// -------------------------
|
|
152
|
+
// API (NOUVEAU)
|
|
153
|
+
// -------------------------
|
|
154
|
+
//
|
|
155
|
+
static normalizeApi(raw: RawApiEvent): NormalizedApiEvent {
|
|
156
|
+
return {
|
|
157
|
+
id: IdGenerator.generate(),
|
|
158
|
+
type: "api",
|
|
159
|
+
timestamp: Date.now(),
|
|
160
|
+
sourceIp: raw.ip,
|
|
161
|
+
request: {
|
|
162
|
+
body: raw.body,
|
|
163
|
+
},
|
|
164
|
+
raw: raw.raw,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
147
167
|
}
|