-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
47 lines (37 loc) · 1.07 KB
/
config.py
File metadata and controls
47 lines (37 loc) · 1.07 KB
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
#
# This file is part of the Kintun - Restful Vulnerability Scanner
#
# (c) CERT UNLP <support@cert.unlp.edu.ar>
#
# This source file is subject to the GPL v3.0 license that is bundled
# with this source code in the file LICENSE.
#
import json
from pprint import pprint
import logging
import sys
import os
from utils.logger import setup_logger
from utils.db import setup_db
from utils.send_mail import MailLog
# Config
base_path = os.path.dirname(os.path.abspath(__file__))
os.chdir(base_path)
with open('config.json', encoding='utf-8') as json_data_file:
conf = json.load(json_data_file)
scanconf = conf['scan']
endpointsconf = conf['endpoints']
sslconf = conf['ssl']
# Logger
logger = setup_logger(conf['log'])
logger.info('Config Loaded\n'+str(conf))
# Context
sslpath = sslconf['folder']+'/'
ssl = (sslpath+sslconf['crt'], sslpath+sslconf['key'])
if not os.path.exists(scanconf["folder_output"]):
os.makedirs(scanconf["folder_output"])
# Database
dbdriver = conf['databases']['driver']
db = setup_db(conf['databases'][dbdriver])
# MailLog
maillog = MailLog(conf['maillog'])