Track insecure connection attempts
Summary: Same as previous diff but for plain socket. Reviewed By: antonk52 Differential Revision: D46220933 fbshipit-source-id: 235ca860891b8514dd0d743d32fe85f15a2cdd7e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
135d3e3aa8
commit
f25591580c
@@ -277,13 +277,15 @@ export class ServerController
|
|||||||
}
|
}
|
||||||
|
|
||||||
onConnectionAttempt(clientQuery: ClientQuery): void {
|
onConnectionAttempt(clientQuery: ClientQuery): void {
|
||||||
// TODO: track plain connection attempt.
|
|
||||||
const strippedClientQuery = (({device_id, ...o}) => o)(clientQuery);
|
const strippedClientQuery = (({device_id, ...o}) => o)(clientQuery);
|
||||||
const id = buildClientId({device_id: 'unknown', ...strippedClientQuery});
|
const id = buildClientId({device_id: 'unknown', ...strippedClientQuery});
|
||||||
this.timestamps.set(id, {
|
this.timestamps.set(id, {
|
||||||
insecureStart: Date.now(),
|
insecureStart: Date.now(),
|
||||||
});
|
});
|
||||||
this.logger.track('usage', 'untrusted-request-handler-called', clientQuery);
|
this.logger.track('usage', 'untrusted-request-handler-called', clientQuery);
|
||||||
|
|
||||||
|
tracker.track('app-connection-insecure-attempt', clientQuery);
|
||||||
|
|
||||||
this.connectionTracker.logConnectionAttempt(clientQuery);
|
this.connectionTracker.logConnectionAttempt(clientQuery);
|
||||||
|
|
||||||
const client: UninitializedClient = {
|
const client: UninitializedClient = {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ type AppConnectionPayload = {
|
|||||||
os: string;
|
os: string;
|
||||||
device: string;
|
device: string;
|
||||||
device_id: string;
|
device_id: string;
|
||||||
medium: number | undefined;
|
medium?: number | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
type TrackerEvents = {
|
type TrackerEvents = {
|
||||||
@@ -28,6 +28,7 @@ type TrackerEvents = {
|
|||||||
'server-proxy-error': {error: string};
|
'server-proxy-error': {error: string};
|
||||||
'app-connection-created': AppConnectionPayload;
|
'app-connection-created': AppConnectionPayload;
|
||||||
'app-connection-secure-attempt': AppConnectionPayload;
|
'app-connection-secure-attempt': AppConnectionPayload;
|
||||||
|
'app-connection-insecure-attempt': AppConnectionPayload;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ServerCoreTracker {
|
class ServerCoreTracker {
|
||||||
|
|||||||
Reference in New Issue
Block a user