1# coding: utf-8
2# Copyright (c) 2016, 2021, Oracle and/or its affiliates.  All rights reserved.
3# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
4
5
6from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
7from oci.decorators import init_model_state_from_kwargs
8
9
10@init_model_state_from_kwargs
11class WafConfigDetails(object):
12    """
13    The Web Application Firewall configuration for the WAAS policy creation.
14    """
15
16    def __init__(self, **kwargs):
17        """
18        Initializes a new WafConfigDetails object with values from keyword arguments.
19        The following keyword arguments are supported (corresponding to the getters/setters of this class):
20
21        :param access_rules:
22            The value to assign to the access_rules property of this WafConfigDetails.
23        :type access_rules: list[oci.waas.models.AccessRule]
24
25        :param address_rate_limiting:
26            The value to assign to the address_rate_limiting property of this WafConfigDetails.
27        :type address_rate_limiting: oci.waas.models.AddressRateLimiting
28
29        :param captchas:
30            The value to assign to the captchas property of this WafConfigDetails.
31        :type captchas: list[oci.waas.models.Captcha]
32
33        :param device_fingerprint_challenge:
34            The value to assign to the device_fingerprint_challenge property of this WafConfigDetails.
35        :type device_fingerprint_challenge: oci.waas.models.DeviceFingerprintChallenge
36
37        :param human_interaction_challenge:
38            The value to assign to the human_interaction_challenge property of this WafConfigDetails.
39        :type human_interaction_challenge: oci.waas.models.HumanInteractionChallenge
40
41        :param js_challenge:
42            The value to assign to the js_challenge property of this WafConfigDetails.
43        :type js_challenge: oci.waas.models.JsChallenge
44
45        :param origin:
46            The value to assign to the origin property of this WafConfigDetails.
47        :type origin: str
48
49        :param caching_rules:
50            The value to assign to the caching_rules property of this WafConfigDetails.
51        :type caching_rules: list[oci.waas.models.CachingRule]
52
53        :param custom_protection_rules:
54            The value to assign to the custom_protection_rules property of this WafConfigDetails.
55        :type custom_protection_rules: list[oci.waas.models.CustomProtectionRuleSetting]
56
57        :param origin_groups:
58            The value to assign to the origin_groups property of this WafConfigDetails.
59        :type origin_groups: list[str]
60
61        :param protection_settings:
62            The value to assign to the protection_settings property of this WafConfigDetails.
63        :type protection_settings: oci.waas.models.ProtectionSettings
64
65        :param whitelists:
66            The value to assign to the whitelists property of this WafConfigDetails.
67        :type whitelists: list[oci.waas.models.Whitelist]
68
69        """
70        self.swagger_types = {
71            'access_rules': 'list[AccessRule]',
72            'address_rate_limiting': 'AddressRateLimiting',
73            'captchas': 'list[Captcha]',
74            'device_fingerprint_challenge': 'DeviceFingerprintChallenge',
75            'human_interaction_challenge': 'HumanInteractionChallenge',
76            'js_challenge': 'JsChallenge',
77            'origin': 'str',
78            'caching_rules': 'list[CachingRule]',
79            'custom_protection_rules': 'list[CustomProtectionRuleSetting]',
80            'origin_groups': 'list[str]',
81            'protection_settings': 'ProtectionSettings',
82            'whitelists': 'list[Whitelist]'
83        }
84
85        self.attribute_map = {
86            'access_rules': 'accessRules',
87            'address_rate_limiting': 'addressRateLimiting',
88            'captchas': 'captchas',
89            'device_fingerprint_challenge': 'deviceFingerprintChallenge',
90            'human_interaction_challenge': 'humanInteractionChallenge',
91            'js_challenge': 'jsChallenge',
92            'origin': 'origin',
93            'caching_rules': 'cachingRules',
94            'custom_protection_rules': 'customProtectionRules',
95            'origin_groups': 'originGroups',
96            'protection_settings': 'protectionSettings',
97            'whitelists': 'whitelists'
98        }
99
100        self._access_rules = None
101        self._address_rate_limiting = None
102        self._captchas = None
103        self._device_fingerprint_challenge = None
104        self._human_interaction_challenge = None
105        self._js_challenge = None
106        self._origin = None
107        self._caching_rules = None
108        self._custom_protection_rules = None
109        self._origin_groups = None
110        self._protection_settings = None
111        self._whitelists = None
112
113    @property
114    def access_rules(self):
115        """
116        Gets the access_rules of this WafConfigDetails.
117        The access rules applied to the Web Application Firewall. Access rules allow custom content access policies to be defined and `ALLOW`, `DETECT`, or `BLOCK` actions to be taken on a request when specified criteria are met.
118
119
120        :return: The access_rules of this WafConfigDetails.
121        :rtype: list[oci.waas.models.AccessRule]
122        """
123        return self._access_rules
124
125    @access_rules.setter
126    def access_rules(self, access_rules):
127        """
128        Sets the access_rules of this WafConfigDetails.
129        The access rules applied to the Web Application Firewall. Access rules allow custom content access policies to be defined and `ALLOW`, `DETECT`, or `BLOCK` actions to be taken on a request when specified criteria are met.
130
131
132        :param access_rules: The access_rules of this WafConfigDetails.
133        :type: list[oci.waas.models.AccessRule]
134        """
135        self._access_rules = access_rules
136
137    @property
138    def address_rate_limiting(self):
139        """
140        Gets the address_rate_limiting of this WafConfigDetails.
141        The settings used to limit the number of requests from an IP address.
142
143
144        :return: The address_rate_limiting of this WafConfigDetails.
145        :rtype: oci.waas.models.AddressRateLimiting
146        """
147        return self._address_rate_limiting
148
149    @address_rate_limiting.setter
150    def address_rate_limiting(self, address_rate_limiting):
151        """
152        Sets the address_rate_limiting of this WafConfigDetails.
153        The settings used to limit the number of requests from an IP address.
154
155
156        :param address_rate_limiting: The address_rate_limiting of this WafConfigDetails.
157        :type: oci.waas.models.AddressRateLimiting
158        """
159        self._address_rate_limiting = address_rate_limiting
160
161    @property
162    def captchas(self):
163        """
164        Gets the captchas of this WafConfigDetails.
165        A list of CAPTCHA challenge settings. CAPTCHAs challenge requests to ensure a human is attempting to reach the specified URL and not a bot.
166
167
168        :return: The captchas of this WafConfigDetails.
169        :rtype: list[oci.waas.models.Captcha]
170        """
171        return self._captchas
172
173    @captchas.setter
174    def captchas(self, captchas):
175        """
176        Sets the captchas of this WafConfigDetails.
177        A list of CAPTCHA challenge settings. CAPTCHAs challenge requests to ensure a human is attempting to reach the specified URL and not a bot.
178
179
180        :param captchas: The captchas of this WafConfigDetails.
181        :type: list[oci.waas.models.Captcha]
182        """
183        self._captchas = captchas
184
185    @property
186    def device_fingerprint_challenge(self):
187        """
188        Gets the device_fingerprint_challenge of this WafConfigDetails.
189        The device fingerprint challenge settings. Blocks bots based on unique device fingerprint information.
190
191
192        :return: The device_fingerprint_challenge of this WafConfigDetails.
193        :rtype: oci.waas.models.DeviceFingerprintChallenge
194        """
195        return self._device_fingerprint_challenge
196
197    @device_fingerprint_challenge.setter
198    def device_fingerprint_challenge(self, device_fingerprint_challenge):
199        """
200        Sets the device_fingerprint_challenge of this WafConfigDetails.
201        The device fingerprint challenge settings. Blocks bots based on unique device fingerprint information.
202
203
204        :param device_fingerprint_challenge: The device_fingerprint_challenge of this WafConfigDetails.
205        :type: oci.waas.models.DeviceFingerprintChallenge
206        """
207        self._device_fingerprint_challenge = device_fingerprint_challenge
208
209    @property
210    def human_interaction_challenge(self):
211        """
212        Gets the human_interaction_challenge of this WafConfigDetails.
213        The human interaction challenge settings. Detects natural human interactions such as mouse movements, time on site, and page scrolling to identify bots.
214
215
216        :return: The human_interaction_challenge of this WafConfigDetails.
217        :rtype: oci.waas.models.HumanInteractionChallenge
218        """
219        return self._human_interaction_challenge
220
221    @human_interaction_challenge.setter
222    def human_interaction_challenge(self, human_interaction_challenge):
223        """
224        Sets the human_interaction_challenge of this WafConfigDetails.
225        The human interaction challenge settings. Detects natural human interactions such as mouse movements, time on site, and page scrolling to identify bots.
226
227
228        :param human_interaction_challenge: The human_interaction_challenge of this WafConfigDetails.
229        :type: oci.waas.models.HumanInteractionChallenge
230        """
231        self._human_interaction_challenge = human_interaction_challenge
232
233    @property
234    def js_challenge(self):
235        """
236        Gets the js_challenge of this WafConfigDetails.
237        The JavaScript challenge settings. Blocks bots by challenging requests from browsers that have no JavaScript support.
238
239
240        :return: The js_challenge of this WafConfigDetails.
241        :rtype: oci.waas.models.JsChallenge
242        """
243        return self._js_challenge
244
245    @js_challenge.setter
246    def js_challenge(self, js_challenge):
247        """
248        Sets the js_challenge of this WafConfigDetails.
249        The JavaScript challenge settings. Blocks bots by challenging requests from browsers that have no JavaScript support.
250
251
252        :param js_challenge: The js_challenge of this WafConfigDetails.
253        :type: oci.waas.models.JsChallenge
254        """
255        self._js_challenge = js_challenge
256
257    @property
258    def origin(self):
259        """
260        Gets the origin of this WafConfigDetails.
261        The key in the map of origins referencing the origin used for the Web Application Firewall. The origin must already be included in `Origins`. Required when creating the `WafConfig` resource, but is not required upon updating the configuration.
262
263
264        :return: The origin of this WafConfigDetails.
265        :rtype: str
266        """
267        return self._origin
268
269    @origin.setter
270    def origin(self, origin):
271        """
272        Sets the origin of this WafConfigDetails.
273        The key in the map of origins referencing the origin used for the Web Application Firewall. The origin must already be included in `Origins`. Required when creating the `WafConfig` resource, but is not required upon updating the configuration.
274
275
276        :param origin: The origin of this WafConfigDetails.
277        :type: str
278        """
279        self._origin = origin
280
281    @property
282    def caching_rules(self):
283        """
284        Gets the caching_rules of this WafConfigDetails.
285        A list of caching rules applied to the web application.
286
287
288        :return: The caching_rules of this WafConfigDetails.
289        :rtype: list[oci.waas.models.CachingRule]
290        """
291        return self._caching_rules
292
293    @caching_rules.setter
294    def caching_rules(self, caching_rules):
295        """
296        Sets the caching_rules of this WafConfigDetails.
297        A list of caching rules applied to the web application.
298
299
300        :param caching_rules: The caching_rules of this WafConfigDetails.
301        :type: list[oci.waas.models.CachingRule]
302        """
303        self._caching_rules = caching_rules
304
305    @property
306    def custom_protection_rules(self):
307        """
308        Gets the custom_protection_rules of this WafConfigDetails.
309        A list of the custom protection rule OCIDs and their actions.
310
311
312        :return: The custom_protection_rules of this WafConfigDetails.
313        :rtype: list[oci.waas.models.CustomProtectionRuleSetting]
314        """
315        return self._custom_protection_rules
316
317    @custom_protection_rules.setter
318    def custom_protection_rules(self, custom_protection_rules):
319        """
320        Sets the custom_protection_rules of this WafConfigDetails.
321        A list of the custom protection rule OCIDs and their actions.
322
323
324        :param custom_protection_rules: The custom_protection_rules of this WafConfigDetails.
325        :type: list[oci.waas.models.CustomProtectionRuleSetting]
326        """
327        self._custom_protection_rules = custom_protection_rules
328
329    @property
330    def origin_groups(self):
331        """
332        Gets the origin_groups of this WafConfigDetails.
333        The map of origin groups and their keys used to associate origins to the `wafConfig`. Origin groups allow you to apply weights to groups of origins for load balancing purposes. Origins with higher weights will receive larger proportions of client requests.
334        To add additional origins to your WAAS policy, update the `origins` field of a `UpdateWaasPolicy` request.
335
336
337        :return: The origin_groups of this WafConfigDetails.
338        :rtype: list[str]
339        """
340        return self._origin_groups
341
342    @origin_groups.setter
343    def origin_groups(self, origin_groups):
344        """
345        Sets the origin_groups of this WafConfigDetails.
346        The map of origin groups and their keys used to associate origins to the `wafConfig`. Origin groups allow you to apply weights to groups of origins for load balancing purposes. Origins with higher weights will receive larger proportions of client requests.
347        To add additional origins to your WAAS policy, update the `origins` field of a `UpdateWaasPolicy` request.
348
349
350        :param origin_groups: The origin_groups of this WafConfigDetails.
351        :type: list[str]
352        """
353        self._origin_groups = origin_groups
354
355    @property
356    def protection_settings(self):
357        """
358        Gets the protection_settings of this WafConfigDetails.
359        The settings applied to protection rules.
360
361
362        :return: The protection_settings of this WafConfigDetails.
363        :rtype: oci.waas.models.ProtectionSettings
364        """
365        return self._protection_settings
366
367    @protection_settings.setter
368    def protection_settings(self, protection_settings):
369        """
370        Sets the protection_settings of this WafConfigDetails.
371        The settings applied to protection rules.
372
373
374        :param protection_settings: The protection_settings of this WafConfigDetails.
375        :type: oci.waas.models.ProtectionSettings
376        """
377        self._protection_settings = protection_settings
378
379    @property
380    def whitelists(self):
381        """
382        Gets the whitelists of this WafConfigDetails.
383        A list of IP addresses that bypass the Web Application Firewall.
384
385
386        :return: The whitelists of this WafConfigDetails.
387        :rtype: list[oci.waas.models.Whitelist]
388        """
389        return self._whitelists
390
391    @whitelists.setter
392    def whitelists(self, whitelists):
393        """
394        Sets the whitelists of this WafConfigDetails.
395        A list of IP addresses that bypass the Web Application Firewall.
396
397
398        :param whitelists: The whitelists of this WafConfigDetails.
399        :type: list[oci.waas.models.Whitelist]
400        """
401        self._whitelists = whitelists
402
403    def __repr__(self):
404        return formatted_flat_dict(self)
405
406    def __eq__(self, other):
407        if other is None:
408            return False
409
410        return self.__dict__ == other.__dict__
411
412    def __ne__(self, other):
413        return not self == other
414