diff --git a/@overflow/model/discovery/Host.ts b/@overflow/model/discovery/Host.ts index c0c9cbe..8808ae6 100644 --- a/@overflow/model/discovery/Host.ts +++ b/@overflow/model/discovery/Host.ts @@ -1,6 +1,6 @@ import { Zone } from './Zone'; // import { Port } from './Port'; -import { MetaIPType } from '../meta'; +import { MetaIPType, MetaDiscovererType } from '../meta'; export const defaultOsType = 'UNKNOWN'; export const defaultHostType = 'HOST'; @@ -20,7 +20,7 @@ export interface Host { hostModel?: string; meta?: Map>; - discoveredBy?: string[]; + discoveredBy?: MetaDiscovererType[]; discoveredDate?: Date; zone?: Zone; diff --git a/@overflow/model/discovery/Port.ts b/@overflow/model/discovery/Port.ts index 9a7588d..61fe112 100644 --- a/@overflow/model/discovery/Port.ts +++ b/@overflow/model/discovery/Port.ts @@ -1,12 +1,12 @@ import { Host } from './Host'; -import { MetaPortType } from '../meta'; +import { MetaPortType, MetaDiscovererType } from '../meta'; export interface Port { metaPortType?: MetaPortType; portNumber?: number; meta?: Map>; - discoveredBy?: string[]; + discoveredBy?: MetaDiscovererType[]; discoveredDate?: Date; host?: Host; diff --git a/@overflow/model/discovery/Service.ts b/@overflow/model/discovery/Service.ts index b4bc4ac..68d76db 100644 --- a/@overflow/model/discovery/Service.ts +++ b/@overflow/model/discovery/Service.ts @@ -1,5 +1,5 @@ import { Port } from './Port'; -import { MetaCryptoType } from '../meta'; +import { MetaCryptoType, MetaDiscovererType } from '../meta'; export const defaultServiceType = 'ETC'; export const defaultServiceVendor = 'UNKNOWN'; @@ -16,7 +16,7 @@ export interface Service { serviceVersion?: string; meta?: Map>; - discoveredBy?: string[]; + discoveredBy?: MetaDiscovererType[]; discoveredDate?: Date; port?: Port; diff --git a/@overflow/model/discovery/Zone.ts b/@overflow/model/discovery/Zone.ts index 53ad0a5..c86dbd3 100644 --- a/@overflow/model/discovery/Zone.ts +++ b/@overflow/model/discovery/Zone.ts @@ -1,4 +1,4 @@ -import { MetaIPType } from '../meta'; +import { MetaIPType, MetaDiscovererType } from '../meta'; export interface Zone { network?: string; @@ -8,7 +8,7 @@ export interface Zone { mac?: string; meta?: Map>; - discoveredBy?: string[]; + discoveredBy?: MetaDiscovererType[]; discoveredDate?: Date; hostList?: any[]; diff --git a/@overflow/model/meta/MetaDiscovererType.ts b/@overflow/model/meta/MetaDiscovererType.ts new file mode 100644 index 0000000..1b1e2ba --- /dev/null +++ b/@overflow/model/meta/MetaDiscovererType.ts @@ -0,0 +1,35 @@ +export interface MetaDiscovererType { + id?: number; + name?: string; + key?: string; + createDate?: Date; +} + +export enum MetaDiscovererTypeEnum { + UNKNOWN = 'UNKNOWN', + ARP = 'ARP', + ICMP = 'ICMP', + MDNS = 'MDNS', + NDP = 'NDP', + SNMP = 'SNMP', + TCPACK = 'TCPACK', + TCPFIN = 'TCPFIN', + TCPNULL = 'TCPNULL', + TCPXmas = 'TCPXmas', + TCPSyn = 'TCPSyn', + TCPConnection = 'TCPConnection', + TCPMatcher = 'TCPMatcher', + UDPConnection = 'UDPConnection', + UDPMatcher = 'UDPMatcher', + UPnP = 'UPnP', +} + +export const toMetaDiscovererTypeEnum = (v: MetaDiscovererType): MetaDiscovererTypeEnum => { + return MetaDiscovererTypeEnum[v.key]; +}; + +export const toMetaDiscovererType = (v: MetaDiscovererTypeEnum): MetaDiscovererType => { + return { + key: v, + }; +}; diff --git a/@overflow/model/meta/index.ts b/@overflow/model/meta/index.ts index 8fe49dd..e7849b6 100644 --- a/@overflow/model/meta/index.ts +++ b/@overflow/model/meta/index.ts @@ -1,7 +1,9 @@ export * from './MetaCrawler'; export * from './MetaCrawlerInputItem'; export * from './MetaCrawlerMapping'; +export * from './MetaCredentialType'; export * from './MetaCryptoType'; +export * from './MetaDiscovererType'; export * from './MetaEmailType'; export * from './MetaHistoryType'; export * from './MetaInfraType';