@@ -20,13 +20,8 @@ def perform(scan_id,scaner_instance)
20
20
:run_tasks => [ ] ,
21
21
:logfile => @logfile
22
22
}
23
- if scan . target . present?
24
- pipeline_options [ :target ] = scan . target
25
- else
26
- @dir = Dir . mktmpdir
27
- system ( "cp" , "-r" , "#{ scan . project_target . path } " , "#{ @dir } " )
28
- pipeline_options [ :target ] = "#{ @dir } "
29
- end
23
+ pipeline_options [ :target ] = scan . target
24
+
30
25
scan_type = ScanType . where ( "name like ?" , "%#{ scan . scan_type } %" )
31
26
tools = scan_type . first . tasks . map ( &:name )
32
27
pipeline_tools = Setting . find_by ( var : 'pipeline' )
@@ -57,7 +52,7 @@ def perform(scan_id,scaner_instance)
57
52
scan . update_scan_status ( "failed" , "Some error occured" )
58
53
scan . end_time = Time . now . asctime
59
54
scan . save
60
- FileUtils . remove_entry_secure ( @dir ) if Dir . exist? ( @dir )
55
+ # FileUtils.remove_entry_secure(@dir) if Dir.exist?(@dir)
61
56
AlertNotification . create ( user_id : scan . user_id , identifier : 'task' , alert_type : 'danger' , message : "#{ scan . scan_type } Scanning failed" , scaner_id : scan . id , task_name : @project_title )
62
57
@logfile . puts "Error occurred while running dynamicscan ...#{ e . backtrace } "
63
58
@logfile . close
@@ -68,7 +63,7 @@ def perform(scan_id,scaner_instance)
68
63
scan . update_scan_status ( "Completed" , "completed" )
69
64
scan . end_time = Time . now . asctime
70
65
scan . save
71
- FileUtils . remove_entry_secure ( @dir ) if Dir . exist? ( @dir )
66
+ # FileUtils.remove_entry_secure(@dir) if Dir.exist?(@dir)
72
67
AlertNotification . create ( user_id : scan . user_id , identifier : 'task' , alert_type : 'success' , message : "#{ scan . scan_type } Scanning completed" , scaner_id : scan . id , task_name : @project_title )
73
68
@logfile . puts "sending notification mail..for scan id.#{ scan_id } "
74
69
#scan.send_notifications
0 commit comments