File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,3 +105,24 @@ def user_configuration():
105105 "default_selected_modules" : "all" , # or select one or multiple (e.g. ftp/strong_password,ssh/strong_password)
106106 "default_excluded_modules" : None # or any module name separated with comma
107107 }
108+
109+
110+ def sentry_configuration () -> dict :
111+ """
112+ sentry configuration
113+
114+ Returns:
115+ JSON/Dict sentry configuration
116+ """
117+ return {
118+ "sentry_monitoring" : False ,
119+ # Enter your Sentry Project URL here.
120+ "sentry_dsn_url" : "" ,
121+ # Enter Trace Rate Here.
122+ "sentry_trace_rate" : 1
123+ # Set sentry_trace_rate to 1.0 to capture 100%
124+ # of transactions for performance monitoring.
125+ # sentry_trace_rate is ratio of errors being
126+ # reported to the number of issues which arise.
127+
128+ }
Original file line number Diff line number Diff line change 22# -*- coding: utf-8 -*-
33
44import sys
5+
6+ from config import sentry_configuration
57from core .load import load_honeypot_engine
8+ import sentry_sdk
69
710if __name__ == "__main__" :
11+ config = sentry_configuration ()
12+ if config ["sentry_monitoring" ]:
13+ sentry_sdk .init (
14+ dsn = config ["sentry_dsn_url" ],
15+ traces_sample_rate = config ["sentry_trace_rate" ],
16+ )
817 sys .exit (0 if load_honeypot_engine () is True else 1 )
Original file line number Diff line number Diff line change @@ -9,4 +9,5 @@ oschmod==0.3.12
99argparse == 1.4.0
1010PyYAML == 5.4.1 # library_name=yaml
1111flask-swagger == 0.2.14 # library_name=flask_swagger
12- flask-swagger-ui == 3.36.0 # library_name=flask_swagger_ui
12+ flask-swagger-ui == 3.36.0 # library_name=flask_swagger_ui
13+ sentry-sdk == 1.6.0 # library_name=sentry_sdk
You can’t perform that action at this time.
0 commit comments