-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
58 lines (46 loc) · 1.79 KB
/
config.py
File metadata and controls
58 lines (46 loc) · 1.79 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
48
49
50
51
52
53
54
55
56
57
"""
API Security Dashboard Configuration
"""
import os
class Config:
# MongoDB Configuration
MONGODB_URI = os.environ.get('MONGODB_URI') or 'mongodb://apinizer:PASSWORD@MONGOIP:25080/'
MONGODB_DB = 'apinizerdb'
# Elasticsearch Configurations - Now loaded from MongoDB connection_config_elasticsearch collection
# Sensitive Keywords File
SENSITIVE_KEYWORDS_FILE = os.environ.get('SENSITIVE_KEYWORDS_FILE') or 'sample.txt'
# Security Score Weights
SECURITY_SCORE_WEIGHTS = {
'ip_whitelist_coverage': 0.15, # IP whitelist kullanım oranı
'throttling_configured': 0.15, # Throttling policy varlığı
'quota_configured': 0.05, # Quota policy varlığı
'authentication_strength': 0.20, # Authentication policy güçlülüğü
'allowed_hours': 0.05, # Allowed hours policy (zaman kısıtlaması)
'traffic_anomaly': 0.05, # Trafik anomalisi
'error_rate': 0.05, # Hata oranı
'ssl_tls_status': 0.10, # SSL/TLS kullanımı (client + backend)
'logging_status': 0.20 # Logging durumu ve sensitive data kontrolü
}
# Dashboard Settings
DEFAULT_DATE_RANGE_DAYS = 7
MAX_DATE_RANGE_DAYS = 90
ITEMS_PER_PAGE = 20
class DevelopmentConfig(Config):
"""Development configuration"""
DEBUG = True
TESTING = False
class ProductionConfig(Config):
"""Production configuration"""
DEBUG = False
TESTING = False
class TestingConfig(Config):
"""Testing configuration"""
DEBUG = True
TESTING = True
# Configuration dictionary
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig,
'default': DevelopmentConfig
}