Class: ZAPv2::Pscan

Inherits:
Object
  • Object
show all
Defined in:
lib/zap/v2apis/pscan.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Pscan

Returns a new instance of Pscan.



5
6
7
# File 'lib/zap/v2apis/pscan.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#clear_queueObject



33
34
35
# File 'lib/zap/v2apis/pscan.rb', line 33

def clear_queue
  @client.get('/JSON/pscan/action/clearQueue/')
end

#current_ruleObject



9
10
11
# File 'lib/zap/v2apis/pscan.rb', line 9

def current_rule
  @client.get('/JSON/pscan/view/currentRule/')
end

#current_tasksObject



13
14
15
# File 'lib/zap/v2apis/pscan.rb', line 13

def current_tasks
  @client.get('/JSON/pscan/view/currentTasks/')
end

#disable_all_scannersObject



37
38
39
# File 'lib/zap/v2apis/pscan.rb', line 37

def disable_all_scanners
  @client.get('/JSON/pscan/action/disableAllScanners/')
end

#disable_all_tagsObject



41
42
43
# File 'lib/zap/v2apis/pscan.rb', line 41

def disable_all_tags
  @client.get('/JSON/pscan/action/disableAllTags/')
end

#disable_scanners(ids) ⇒ Object



45
46
47
# File 'lib/zap/v2apis/pscan.rb', line 45

def disable_scanners(ids)
  @client.get("/JSON/pscan/action/disableScanners/?ids=#{ids}")
end

#enable_all_scannersObject



49
50
51
# File 'lib/zap/v2apis/pscan.rb', line 49

def enable_all_scanners
  @client.get('/JSON/pscan/action/enableAllScanners/')
end

#enable_all_tagsObject



53
54
55
# File 'lib/zap/v2apis/pscan.rb', line 53

def enable_all_tags
  @client.get('/JSON/pscan/action/enableAllTags/')
end

#enable_scanners(ids) ⇒ Object



57
58
59
# File 'lib/zap/v2apis/pscan.rb', line 57

def enable_scanners(ids)
  @client.get("/JSON/pscan/action/enableScanners/?ids=#{ids}")
end

#max_alerts_per_ruleObject



17
18
19
# File 'lib/zap/v2apis/pscan.rb', line 17

def max_alerts_per_rule
  @client.get('/JSON/pscan/view/maxAlertsPerRule/')
end

#records_to_scanObject



21
22
23
# File 'lib/zap/v2apis/pscan.rb', line 21

def records_to_scan
  @client.get('/JSON/pscan/view/recordsToScan/')
end

#scan_only_in_scopeObject



25
26
27
# File 'lib/zap/v2apis/pscan.rb', line 25

def scan_only_in_scope
  @client.get('/JSON/pscan/view/scanOnlyInScope/')
end

#scannersObject



29
30
31
# File 'lib/zap/v2apis/pscan.rb', line 29

def scanners
  @client.get('/JSON/pscan/view/scanners/')
end

#set_enabled(enabled) ⇒ Object



61
62
63
# File 'lib/zap/v2apis/pscan.rb', line 61

def set_enabled(enabled)
  @client.get("/JSON/pscan/action/setEnabled/?enabled=#{enabled}")
end

#set_max_alerts_per_rule(max_alerts) ⇒ Object



65
66
67
# File 'lib/zap/v2apis/pscan.rb', line 65

def set_max_alerts_per_rule(max_alerts)
  @client.get("/JSON/pscan/action/setMaxAlertsPerRule/?maxAlerts=#{max_alerts}")
end

#set_scan_only_in_scope(only_in_scope) ⇒ Object



69
70
71
# File 'lib/zap/v2apis/pscan.rb', line 69

def set_scan_only_in_scope(only_in_scope)
  @client.get("/JSON/pscan/action/setScanOnlyInScope/?onlyInScope=#{only_in_scope}")
end

#set_scanner_alert_threshold(id, alert_threshold) ⇒ Object



73
74
75
# File 'lib/zap/v2apis/pscan.rb', line 73

def set_scanner_alert_threshold(id, alert_threshold)
  @client.get("/JSON/pscan/action/setScannerAlertThreshold/?id=#{id}&alertThreshold=#{alert_threshold}")
end