Class: OCI::Waas::Models::WafLog

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/waas/models/waf_log.rb

Overview

A list of Web Application Firewall log entries. Each entry is a JSON object whose fields vary based on log type. Logs record what rules and countermeasures are triggered by requests and are used as a basis to move request handling into block mode.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WafLog

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :action (String)

    The value to assign to the #action property

  • :captcha_action (String)

    The value to assign to the #captcha_action property

  • :captcha_expected (String)

    The value to assign to the #captcha_expected property

  • :captcha_received (String)

    The value to assign to the #captcha_received property

  • :captcha_fail_count (String)

    The value to assign to the #captcha_fail_count property

  • :client_address (String)

    The value to assign to the #client_address property

  • :country_name (String)

    The value to assign to the #country_name property

  • :user_agent (String)

    The value to assign to the #user_agent property

  • :domain (String)

    The value to assign to the #domain property

  • :protection_rule_detections (Hash<String, String>)

    The value to assign to the #protection_rule_detections property

  • :http_method (String)

    The value to assign to the #http_method property

  • :request_url (String)

    The value to assign to the #request_url property

  • :http_headers (Hash<String, String>)

    The value to assign to the #http_headers property

  • :referrer (String)

    The value to assign to the #referrer property

  • :response_code (Integer)

    The value to assign to the #response_code property

  • :response_size (Integer)

    The value to assign to the #response_size property

  • :incident_key (String)

    The value to assign to the #incident_key property

  • :fingerprint (String)

    The value to assign to the #fingerprint property

  • :device (String)

    The value to assign to the #device property

  • :country_code (String)

    The value to assign to the #country_code property

  • :request_headers (Hash<String, String>)

    The value to assign to the #request_headers property

  • :threat_feed_key (String)

    The value to assign to the #threat_feed_key property

  • :access_rule_key (String)

    The value to assign to the #access_rule_key property

  • :address_rate_limiting_key (String)

    The value to assign to the #address_rate_limiting_key property

  • :timestamp (String)

    The value to assign to the #timestamp property

  • :log_type (String)

    The value to assign to the #log_type property

  • :origin_address (String)

    The value to assign to the #origin_address property

  • :origin_response_time (String)

    The value to assign to the #origin_response_time property



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/oci/waas/models/waf_log.rb', line 230

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.action = attributes[:'action'] if attributes[:'action']

  self.captcha_action = attributes[:'captchaAction'] if attributes[:'captchaAction']

  raise 'You cannot provide both :captchaAction and :captcha_action' if attributes.key?(:'captchaAction') && attributes.key?(:'captcha_action')

  self.captcha_action = attributes[:'captcha_action'] if attributes[:'captcha_action']

  self.captcha_expected = attributes[:'captchaExpected'] if attributes[:'captchaExpected']

  raise 'You cannot provide both :captchaExpected and :captcha_expected' if attributes.key?(:'captchaExpected') && attributes.key?(:'captcha_expected')

  self.captcha_expected = attributes[:'captcha_expected'] if attributes[:'captcha_expected']

  self.captcha_received = attributes[:'captchaReceived'] if attributes[:'captchaReceived']

  raise 'You cannot provide both :captchaReceived and :captcha_received' if attributes.key?(:'captchaReceived') && attributes.key?(:'captcha_received')

  self.captcha_received = attributes[:'captcha_received'] if attributes[:'captcha_received']

  self.captcha_fail_count = attributes[:'captchaFailCount'] if attributes[:'captchaFailCount']

  raise 'You cannot provide both :captchaFailCount and :captcha_fail_count' if attributes.key?(:'captchaFailCount') && attributes.key?(:'captcha_fail_count')

  self.captcha_fail_count = attributes[:'captcha_fail_count'] if attributes[:'captcha_fail_count']

  self.client_address = attributes[:'clientAddress'] if attributes[:'clientAddress']

  raise 'You cannot provide both :clientAddress and :client_address' if attributes.key?(:'clientAddress') && attributes.key?(:'client_address')

  self.client_address = attributes[:'client_address'] if attributes[:'client_address']

  self.country_name = attributes[:'countryName'] if attributes[:'countryName']

  raise 'You cannot provide both :countryName and :country_name' if attributes.key?(:'countryName') && attributes.key?(:'country_name')

  self.country_name = attributes[:'country_name'] if attributes[:'country_name']

  self.user_agent = attributes[:'userAgent'] if attributes[:'userAgent']

  raise 'You cannot provide both :userAgent and :user_agent' if attributes.key?(:'userAgent') && attributes.key?(:'user_agent')

  self.user_agent = attributes[:'user_agent'] if attributes[:'user_agent']

  self.domain = attributes[:'domain'] if attributes[:'domain']

  self.protection_rule_detections = attributes[:'protectionRuleDetections'] if attributes[:'protectionRuleDetections']

  raise 'You cannot provide both :protectionRuleDetections and :protection_rule_detections' if attributes.key?(:'protectionRuleDetections') && attributes.key?(:'protection_rule_detections')

  self.protection_rule_detections = attributes[:'protection_rule_detections'] if attributes[:'protection_rule_detections']

  self.http_method = attributes[:'httpMethod'] if attributes[:'httpMethod']

  raise 'You cannot provide both :httpMethod and :http_method' if attributes.key?(:'httpMethod') && attributes.key?(:'http_method')

  self.http_method = attributes[:'http_method'] if attributes[:'http_method']

  self.request_url = attributes[:'requestUrl'] if attributes[:'requestUrl']

  raise 'You cannot provide both :requestUrl and :request_url' if attributes.key?(:'requestUrl') && attributes.key?(:'request_url')

  self.request_url = attributes[:'request_url'] if attributes[:'request_url']

  self.http_headers = attributes[:'httpHeaders'] if attributes[:'httpHeaders']

  raise 'You cannot provide both :httpHeaders and :http_headers' if attributes.key?(:'httpHeaders') && attributes.key?(:'http_headers')

  self.http_headers = attributes[:'http_headers'] if attributes[:'http_headers']

  self.referrer = attributes[:'referrer'] if attributes[:'referrer']

  self.response_code = attributes[:'responseCode'] if attributes[:'responseCode']

  raise 'You cannot provide both :responseCode and :response_code' if attributes.key?(:'responseCode') && attributes.key?(:'response_code')

  self.response_code = attributes[:'response_code'] if attributes[:'response_code']

  self.response_size = attributes[:'responseSize'] if attributes[:'responseSize']

  raise 'You cannot provide both :responseSize and :response_size' if attributes.key?(:'responseSize') && attributes.key?(:'response_size')

  self.response_size = attributes[:'response_size'] if attributes[:'response_size']

  self.incident_key = attributes[:'incidentKey'] if attributes[:'incidentKey']

  raise 'You cannot provide both :incidentKey and :incident_key' if attributes.key?(:'incidentKey') && attributes.key?(:'incident_key')

  self.incident_key = attributes[:'incident_key'] if attributes[:'incident_key']

  self.fingerprint = attributes[:'fingerprint'] if attributes[:'fingerprint']

  self.device = attributes[:'device'] if attributes[:'device']

  self.country_code = attributes[:'countryCode'] if attributes[:'countryCode']

  raise 'You cannot provide both :countryCode and :country_code' if attributes.key?(:'countryCode') && attributes.key?(:'country_code')

  self.country_code = attributes[:'country_code'] if attributes[:'country_code']

  self.request_headers = attributes[:'requestHeaders'] if attributes[:'requestHeaders']

  raise 'You cannot provide both :requestHeaders and :request_headers' if attributes.key?(:'requestHeaders') && attributes.key?(:'request_headers')

  self.request_headers = attributes[:'request_headers'] if attributes[:'request_headers']

  self.threat_feed_key = attributes[:'threatFeedKey'] if attributes[:'threatFeedKey']

  raise 'You cannot provide both :threatFeedKey and :threat_feed_key' if attributes.key?(:'threatFeedKey') && attributes.key?(:'threat_feed_key')

  self.threat_feed_key = attributes[:'threat_feed_key'] if attributes[:'threat_feed_key']

  self.access_rule_key = attributes[:'accessRuleKey'] if attributes[:'accessRuleKey']

  raise 'You cannot provide both :accessRuleKey and :access_rule_key' if attributes.key?(:'accessRuleKey') && attributes.key?(:'access_rule_key')

  self.access_rule_key = attributes[:'access_rule_key'] if attributes[:'access_rule_key']

  self.address_rate_limiting_key = attributes[:'addressRateLimitingKey'] if attributes[:'addressRateLimitingKey']

  raise 'You cannot provide both :addressRateLimitingKey and :address_rate_limiting_key' if attributes.key?(:'addressRateLimitingKey') && attributes.key?(:'address_rate_limiting_key')

  self.address_rate_limiting_key = attributes[:'address_rate_limiting_key'] if attributes[:'address_rate_limiting_key']

  self.timestamp = attributes[:'timestamp'] if attributes[:'timestamp']

  self.log_type = attributes[:'logType'] if attributes[:'logType']

  raise 'You cannot provide both :logType and :log_type' if attributes.key?(:'logType') && attributes.key?(:'log_type')

  self.log_type = attributes[:'log_type'] if attributes[:'log_type']

  self.origin_address = attributes[:'originAddress'] if attributes[:'originAddress']

  raise 'You cannot provide both :originAddress and :origin_address' if attributes.key?(:'originAddress') && attributes.key?(:'origin_address')

  self.origin_address = attributes[:'origin_address'] if attributes[:'origin_address']

  self.origin_response_time = attributes[:'originResponseTime'] if attributes[:'originResponseTime']

  raise 'You cannot provide both :originResponseTime and :origin_response_time' if attributes.key?(:'originResponseTime') && attributes.key?(:'origin_response_time')

  self.origin_response_time = attributes[:'origin_response_time'] if attributes[:'origin_response_time']
end

Instance Attribute Details

#access_rule_keyString

The ‘AccessRule` key that matched the request.

Returns:

  • (String)


100
101
102
# File 'lib/oci/waas/models/waf_log.rb', line 100

def access_rule_key
  @access_rule_key
end

#actionString

The action taken on the request.

Returns:

  • (String)


11
12
13
# File 'lib/oci/waas/models/waf_log.rb', line 11

def action
  @action
end

#address_rate_limiting_keyString

The ‘AddressRateLimiting` key that matched the request.

Returns:

  • (String)


104
105
106
# File 'lib/oci/waas/models/waf_log.rb', line 104

def address_rate_limiting_key
  @address_rate_limiting_key
end

#captcha_actionString

The CAPTCHA action taken on the request.

Returns:

  • (String)


15
16
17
# File 'lib/oci/waas/models/waf_log.rb', line 15

def captcha_action
  @captcha_action
end

#captcha_expectedString

The CAPTCHA challenge answer that was expected.

Returns:

  • (String)


19
20
21
# File 'lib/oci/waas/models/waf_log.rb', line 19

def captcha_expected
  @captcha_expected
end

#captcha_fail_countString

The number of times the CAPTCHA challenge was failed.

Returns:

  • (String)


27
28
29
# File 'lib/oci/waas/models/waf_log.rb', line 27

def captcha_fail_count
  @captcha_fail_count
end

#captcha_receivedString

The CAPTCHA challenge answer that was received.

Returns:

  • (String)


23
24
25
# File 'lib/oci/waas/models/waf_log.rb', line 23

def captcha_received
  @captcha_received
end

#client_addressString

The IPv4 address of the requesting client.

Returns:

  • (String)


31
32
33
# File 'lib/oci/waas/models/waf_log.rb', line 31

def client_address
  @client_address
end

#country_codeString

The ISO 3166-1 country code of the request.

Returns:

  • (String)


88
89
90
# File 'lib/oci/waas/models/waf_log.rb', line 88

def country_code
  @country_code
end

#country_nameString

The name of the country where the request was made.

Returns:

  • (String)


35
36
37
# File 'lib/oci/waas/models/waf_log.rb', line 35

def country_name
  @country_name
end

#deviceString

The type of device that the request was made from.

Returns:

  • (String)


84
85
86
# File 'lib/oci/waas/models/waf_log.rb', line 84

def device
  @device
end

#domainString

The domain where the request was sent.

Returns:

  • (String)


43
44
45
# File 'lib/oci/waas/models/waf_log.rb', line 43

def domain
  @domain
end

#fingerprintString

TODO: what is this? MD5 hash of the request? SHA1?

Returns:

  • (String)


80
81
82
# File 'lib/oci/waas/models/waf_log.rb', line 80

def fingerprint
  @fingerprint
end

#http_headersHash<String, String>

The map of header names to values of the request sent to the origin.

Returns:

  • (Hash<String, String>)


59
60
61
# File 'lib/oci/waas/models/waf_log.rb', line 59

def http_headers
  @http_headers
end

#http_methodString

The HTTP method of the request.

Returns:

  • (String)


51
52
53
# File 'lib/oci/waas/models/waf_log.rb', line 51

def http_method
  @http_method
end

#incident_keyString

The incident key that matched the request.

Returns:

  • (String)


75
76
77
# File 'lib/oci/waas/models/waf_log.rb', line 75

def incident_key
  @incident_key
end

#log_typeString

The type of log of the request.

Returns:

  • (String)


112
113
114
# File 'lib/oci/waas/models/waf_log.rb', line 112

def log_type
  @log_type
end

#origin_addressString

The address of the origin server where the request was sent.

Returns:

  • (String)


116
117
118
# File 'lib/oci/waas/models/waf_log.rb', line 116

def origin_address
  @origin_address
end

#origin_response_timeString

The amount of time it took the origin server to respond to the request. TODO: determine unit of time and example

Returns:

  • (String)


122
123
124
# File 'lib/oci/waas/models/waf_log.rb', line 122

def origin_response_time
  @origin_response_time
end

#protection_rule_detectionsHash<String, String>

A map of protection rule keys to detection message details.

Returns:

  • (Hash<String, String>)


47
48
49
# File 'lib/oci/waas/models/waf_log.rb', line 47

def protection_rule_detections
  @protection_rule_detections
end

#referrerString

The ‘Referrer` header value of the request.

Returns:

  • (String)


63
64
65
# File 'lib/oci/waas/models/waf_log.rb', line 63

def referrer
  @referrer
end

#request_headersHash<String, String>

A map of header names to values of the original request.

Returns:

  • (Hash<String, String>)


92
93
94
# File 'lib/oci/waas/models/waf_log.rb', line 92

def request_headers
  @request_headers
end

#request_urlString

The path and query string of the request.

Returns:

  • (String)


55
56
57
# File 'lib/oci/waas/models/waf_log.rb', line 55

def request_url
  @request_url
end

#response_codeInteger

The status code of the response.

Returns:

  • (Integer)


67
68
69
# File 'lib/oci/waas/models/waf_log.rb', line 67

def response_code
  @response_code
end

#response_sizeInteger

The size in bytes of the response.

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/waas/models/waf_log.rb', line 71

def response_size
  @response_size
end

#threat_feed_keyString

The ‘ThreatFeed` key that matched the request.

Returns:

  • (String)


96
97
98
# File 'lib/oci/waas/models/waf_log.rb', line 96

def threat_feed_key
  @threat_feed_key
end

#timestampString

The ‘Date` header value of the request.

Returns:

  • (String)


108
109
110
# File 'lib/oci/waas/models/waf_log.rb', line 108

def timestamp
  @timestamp
end

#user_agentString

The ‘User-Agent` header value of the request.

Returns:

  • (String)


39
40
41
# File 'lib/oci/waas/models/waf_log.rb', line 39

def user_agent
  @user_agent
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/oci/waas/models/waf_log.rb', line 125

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'action': :'action',
    'captcha_action': :'captchaAction',
    'captcha_expected': :'captchaExpected',
    'captcha_received': :'captchaReceived',
    'captcha_fail_count': :'captchaFailCount',
    'client_address': :'clientAddress',
    'country_name': :'countryName',
    'user_agent': :'userAgent',
    'domain': :'domain',
    'protection_rule_detections': :'protectionRuleDetections',
    'http_method': :'httpMethod',
    'request_url': :'requestUrl',
    'http_headers': :'httpHeaders',
    'referrer': :'referrer',
    'response_code': :'responseCode',
    'response_size': :'responseSize',
    'incident_key': :'incidentKey',
    'fingerprint': :'fingerprint',
    'device': :'device',
    'country_code': :'countryCode',
    'request_headers': :'requestHeaders',
    'threat_feed_key': :'threatFeedKey',
    'access_rule_key': :'accessRuleKey',
    'address_rate_limiting_key': :'addressRateLimitingKey',
    'timestamp': :'timestamp',
    'log_type': :'logType',
    'origin_address': :'originAddress',
    'origin_response_time': :'originResponseTime'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/waas/models/waf_log.rb', line 161

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'action': :'String',
    'captcha_action': :'String',
    'captcha_expected': :'String',
    'captcha_received': :'String',
    'captcha_fail_count': :'String',
    'client_address': :'String',
    'country_name': :'String',
    'user_agent': :'String',
    'domain': :'String',
    'protection_rule_detections': :'Hash<String, String>',
    'http_method': :'String',
    'request_url': :'String',
    'http_headers': :'Hash<String, String>',
    'referrer': :'String',
    'response_code': :'Integer',
    'response_size': :'Integer',
    'incident_key': :'String',
    'fingerprint': :'String',
    'device': :'String',
    'country_code': :'String',
    'request_headers': :'Hash<String, String>',
    'threat_feed_key': :'String',
    'access_rule_key': :'String',
    'address_rate_limiting_key': :'String',
    'timestamp': :'String',
    'log_type': :'String',
    'origin_address': :'String',
    'origin_response_time': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/oci/waas/models/waf_log.rb', line 388

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    action == other.action &&
    captcha_action == other.captcha_action &&
    captcha_expected == other.captcha_expected &&
    captcha_received == other.captcha_received &&
    captcha_fail_count == other.captcha_fail_count &&
    client_address == other.client_address &&
    country_name == other.country_name &&
    user_agent == other.user_agent &&
    domain == other.domain &&
    protection_rule_detections == other.protection_rule_detections &&
    http_method == other.http_method &&
    request_url == other.request_url &&
    http_headers == other.http_headers &&
    referrer == other.referrer &&
    response_code == other.response_code &&
    response_size == other.response_size &&
    incident_key == other.incident_key &&
    fingerprint == other.fingerprint &&
    device == other.device &&
    country_code == other.country_code &&
    request_headers == other.request_headers &&
    threat_feed_key == other.threat_feed_key &&
    access_rule_key == other.access_rule_key &&
    address_rate_limiting_key == other.address_rate_limiting_key &&
    timestamp == other.timestamp &&
    log_type == other.log_type &&
    origin_address == other.origin_address &&
    origin_response_time == other.origin_response_time
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
# File 'lib/oci/waas/models/waf_log.rb', line 445

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


425
426
427
# File 'lib/oci/waas/models/waf_log.rb', line 425

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



434
435
436
# File 'lib/oci/waas/models/waf_log.rb', line 434

def hash
  [action, captcha_action, captcha_expected, captcha_received, captcha_fail_count, client_address, country_name, user_agent, domain, protection_rule_detections, http_method, request_url, http_headers, referrer, response_code, response_size, incident_key, fingerprint, device, country_code, request_headers, threat_feed_key, access_rule_key, address_rate_limiting_key, timestamp, log_type, origin_address, origin_response_time].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



478
479
480
481
482
483
484
485
486
487
# File 'lib/oci/waas/models/waf_log.rb', line 478

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



472
473
474
# File 'lib/oci/waas/models/waf_log.rb', line 472

def to_s
  to_hash.to_s
end