|
1 | 1 | async function parse() { |
2 | | - return transformToFindings(); |
3 | | -} |
4 | | - |
5 | | -function transformToFindings() { |
6 | | - const portFindings = { |
7 | | - name: "Test read-write-hook service", |
8 | | - description: `Port is using protocol.`, |
9 | | - category: 'Open Port', |
10 | | - location: `tcp://rw-hook-test:80`, |
11 | | - osi_layer: 'NETWORK', |
12 | | - severity: 'INFORMATIONAL', |
13 | | - attributes: { |
14 | | - port: 80, |
15 | | - state: "Open", |
16 | | - ip_address: "host ip address", |
17 | | - mac_address: "hostInfo.mac", |
18 | | - protocol: "openPort.protocol", |
19 | | - hostname: "hostInfo.hostname", |
20 | | - method: "openPort.method", |
21 | | - operating_system: "hostInfo.osNmap", |
22 | | - service: "openPort.service", |
23 | | - serviceProduct: "openPort.serviceProduct", |
24 | | - serviceVersion: "openPort.serviceVersion", |
25 | | - scripts: "openPort.scriptOutputs", |
| 2 | + return [ |
| 3 | + { |
| 4 | + name: "Test read-write-hook service", |
| 5 | + description: `Port is using protocol.`, |
| 6 | + category: "Open Port", |
| 7 | + location: `tcp://rw-hook-test:80`, |
| 8 | + osi_layer: "NETWORK", |
| 9 | + severity: "INFORMATIONAL", |
| 10 | + attributes: { |
| 11 | + port: 80, |
| 12 | + state: "Open", |
| 13 | + ip_address: "host ip address", |
| 14 | + mac_address: "hostInfo.mac", |
| 15 | + protocol: "openPort.protocol", |
| 16 | + hostname: "hostInfo.hostname", |
| 17 | + method: "openPort.method", |
| 18 | + operating_system: "hostInfo.osNmap", |
| 19 | + service: "openPort.service", |
| 20 | + serviceProduct: "openPort.serviceProduct", |
| 21 | + serviceVersion: "openPort.serviceVersion", |
| 22 | + scripts: "openPort.scriptOutputs", |
| 23 | + }, |
26 | 24 | }, |
27 | | - }; |
28 | | - |
29 | | - const hostFindings = { |
30 | | - name: `Host: hostname`, |
31 | | - category: 'Host', |
32 | | - description: 'Found a host', |
33 | | - location: "hostname", |
34 | | - severity: 'INFORMATIONAL', |
35 | | - osi_layer: 'NETWORK', |
36 | | - attributes: { |
37 | | - ip_address: "ip address", |
38 | | - hostname: "hostname", |
39 | | - operating_system: "osNmap", |
| 25 | + { |
| 26 | + name: `Host: hostname`, |
| 27 | + category: "Host", |
| 28 | + description: "Found a host", |
| 29 | + location: "hostname", |
| 30 | + severity: "INFORMATIONAL", |
| 31 | + osi_layer: "NETWORK", |
| 32 | + attributes: { |
| 33 | + ip_address: "ip address", |
| 34 | + hostname: "hostname", |
| 35 | + operating_system: "osNmap", |
| 36 | + }, |
40 | 37 | }, |
41 | | - }; |
42 | | - |
43 | | - return [...portFindings, ...hostFindings]; |
| 38 | + ]; |
44 | 39 | } |
45 | 40 |
|
46 | 41 | module.exports.parse = parse; |
0 commit comments