forked from flipkart-incubator/watchdog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configdb.py
50 lines (43 loc) · 1.3 KB
/
configdb.py
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
from mongo_connection import mongo_client
from select import select
import sys
def config_db(argv):
c = mongo_client()
db = c.config
db.external.remove()
if len(sys.argv) < 3:
web_dir = '/var/www/html'
else:
web_dir = sys.argv[2]
print web_dir
db.external.insert_one({
'PATH_WAPITI': web_dir+'/reports/outputWapiti/',
'DATABASE': 'testingExternal',
'TIMEOUT_VUL': '180',
'TIMEOUT_TECH': '30',
'PATH_LOGFILE': 'external.log',
'PATH_SKIPFISH': web_dir+'/reports/outputSkipfish/',
})
db.internal.insert_one({
'REPO_PATH':"",
'SCALE_CRITICAL_VUL_CVE_EXTERNAL':8.3,
'SELF_SERVE_DATABASE':'Self_Serve_Internal_Testing',
'SCALE_MEDIUM_VUL_CVE_EXTERNAL':5.0,
'DATABASE':'Internal_Testing',
'ORGANISATION':'<>',
'GIT_TOKEN':'<>:<>',
'SCALE_MEDIUM_VUL_CVE_INTERNAL':5.0,
'DEPENDENCY_PATH_LOGFILE':'dependency_log.log',
'SELF_SERVE_SOURCE_PATH_LOGFILE':'self_serve_source_log.log',
'SELF_SERVE_DEPENDENCY_PATH_LOGFILE':'self_serve_dependency_log.log',
'SOURCE_PATH_LOGFILE':'source_log.log',
'SELF_SERVE_TIME_OUT':30,
'TIME_OUT':30,
'SCALE_HIGH_VUL_CVE_INTERNAL':7.5,
'SCALE_HIGH_VUL_CVE_EXTERNAL':7.5,
'SCALE_CRITICAL_VUL_CVE_INTERNAL':8.3,
'SCALE_HIGH_VUL_REPO':8.3
})
return web_dir
if __name__ == '__main__':
config_db(sys.argv)