File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 28
28
class AzSniffer (Auxiliary ):
29
29
def __init__ (self ):
30
30
super ().__init__ ()
31
+ self .azsniffer_cfg = Config ("auxiliary" ).get ("AzSniffer" )
32
+ self .enabled = self .azsniffer_cfg .enabled
31
33
32
- if not HAVE_AZURE :
34
+ if not HAVE_AZURE or not self . enabled :
33
35
return
34
36
35
37
self .cfg = Config ("az" )
@@ -58,6 +60,8 @@ def _get_credentials(self):
58
60
return ClientSecretCredential (tenant_id = self .tenant_id , client_id = self .client_id , client_secret = self .client_secret )
59
61
60
62
def start (self ):
63
+ if not self .enabled :
64
+ return
61
65
self .capture_name = f"PacketCapture_{ self .task .id } "
62
66
custom_filters = []
63
67
self .create_packet_capture (custom_filters )
@@ -96,6 +100,9 @@ def create_packet_capture(self, custom_filters):
96
100
raise
97
101
98
102
def stop (self ):
103
+ if not self .enabled :
104
+ return
105
+
99
106
if not self .capture_name :
100
107
log .error ("No packet capture to stop" )
101
108
return
You can’t perform that action at this time.
0 commit comments