zaproxy 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +1 -0
- data/.rubocop.yml +213 -0
- data/README.md +36 -1
- data/Rakefile +21 -0
- data/SECURITY.md +21 -0
- data/lib/zap/result.rb +13 -0
- data/lib/zap/v2apis/_template.rb +13 -0
- data/lib/zap/v2apis/access_control.rb +25 -0
- data/lib/zap/v2apis/acsrf.rb +33 -0
- data/lib/zap/v2apis/ajax_spider.rb +153 -0
- data/lib/zap/v2apis/alert.rb +61 -0
- data/lib/zap/v2apis/alert_filter.rb +57 -0
- data/lib/zap/v2apis/ascan.rb +361 -0
- data/lib/zap/v2apis/authentication.rb +41 -0
- data/lib/zap/v2apis/authorization.rb +17 -0
- data/lib/zap/v2apis/automation.rb +21 -0
- data/lib/zap/v2apis/autoupdate.rb +133 -0
- data/lib/zap/v2apis/break.rb +57 -0
- data/lib/zap/v2apis/client.rb +25 -0
- data/lib/zap/v2apis/context.rb +93 -0
- data/lib/zap/v2apis/core.rb +389 -0
- data/lib/zap/v2apis/exim.rb +37 -0
- data/lib/zap/v2apis/forced_user.rb +25 -0
- data/lib/zap/v2apis/graphql.rb +89 -0
- data/lib/zap/v2apis/http_sessions.rb +73 -0
- data/lib/zap/v2apis/hud.rb +157 -0
- data/lib/zap/v2apis/import_urls.rb +13 -0
- data/lib/zap/v2apis/keyboard.rb +17 -0
- data/lib/zap/v2apis/local_proxies.rb +21 -0
- data/lib/zap/v2apis/network.rb +201 -0
- data/lib/zap/v2apis/openapi.rb +17 -0
- data/lib/zap/v2apis/params.rb +13 -0
- data/lib/zap/v2apis/pnh.rb +41 -0
- data/lib/zap/v2apis/postman.rb +17 -0
- data/lib/zap/v2apis/pscan.rb +77 -0
- data/lib/zap/v2apis/quickstartlaunch.rb +13 -0
- data/lib/zap/v2apis/replacer.rb +25 -0
- data/lib/zap/v2apis/reports.rb +21 -0
- data/lib/zap/v2apis/retest.rb +13 -0
- data/lib/zap/v2apis/reveal.rb +17 -0
- data/lib/zap/v2apis/revisit.rb +21 -0
- data/lib/zap/v2apis/rule_config.rb +29 -0
- data/lib/zap/v2apis/script.rb +105 -0
- data/lib/zap/v2apis/search.rb +57 -0
- data/lib/zap/v2apis/selenium.rb +93 -0
- data/lib/zap/v2apis/session_management.rb +29 -0
- data/lib/zap/v2apis/soap.rb +17 -0
- data/lib/zap/v2apis/spider.rb +293 -0
- data/lib/zap/v2apis/stats.rb +61 -0
- data/lib/zap/v2apis/users.rb +69 -0
- data/lib/zap/v2apis/wappalyzer.rb +21 -0
- data/lib/zap/v2apis/websocket.rb +33 -0
- data/lib/zap/zap.rb +77 -0
- data/lib/zap/zapv2.rb +102 -0
- data/lib/zaproxy.rb +3 -0
- data/openapi.yaml +11314 -0
- data/zaproxy.gemspec +4 -3
- metadata +60 -5
- data/lib/zap.rb +0 -8
@@ -0,0 +1,361 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Ascan
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def alerts_ids(scanid)
|
10
|
+
@client.get("/JSON/ascan/view/alertsIds/?scanId=#{scanid}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def attack_mode_queue
|
14
|
+
@client.get('/JSON/ascan/view/attackModeQueue/')
|
15
|
+
end
|
16
|
+
|
17
|
+
def excluded_from_scan
|
18
|
+
@client.get('/JSON/ascan/view/excludedFromScan/')
|
19
|
+
end
|
20
|
+
|
21
|
+
def excluded_param_types
|
22
|
+
@client.get('/JSON/ascan/view/excludedParamTypes/')
|
23
|
+
end
|
24
|
+
|
25
|
+
def excluded_params
|
26
|
+
@client.get('/JSON/ascan/view/excludedParams/')
|
27
|
+
end
|
28
|
+
|
29
|
+
def messages_ids(scanid)
|
30
|
+
@client.get("/JSON/ascan/view/messagesIds/?scanId=#{scanid}")
|
31
|
+
end
|
32
|
+
|
33
|
+
def option_add_query_param
|
34
|
+
@client.get('/JSON/ascan/view/optionAddQueryParam/')
|
35
|
+
end
|
36
|
+
|
37
|
+
def option_allow_attack_on_start
|
38
|
+
@client.get('/JSON/ascan/view/optionAllowAttackOnStart/')
|
39
|
+
end
|
40
|
+
|
41
|
+
def option_attack_policy
|
42
|
+
@client.get('/JSON/ascan/view/optionAttackPolicy/')
|
43
|
+
end
|
44
|
+
|
45
|
+
def option_default_policy
|
46
|
+
@client.get('/JSON/ascan/view/optionDefaultPolicy/')
|
47
|
+
end
|
48
|
+
|
49
|
+
def option_delay_in_ms
|
50
|
+
@client.get('/JSON/ascan/view/optionDelayInMs/')
|
51
|
+
end
|
52
|
+
|
53
|
+
def option_excluded_param_list
|
54
|
+
@client.get('/JSON/ascan/view/optionExcludedParamList/')
|
55
|
+
end
|
56
|
+
|
57
|
+
def option_handle_anti_csrf_tokens
|
58
|
+
@client.get('/JSON/ascan/view/optionHandleAntiCSRFTokens/')
|
59
|
+
end
|
60
|
+
|
61
|
+
def option_host_per_scan
|
62
|
+
@client.get('/JSON/ascan/view/optionHostPerScan/')
|
63
|
+
end
|
64
|
+
|
65
|
+
def option_inject_plugin_id_in_header
|
66
|
+
@client.get('/JSON/ascan/view/optionInjectPluginIdInHeader/')
|
67
|
+
end
|
68
|
+
|
69
|
+
def option_max_alerts_per_rule
|
70
|
+
@client.get('/JSON/ascan/view/optionMaxAlertsPerRule/')
|
71
|
+
end
|
72
|
+
|
73
|
+
def option_max_chart_time_in_mins
|
74
|
+
@client.get('/JSON/ascan/view/optionMaxChartTimeInMins/')
|
75
|
+
end
|
76
|
+
|
77
|
+
def option_max_results_to_list
|
78
|
+
@client.get('/JSON/ascan/view/optionMaxResultsToList/')
|
79
|
+
end
|
80
|
+
|
81
|
+
def option_max_rule_duration_in_mins
|
82
|
+
@client.get('/JSON/ascan/view/optionMaxRuleDurationInMins/')
|
83
|
+
end
|
84
|
+
|
85
|
+
def option_max_scan_duration_in_mins
|
86
|
+
@client.get('/JSON/ascan/view/optionMaxScanDurationInMins/')
|
87
|
+
end
|
88
|
+
|
89
|
+
def option_max_scans_in_ui
|
90
|
+
@client.get('/JSON/ascan/view/optionMaxScansInUI/')
|
91
|
+
end
|
92
|
+
|
93
|
+
def option_prompt_in_attack_mode
|
94
|
+
@client.get('/JSON/ascan/view/optionPromptInAttackMode/')
|
95
|
+
end
|
96
|
+
|
97
|
+
def option_prompt_to_clear_finished_scans
|
98
|
+
@client.get('/JSON/ascan/view/optionPromptToClearFinishedScans/')
|
99
|
+
end
|
100
|
+
|
101
|
+
def option_rescan_in_attack_mode
|
102
|
+
@client.get('/JSON/ascan/view/optionRescanInAttackMode/')
|
103
|
+
end
|
104
|
+
|
105
|
+
def option_scan_headers_all_requests
|
106
|
+
@client.get('/JSON/ascan/view/optionScanHeadersAllRequests/')
|
107
|
+
end
|
108
|
+
|
109
|
+
def option_scan_null_json_values
|
110
|
+
@client.get('/JSON/ascan/view/optionScanNullJsonValues/')
|
111
|
+
end
|
112
|
+
|
113
|
+
def option_show_advanced_dialog
|
114
|
+
@client.get('/JSON/ascan/view/optionShowAdvancedDialog/')
|
115
|
+
end
|
116
|
+
|
117
|
+
def option_target_params_enabled_rpc
|
118
|
+
@client.get('/JSON/ascan/view/optionTargetParamsEnabledRPC/')
|
119
|
+
end
|
120
|
+
|
121
|
+
def option_target_params_injectable
|
122
|
+
@client.get('/JSON/ascan/view/optionTargetParamsInjectable/')
|
123
|
+
end
|
124
|
+
|
125
|
+
def option_thread_per_host
|
126
|
+
@client.get('/JSON/ascan/view/optionThreadPerHost/')
|
127
|
+
end
|
128
|
+
|
129
|
+
def policies(scanpolicyname = '', policyid = '')
|
130
|
+
@client.get("/JSON/ascan/view/policies/?scanPolicyName=#{scanpolicyname}&policyId=#{policyid}")
|
131
|
+
end
|
132
|
+
|
133
|
+
def scan_policy_names
|
134
|
+
@client.get('/JSON/ascan/view/scanPolicyNames/')
|
135
|
+
end
|
136
|
+
|
137
|
+
def scan_progress(scanid)
|
138
|
+
@client.get("/JSON/ascan/view/scanProgress/?scanId=#{scanid}")
|
139
|
+
end
|
140
|
+
|
141
|
+
def scanners(scanpolicyname = '', policyid = '')
|
142
|
+
@client.get("/JSON/ascan/view/scanners/?scanPolicyName=#{scanpolicyname}&policyId=#{policyid}")
|
143
|
+
end
|
144
|
+
|
145
|
+
def scans
|
146
|
+
@client.get('/JSON/ascan/view/scans/')
|
147
|
+
end
|
148
|
+
|
149
|
+
def status(scanid)
|
150
|
+
@client.get("/JSON/ascan/view/status/?scanId=#{scanid}")
|
151
|
+
end
|
152
|
+
|
153
|
+
def add_excluded_param(name, type, url)
|
154
|
+
@client.get("/JSON/ascan/action/addExcludedParam/?name=#{name}&type=#{type}&url=#{url}")
|
155
|
+
end
|
156
|
+
|
157
|
+
def add_scan_policy(scanpolicyname, alertthreshold, attackstrength)
|
158
|
+
@client.get("/JSON/ascan/action/addScanPolicy/?scanPolicyName=#{scanpolicyname}&alertThreshold=#{alertthreshold}&attackStrength=#{attackstrength}")
|
159
|
+
end
|
160
|
+
|
161
|
+
def clear_excluded_from_scan
|
162
|
+
@client.get('/JSON/ascan/action/clearExcludedFromScan/')
|
163
|
+
end
|
164
|
+
|
165
|
+
def disable_all_scanners(scanpolicyname = '')
|
166
|
+
@client.get("/JSON/ascan/action/disableAllScanners/?scanPolicyName=#{scanpolicyname}")
|
167
|
+
end
|
168
|
+
|
169
|
+
def disable_scanners(ids, scanpolicyname = '')
|
170
|
+
@client.get("/JSON/ascan/action/disableScanners/?ids=#{ids}&scanPolicyName=#{scanpolicyname}")
|
171
|
+
end
|
172
|
+
|
173
|
+
def enable_all_scanners(scanpolicyname = '')
|
174
|
+
@client.get("/JSON/ascan/action/enableAllScanners/?scanPolicyName=#{scanpolicyname}")
|
175
|
+
end
|
176
|
+
|
177
|
+
def enable_scanners(ids, scanpolicyname = '')
|
178
|
+
@client.get("/JSON/ascan/action/enableScanners/?ids=#{ids}&scanPolicyName=#{scanpolicyname}")
|
179
|
+
end
|
180
|
+
|
181
|
+
def exclude_from_scan(regex)
|
182
|
+
@client.get("/JSON/ascan/action/excludeFromScan/?regex=#{regex}")
|
183
|
+
end
|
184
|
+
|
185
|
+
def import_scan_policy(path)
|
186
|
+
@client.get("/JSON/ascan/action/importScanPolicy/?path=#{path}")
|
187
|
+
end
|
188
|
+
|
189
|
+
def modify_excluded_param(idx, name, type, url)
|
190
|
+
@client.get("/JSON/ascan/action/modifyExcludedParam/?idx=#{idx}&name=#{name}&type=#{type}&url=#{url}")
|
191
|
+
end
|
192
|
+
|
193
|
+
def pause(scanid)
|
194
|
+
@client.get("/JSON/ascan/action/pause/?scanId=#{scanid}")
|
195
|
+
end
|
196
|
+
|
197
|
+
def pause_all_scans
|
198
|
+
@client.get('/JSON/ascan/action/pauseAllScans/')
|
199
|
+
end
|
200
|
+
|
201
|
+
def remove_all_scans
|
202
|
+
@client.get('/JSON/ascan/action/removeAllScans/')
|
203
|
+
end
|
204
|
+
|
205
|
+
def remove_excluded_param(idx)
|
206
|
+
@client.get("/JSON/ascan/action/removeExcludedParam/?idx=#{idx}")
|
207
|
+
end
|
208
|
+
|
209
|
+
def remove_scan(scanid)
|
210
|
+
@client.get("/JSON/ascan/action/removeScan/?scanId=#{scanid}")
|
211
|
+
end
|
212
|
+
|
213
|
+
def remove_scan_policy(scanpolicyname)
|
214
|
+
@client.get("/JSON/ascan/action/removeScanPolicy/?scanPolicyName=#{scanpolicyname}")
|
215
|
+
end
|
216
|
+
|
217
|
+
def resume(scanid)
|
218
|
+
@client.get("/JSON/ascan/action/resume/?scanId=#{scanid}")
|
219
|
+
end
|
220
|
+
|
221
|
+
def resume_all_scans
|
222
|
+
@client.get('/JSON/ascan/action/resumeAllScans/')
|
223
|
+
end
|
224
|
+
|
225
|
+
def scan(url, recurse = '', inscopeonly = '', scanpolicyname = '', method = '', postdata = '', contextid = '')
|
226
|
+
@client.get("/JSON/ascan/action/scan/?url=#{url}&recurse=#{recurse}&inScopeOnly=#{inscopeonly}&scanPolicyName=#{scanpolicyname}&method=#{method}&postData=#{postdata}&contextId=#{contextid}")
|
227
|
+
end
|
228
|
+
|
229
|
+
def scan_as_user(url, contextid, userid, recurse = '', scanpolicyname = '', method = '', postdata = '')
|
230
|
+
@client.get("/JSON/ascan/action/scanAsUser/?url=#{url}&contextId=#{contextid}&userId=#{userid}&recurse=#{recurse}&scanPolicyName=#{scanpolicyname}&method=#{method}&postData=#{postdata}")
|
231
|
+
end
|
232
|
+
|
233
|
+
def set_enabled_policies(ids, scanpolicyname = '')
|
234
|
+
@client.get("/JSON/ascan/action/setEnabledPolicies/?ids=#{ids}&scanPolicyName=#{scanpolicyname}")
|
235
|
+
end
|
236
|
+
|
237
|
+
def set_option_add_query_param(boolean)
|
238
|
+
@client.get("/JSON/ascan/action/setOptionAddQueryParam/?Boolean=#{boolean}")
|
239
|
+
end
|
240
|
+
|
241
|
+
def set_option_allow_attack_on_start(boolean)
|
242
|
+
@client.get("/JSON/ascan/action/setOptionAllowAttackOnStart/?Boolean=#{boolean}")
|
243
|
+
end
|
244
|
+
|
245
|
+
def set_option_attack_policy(string)
|
246
|
+
@client.get("/JSON/ascan/action/setOptionAttackPolicy/?String=#{string}")
|
247
|
+
end
|
248
|
+
|
249
|
+
def set_option_default_policy(string)
|
250
|
+
@client.get("/JSON/ascan/action/setOptionDefaultPolicy/?String=#{string}")
|
251
|
+
end
|
252
|
+
|
253
|
+
def set_option_delay_in_ms(integer)
|
254
|
+
@client.get("/JSON/ascan/action/setOptionDelayInMs/?Integer=#{integer}")
|
255
|
+
end
|
256
|
+
|
257
|
+
def set_option_handle_anti_csrf_tokens(boolean)
|
258
|
+
@client.get("/JSON/ascan/action/setOptionHandleAntiCSRFTokens/?Boolean=#{boolean}")
|
259
|
+
end
|
260
|
+
|
261
|
+
def set_option_host_per_scan(integer)
|
262
|
+
@client.get("/JSON/ascan/action/setOptionHostPerScan/?Integer=#{integer}")
|
263
|
+
end
|
264
|
+
|
265
|
+
def set_option_inject_plugin_id_in_header(boolean)
|
266
|
+
@client.get("/JSON/ascan/action/setOptionInjectPluginIdInHeader/?Boolean=#{boolean}")
|
267
|
+
end
|
268
|
+
|
269
|
+
def set_option_max_alerts_per_rule(integer)
|
270
|
+
@client.get("/JSON/ascan/action/setOptionMaxAlertsPerRule/?Integer=#{integer}")
|
271
|
+
end
|
272
|
+
|
273
|
+
def set_option_max_chart_time_in_mins(integer)
|
274
|
+
@client.get("/JSON/ascan/action/setOptionMaxChartTimeInMins/?Integer=#{integer}")
|
275
|
+
end
|
276
|
+
|
277
|
+
def set_option_max_results_to_list(integer)
|
278
|
+
@client.get("/JSON/ascan/action/setOptionMaxResultsToList/?Integer=#{integer}")
|
279
|
+
end
|
280
|
+
|
281
|
+
def set_option_max_rule_duration_in_mins(integer)
|
282
|
+
@client.get("/JSON/ascan/action/setOptionMaxRuleDurationInMins/?Integer=#{integer}")
|
283
|
+
end
|
284
|
+
|
285
|
+
def set_option_max_scan_duration_in_mins(integer)
|
286
|
+
@client.get("/JSON/ascan/action/setOptionMaxScanDurationInMins/?Integer=#{integer}")
|
287
|
+
end
|
288
|
+
|
289
|
+
def set_option_max_scans_in_ui(integer)
|
290
|
+
@client.get("/JSON/ascan/action/setOptionMaxScansInUI/?Integer=#{integer}")
|
291
|
+
end
|
292
|
+
|
293
|
+
def set_option_prompt_in_attack_mode(boolean)
|
294
|
+
@client.get("/JSON/ascan/action/setOptionPromptInAttackMode/?Boolean=#{boolean}")
|
295
|
+
end
|
296
|
+
|
297
|
+
def set_option_prompt_to_clear_finished_scans(boolean)
|
298
|
+
@client.get("/JSON/ascan/action/setOptionPromptToClearFinishedScans/?Boolean=#{boolean}")
|
299
|
+
end
|
300
|
+
|
301
|
+
def set_option_rescan_in_attack_mode(boolean)
|
302
|
+
@client.get("/JSON/ascan/action/setOptionRescanInAttackMode/?Boolean=#{boolean}")
|
303
|
+
end
|
304
|
+
|
305
|
+
def set_option_scan_headers_all_requests(boolean)
|
306
|
+
@client.get("/JSON/ascan/action/setOptionScanHeadersAllRequests/?Boolean=#{boolean}")
|
307
|
+
end
|
308
|
+
|
309
|
+
def set_option_scan_null_json_values(boolean)
|
310
|
+
@client.get("/JSON/ascan/action/setOptionScanNullJsonValues/?Boolean=#{boolean}")
|
311
|
+
end
|
312
|
+
|
313
|
+
def set_option_show_advanced_dialog(boolean)
|
314
|
+
@client.get("/JSON/ascan/action/setOptionShowAdvancedDialog/?Boolean=#{boolean}")
|
315
|
+
end
|
316
|
+
|
317
|
+
def set_option_target_params_enabled_rpc(integer)
|
318
|
+
@client.get("/JSON/ascan/action/setOptionTargetParamsEnabledRPC/?Integer=#{integer}")
|
319
|
+
end
|
320
|
+
|
321
|
+
def set_option_target_params_injectable(integer)
|
322
|
+
@client.get("/JSON/ascan/action/setOptionTargetParamsInjectable/?Integer=#{integer}")
|
323
|
+
end
|
324
|
+
|
325
|
+
def set_option_thread_per_host(integer)
|
326
|
+
@client.get("/JSON/ascan/action/setOptionThreadPerHost/?Integer=#{integer}")
|
327
|
+
end
|
328
|
+
|
329
|
+
def set_policy_alert_threshold(id, alertthreshold, scanpolicyname = '')
|
330
|
+
@client.get("/JSON/ascan/action/setPolicyAlertThreshold/?id=#{id}&alertThreshold=#{alertthreshold}&scanPolicyName=#{scanpolicyname}")
|
331
|
+
end
|
332
|
+
|
333
|
+
def set_policy_attack_strength(id, attackstrength, scanpolicyname = '')
|
334
|
+
@client.get("/JSON/ascan/action/setPolicyAttackStrength/?id=#{id}&attackStrength=#{attackstrength}&scanPolicyName=#{scanpolicyname}")
|
335
|
+
end
|
336
|
+
|
337
|
+
def set_scanner_alert_threshold(id, alertthreshold, scanpolicyname = '')
|
338
|
+
@client.get("/JSON/ascan/action/setScannerAlertThreshold/?id=#{id}&alertThreshold=#{alertthreshold}&scanPolicyName=#{scanpolicyname}")
|
339
|
+
end
|
340
|
+
|
341
|
+
def set_scanner_attack_strength(id, attackstrength, scanpolicyname = '')
|
342
|
+
@client.get("/JSON/ascan/action/setScannerAttackStrength/?id=#{id}&attackStrength=#{attackstrength}&scanPolicyName=#{scanpolicyname}")
|
343
|
+
end
|
344
|
+
|
345
|
+
def skip_scanner(scanid, scannerid)
|
346
|
+
@client.get("/JSON/ascan/action/skipScanner/?scanId=#{scanid}&scannerId=#{scannerid}")
|
347
|
+
end
|
348
|
+
|
349
|
+
def stop(scanid)
|
350
|
+
@client.get("/JSON/ascan/action/stop/?scanId=#{scanid}")
|
351
|
+
end
|
352
|
+
|
353
|
+
def stop_all_scans
|
354
|
+
@client.get('/JSON/ascan/action/stopAllScans/')
|
355
|
+
end
|
356
|
+
|
357
|
+
def update_scan_policy(scanpolicyname, alertthreshold, attackstrength)
|
358
|
+
@client.get("/JSON/ascan/action/updateScanPolicy/?scanPolicyName=#{scanpolicyname}&alertThreshold=#{alertthreshold}&attackStrength=#{attackstrength}")
|
359
|
+
end
|
360
|
+
end
|
361
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Authentication
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_authentication_method(contextid)
|
10
|
+
@client.get("/JSON/authentication/view/getAuthenticationMethod/?contextId=#{contextid}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def get_authentication_method_config_params(authmethodname)
|
14
|
+
@client.get("/JSON/authentication/view/getAuthenticationMethodConfigParams/?authMethodName=#{authmethodname}")
|
15
|
+
end
|
16
|
+
|
17
|
+
def get_logged_in_indicator(contextid)
|
18
|
+
@client.get("/JSON/authentication/view/getLoggedInIndicator/?contextId=#{contextid}")
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_logged_out_indicator(contextid)
|
22
|
+
@client.get("/JSON/authentication/view/getLoggedOutIndicator/?contextId=#{contextid}")
|
23
|
+
end
|
24
|
+
|
25
|
+
def get_supported_authentication_methods
|
26
|
+
@client.get('/JSON/authentication/view/getSupportedAuthenticationMethods/')
|
27
|
+
end
|
28
|
+
|
29
|
+
def set_authentication_method(contextid, authmethodname, authmethodconfigparams = '')
|
30
|
+
@client.get("/JSON/authentication/action/setAuthenticationMethod/?contextId=#{contextid}&authMethodName=#{authmethodname}&authMethodConfigParams=#{authmethodconfigparams}")
|
31
|
+
end
|
32
|
+
|
33
|
+
def set_logged_in_indicator(contextid, loggedinindicatorregex)
|
34
|
+
@client.get("/JSON/authentication/action/setLoggedInIndicator/?contextId=#{contextid}&loggedInIndicatorRegex=#{loggedinindicatorregex}")
|
35
|
+
end
|
36
|
+
|
37
|
+
def set_logged_out_indicator(contextid, loggedoutindicatorregex)
|
38
|
+
@client.get("/JSON/authentication/action/setLoggedOutIndicator/?contextId=#{contextid}&loggedOutIndicatorRegex=#{loggedoutindicatorregex}")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Authorization
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def get_authorization_detection_method(contextid)
|
10
|
+
@client.get('/JSON/authorization/view/getAuthorizationDetectionMethod/', contextid: contextid)
|
11
|
+
end
|
12
|
+
|
13
|
+
def set_basic_authorization_detection_method(contextid, headerregex, bodyregex, statuscode, logicaloperator)
|
14
|
+
@client.get('/JSON/authorization/action/setBasicAuthorizationDetectionMethod/', contextid: contextid, headerRegex: headerregex, bodyRegex: bodyregex, statusCode: statuscode, logicalOperator: logicaloperator)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Automation
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def plan_progress(planid)
|
10
|
+
@client.get("/JSON/automation/view/planProgress/?planId=#{planid}")
|
11
|
+
end
|
12
|
+
|
13
|
+
def end_delay_job
|
14
|
+
@client.get('/JSON/automation/action/endDelayJob/')
|
15
|
+
end
|
16
|
+
|
17
|
+
def run_plan(filepath)
|
18
|
+
@client.get("/JSON/automation/action/runPlan/?filePath=#{filepath}")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,133 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Autoupdate
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def installed_addons
|
10
|
+
@client.get('/JSON/autoupdate/view/installedAddons/')
|
11
|
+
end
|
12
|
+
|
13
|
+
def is_latest_version
|
14
|
+
@client.get('/JSON/autoupdate/view/isLatestVersion/')
|
15
|
+
end
|
16
|
+
|
17
|
+
def latest_version_number
|
18
|
+
@client.get('/JSON/autoupdate/view/latestVersionNumber/')
|
19
|
+
end
|
20
|
+
|
21
|
+
def local_addons
|
22
|
+
@client.get('/JSON/autoupdate/view/localAddons/')
|
23
|
+
end
|
24
|
+
|
25
|
+
def marketplace_addons
|
26
|
+
@client.get('/JSON/autoupdate/view/marketplaceAddons/')
|
27
|
+
end
|
28
|
+
|
29
|
+
def new_addons
|
30
|
+
@client.get('/JSON/autoupdate/view/newAddons/')
|
31
|
+
end
|
32
|
+
|
33
|
+
def option_addon_directories
|
34
|
+
@client.get('/JSON/autoupdate/view/optionAddonDirectories/')
|
35
|
+
end
|
36
|
+
|
37
|
+
def option_check_addon_updates
|
38
|
+
@client.get('/JSON/autoupdate/view/optionCheckAddonUpdates/')
|
39
|
+
end
|
40
|
+
|
41
|
+
def option_check_on_start
|
42
|
+
@client.get('/JSON/autoupdate/view/optionCheckOnStart/')
|
43
|
+
end
|
44
|
+
|
45
|
+
def option_day_last_checked
|
46
|
+
@client.get('/JSON/autoupdate/view/optionDayLastChecked/')
|
47
|
+
end
|
48
|
+
|
49
|
+
def option_day_last_install_warned
|
50
|
+
@client.get('/JSON/autoupdate/view/optionDayLastInstallWarned/')
|
51
|
+
end
|
52
|
+
|
53
|
+
def option_day_last_update_warned
|
54
|
+
@client.get('/JSON/autoupdate/view/optionDayLastUpdateWarned/')
|
55
|
+
end
|
56
|
+
|
57
|
+
def option_download_directory
|
58
|
+
@client.get('/JSON/autoupdate/view/optionDownloadDirectory/')
|
59
|
+
end
|
60
|
+
|
61
|
+
def option_download_new_release
|
62
|
+
@client.get('/JSON/autoupdate/view/optionDownloadNewRelease/')
|
63
|
+
end
|
64
|
+
|
65
|
+
def option_install_addon_updates
|
66
|
+
@client.get('/JSON/autoupdate/view/optionInstallAddonUpdates/')
|
67
|
+
end
|
68
|
+
|
69
|
+
def option_install_scanner_rules
|
70
|
+
@client.get('/JSON/autoupdate/view/optionInstallScannerRules/')
|
71
|
+
end
|
72
|
+
|
73
|
+
def option_report_alpha_addons
|
74
|
+
@client.get('/JSON/autoupdate/view/optionReportAlphaAddons/')
|
75
|
+
end
|
76
|
+
|
77
|
+
def option_report_beta_addons
|
78
|
+
@client.get('/JSON/autoupdate/view/optionReportBetaAddons/')
|
79
|
+
end
|
80
|
+
|
81
|
+
def option_report_release_addons
|
82
|
+
@client.get('/JSON/autoupdate/view/optionReportReleaseAddons/')
|
83
|
+
end
|
84
|
+
|
85
|
+
def updated_addons
|
86
|
+
@client.get('/JSON/autoupdate/view/updatedAddons/')
|
87
|
+
end
|
88
|
+
|
89
|
+
def download_latest_release
|
90
|
+
@client.get('/JSON/autoupdate/action/downloadLatestRelease/')
|
91
|
+
end
|
92
|
+
|
93
|
+
def install_addon(id)
|
94
|
+
@client.get("/JSON/autoupdate/action/installAddon/?id=#{id}")
|
95
|
+
end
|
96
|
+
|
97
|
+
def set_option_check_addon_updates(boolean)
|
98
|
+
@client.get("/JSON/autoupdate/action/setOptionCheckAddonUpdates/?Boolean=#{boolean}")
|
99
|
+
end
|
100
|
+
|
101
|
+
def set_option_check_on_start(boolean)
|
102
|
+
@client.get("/JSON/autoupdate/action/setOptionCheckOnStart/?Boolean=#{boolean}")
|
103
|
+
end
|
104
|
+
|
105
|
+
def set_option_download_new_release(boolean)
|
106
|
+
@client.get("/JSON/autoupdate/action/setOptionDownloadNewRelease/?Boolean=#{boolean}")
|
107
|
+
end
|
108
|
+
|
109
|
+
def set_option_install_addon_updates(boolean)
|
110
|
+
@client.get("/JSON/autoupdate/action/setOptionInstallAddonUpdates/?Boolean=#{boolean}")
|
111
|
+
end
|
112
|
+
|
113
|
+
def set_option_install_scanner_rules(boolean)
|
114
|
+
@client.get("/JSON/autoupdate/action/setOptionInstallScannerRules/?Boolean=#{boolean}")
|
115
|
+
end
|
116
|
+
|
117
|
+
def set_option_report_alpha_addons(boolean)
|
118
|
+
@client.get("/JSON/autoupdate/action/setOptionReportAlphaAddons/?Boolean=#{boolean}")
|
119
|
+
end
|
120
|
+
|
121
|
+
def set_option_report_beta_addons(boolean)
|
122
|
+
@client.get("/JSON/autoupdate/action/setOptionReportBetaAddons/?Boolean=#{boolean}")
|
123
|
+
end
|
124
|
+
|
125
|
+
def set_option_report_release_addons(boolean)
|
126
|
+
@client.get("/JSON/autoupdate/action/setOptionReportReleaseAddons/?Boolean=#{boolean}")
|
127
|
+
end
|
128
|
+
|
129
|
+
def uninstall_addon(id)
|
130
|
+
@client.get("/JSON/autoupdate/action/uninstallAddon/?id=#{id}")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Break
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def http_message
|
10
|
+
@client.get('/JSON/break/view/httpMessage/')
|
11
|
+
end
|
12
|
+
|
13
|
+
def is_break_all
|
14
|
+
@client.get('/JSON/break/view/isBreakAll/')
|
15
|
+
end
|
16
|
+
|
17
|
+
def is_break_request
|
18
|
+
@client.get('/JSON/break/view/isBreakRequest/')
|
19
|
+
end
|
20
|
+
|
21
|
+
def is_break_response
|
22
|
+
@client.get('/JSON/break/view/isBreakResponse/')
|
23
|
+
end
|
24
|
+
|
25
|
+
def add_http_breakpoint(string, location, match, inverse, ignorecase)
|
26
|
+
@client.get("/JSON/break/action/addHttpBreakpoint/?string=#{string}&location=#{location}&match=#{match}&inverse=#{inverse}&ignorecase=#{ignorecase}")
|
27
|
+
end
|
28
|
+
|
29
|
+
def break(type, state, scope)
|
30
|
+
@client.get("/JSON/break/action/break/?type=#{type}&state=#{state}&scope=#{scope}")
|
31
|
+
end
|
32
|
+
|
33
|
+
def continue
|
34
|
+
@client.get('/JSON/break/action/continue/')
|
35
|
+
end
|
36
|
+
|
37
|
+
def drop
|
38
|
+
@client.get('/JSON/break/action/drop/')
|
39
|
+
end
|
40
|
+
|
41
|
+
def remove_http_breakpoint(string, location, match, inverse, ignorecase)
|
42
|
+
@client.get("/JSON/break/action/removeHttpBreakpoint/?string=#{string}&location=#{location}&match=#{match}&inverse=#{inverse}&ignorecase=#{ignorecase}")
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_http_message(httpheader, httpbody)
|
46
|
+
@client.get("/JSON/break/action/setHttpMessage/?httpHeader=#{httpheader}&httpBody=#{httpbody}")
|
47
|
+
end
|
48
|
+
|
49
|
+
def step
|
50
|
+
@client.get('/JSON/break/action/step/')
|
51
|
+
end
|
52
|
+
|
53
|
+
def wait_for_http_break(poll, keepalive)
|
54
|
+
@client.get("/JSON/break/pconn/waitForHttpBreak/?poll=#{poll}&keepAlive=#{keepalive}")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class ZAPv2 < ZAP
|
4
|
+
class Client
|
5
|
+
def initialize(client)
|
6
|
+
@client = client
|
7
|
+
end
|
8
|
+
|
9
|
+
def report_event(event_json)
|
10
|
+
@client.get('/json/client/action/reportEvent/', event_json)
|
11
|
+
end
|
12
|
+
|
13
|
+
def report_object(object_json)
|
14
|
+
@client.get('/json/client/action/reportObject/', object_json)
|
15
|
+
end
|
16
|
+
|
17
|
+
def report_zest_script(script_json)
|
18
|
+
@client.get('/json/client/action/reportZestScript/', script_json)
|
19
|
+
end
|
20
|
+
|
21
|
+
def report_zest_statement(statement_json)
|
22
|
+
@client.get('/json/client/action/reportZestStatement/', statement_json)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|