-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmobsf.js
49 lines (49 loc) · 1.58 KB
/
mobsf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const getMobsfSheetConfig = (mobsf) => {
if (!mobsf) return
const valuableFileInfo = {
filename: mobsf.file_name,
size: mobsf.size
}
const fileInformationConfig = [
["File information", ""], , ...Object.entries(valuableFileInfo)
]
const valuableAppInfo = {
App_name: mobsf.app_name,
Identifier: mobsf.package_name,
SDK_Name: mobsf.target_sdk,
version: mobsf.version,
Platform_version: mobsf.version_code,
}
const appInformationConfig = [
["App information", ""], , ...Object.entries(valuableAppInfo)
]
const {
appsec
} = mobsf
const appsecConfig = Object.entries(appsec).filter((risk) => {
if (["high", "warning", "info"].includes(risk[0])) {
return true
} else return false
})
const valuableappsecInfoArr = appsecConfig.map(risk => {
return risk[1].map(details => {
return {
title: details.title,
description: details.description,
severity: risk[0]
}
})
}).reduce((previous, current) => {
return [...previous, ...current]
})
const appsecConfig1 = [
["AppSec", ""], ["Title","Description","Severity"], ...
valuableappsecInfoArr.map(valuableappsecInfo => {
return [valuableappsecInfo.title, valuableappsecInfo.description, valuableappsecInfo.severity]
})
]
return [...fileInformationConfig, ["", ""], ...appInformationConfig, ["", ""], ...appsecConfig1];
}
module.exports = {
getMobsfSheetConfig
}