Class: OCI::Waas::Models::WafLog
- Inherits:
-
Object
- Object
- OCI::Waas::Models::WafLog
- Defined in:
- lib/oci/waas/models/waf_log.rb
Overview
A list of Web Application Firewall log entries. Each entry is a JSON object, including a timestamp property and other fields varying 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. For more information about WAF logs, see Logs.
Instance Attribute Summary collapse
-
#access_rule_key ⇒ String
The
AccessRule
key that matched the request. -
#action ⇒ String
The action taken on the request, either
ALLOW
,DETECT
, orBLOCK
. -
#address_rate_limiting_key ⇒ String
The
AddressRateLimiting
key that matched the request. -
#captcha_action ⇒ String
The CAPTCHA action taken on the request,
ALLOW
orBLOCK
. -
#captcha_expected ⇒ String
The CAPTCHA challenge answer that was expected.
-
#captcha_fail_count ⇒ String
The number of times the CAPTCHA challenge was failed.
-
#captcha_received ⇒ String
The CAPTCHA challenge answer that was received.
-
#client_address ⇒ String
The IPv4 address of the requesting client.
-
#country_code ⇒ String
ISO 3166-1 alpha-2 code of the country from which the request originated.
-
#country_name ⇒ String
The name of the country where the request originated.
-
#device ⇒ String
The type of device that the request was made from.
-
#domain ⇒ String
The
Host
header data of the request. -
#fingerprint ⇒ String
The hashed signature of the device's fingerprint.
-
#http_headers ⇒ Hash<String, String>
The map of the request's header names to their respective values.
-
#http_method ⇒ String
The HTTP method of the request.
-
#incident_key ⇒ String
The incident key of a request.
-
#log_type ⇒ String
The type of log of the request.
-
#origin_address ⇒ String
The address of the origin server where the request was sent.
-
#origin_response_time ⇒ String
The amount of time it took the origin server to respond to the request, in seconds.
-
#protection_rule_detections ⇒ Hash<String, String>
A map of protection rule keys to detection message details.
-
#referrer ⇒ String
The
Referrer
header value of the request. -
#request_headers ⇒ Hash<String, String>
A map of header names to values of the request sent to the origin, including any headers appended by the Web Application Firewall.
-
#request_url ⇒ String
The path and query string of the request.
-
#response_code ⇒ Integer
The status code of the response.
-
#response_size ⇒ Integer
The size in bytes of the response.
-
#threat_feed_key ⇒ String
The
ThreatFeed
key that matched the request. -
#timestamp ⇒ DateTime
The date and time the Web Application Firewall processed the request and logged it.
-
#user_agent ⇒ String
The value of the request's
User-Agent
header field.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ WafLog
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ WafLog
Initializes the object
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 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 |
# File 'lib/oci/waas/models/waf_log.rb', line 253 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. = 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_key ⇒ String
The AccessRule
key that matched the request. For more information about access rules, see UpdateAccessRules
.
120 121 122 |
# File 'lib/oci/waas/models/waf_log.rb', line 120 def access_rule_key @access_rule_key end |
#action ⇒ String
The action taken on the request, either ALLOW
, DETECT
, or BLOCK
.
13 14 15 |
# File 'lib/oci/waas/models/waf_log.rb', line 13 def action @action end |
#address_rate_limiting_key ⇒ String
The AddressRateLimiting
key that matched the request. For more information about address rate limiting, see UpdateWafAddressRateLimiting
.
126 127 128 |
# File 'lib/oci/waas/models/waf_log.rb', line 126 def address_rate_limiting_key @address_rate_limiting_key end |
#captcha_action ⇒ String
The CAPTCHA action taken on the request, ALLOW
or BLOCK
. For more information about CAPTCHAs, see UpdateCaptchas
.
19 20 21 |
# File 'lib/oci/waas/models/waf_log.rb', line 19 def captcha_action @captcha_action end |
#captcha_expected ⇒ String
The CAPTCHA challenge answer that was expected.
23 24 25 |
# File 'lib/oci/waas/models/waf_log.rb', line 23 def captcha_expected @captcha_expected end |
#captcha_fail_count ⇒ String
The number of times the CAPTCHA challenge was failed.
31 32 33 |
# File 'lib/oci/waas/models/waf_log.rb', line 31 def captcha_fail_count @captcha_fail_count end |
#captcha_received ⇒ String
The CAPTCHA challenge answer that was received.
27 28 29 |
# File 'lib/oci/waas/models/waf_log.rb', line 27 def captcha_received @captcha_received end |
#client_address ⇒ String
The IPv4 address of the requesting client.
35 36 37 |
# File 'lib/oci/waas/models/waf_log.rb', line 35 def client_address @client_address end |
#country_code ⇒ String
ISO 3166-1 alpha-2 code of the country from which the request originated. For a list of codes, see ISO’s website.
102 103 104 |
# File 'lib/oci/waas/models/waf_log.rb', line 102 def country_code @country_code end |
#country_name ⇒ String
The name of the country where the request originated.
39 40 41 |
# File 'lib/oci/waas/models/waf_log.rb', line 39 def country_name @country_name end |
#device ⇒ String
The type of device that the request was made from.
96 97 98 |
# File 'lib/oci/waas/models/waf_log.rb', line 96 def device @device end |
#domain ⇒ String
The Host
header data of the request.
48 49 50 |
# File 'lib/oci/waas/models/waf_log.rb', line 48 def domain @domain end |
#fingerprint ⇒ String
The hashed signature of the device's fingerprint. For more information, see DeviceFingerPrintChallenge
.
92 93 94 |
# File 'lib/oci/waas/models/waf_log.rb', line 92 def fingerprint @fingerprint end |
#http_headers ⇒ Hash<String, String>
The map of the request's header names to their respective values.
67 68 69 |
# File 'lib/oci/waas/models/waf_log.rb', line 67 def http_headers @http_headers end |
#http_method ⇒ String
The HTTP method of the request.
59 60 61 |
# File 'lib/oci/waas/models/waf_log.rb', line 59 def http_method @http_method end |
#incident_key ⇒ String
The incident key of a request. An incident key is generated for each request processed by the Web Application Firewall and is used to idenitfy blocked requests in applicable logs.
86 87 88 |
# File 'lib/oci/waas/models/waf_log.rb', line 86 def incident_key @incident_key end |
#log_type ⇒ String
The type of log of the request. For more about log types, see Logs.
136 137 138 |
# File 'lib/oci/waas/models/waf_log.rb', line 136 def log_type @log_type end |
#origin_address ⇒ String
The address of the origin server where the request was sent.
140 141 142 |
# File 'lib/oci/waas/models/waf_log.rb', line 140 def origin_address @origin_address end |
#origin_response_time ⇒ String
The amount of time it took the origin server to respond to the request, in seconds.
145 146 147 |
# File 'lib/oci/waas/models/waf_log.rb', line 145 def origin_response_time @origin_response_time end |
#protection_rule_detections ⇒ Hash<String, String>
A map of protection rule keys to detection message details. Detections are requests that matched the criteria of a protection rule but the rule's action was set to DETECT
.
55 56 57 |
# File 'lib/oci/waas/models/waf_log.rb', line 55 def protection_rule_detections @protection_rule_detections end |
#referrer ⇒ String
The Referrer
header value of the request.
71 72 73 |
# File 'lib/oci/waas/models/waf_log.rb', line 71 def referrer @referrer end |
#request_headers ⇒ Hash<String, String>
A map of header names to values of the request sent to the origin, including any headers appended by the Web Application Firewall.
108 109 110 |
# File 'lib/oci/waas/models/waf_log.rb', line 108 def request_headers @request_headers end |
#request_url ⇒ String
The path and query string of the request.
63 64 65 |
# File 'lib/oci/waas/models/waf_log.rb', line 63 def request_url @request_url end |
#response_code ⇒ Integer
The status code of the response.
75 76 77 |
# File 'lib/oci/waas/models/waf_log.rb', line 75 def response_code @response_code end |
#response_size ⇒ Integer
The size in bytes of the response.
79 80 81 |
# File 'lib/oci/waas/models/waf_log.rb', line 79 def response_size @response_size end |
#threat_feed_key ⇒ String
The ThreatFeed
key that matched the request. For more information about threat feeds, see UpdateThreatFeeds
.
114 115 116 |
# File 'lib/oci/waas/models/waf_log.rb', line 114 def threat_feed_key @threat_feed_key end |
#timestamp ⇒ DateTime
The date and time the Web Application Firewall processed the request and logged it.
131 132 133 |
# File 'lib/oci/waas/models/waf_log.rb', line 131 def @timestamp end |
#user_agent ⇒ String
The value of the request's User-Agent
header field.
43 44 45 |
# File 'lib/oci/waas/models/waf_log.rb', line 43 def user_agent @user_agent end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/oci/waas/models/waf_log.rb', line 148 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_types ⇒ Object
Attribute type mapping.
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/oci/waas/models/waf_log.rb', line 184 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': :'DateTime', '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.
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/oci/waas/models/waf_log.rb', line 411 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 && == other. && 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
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/oci/waas/models/waf_log.rb', line 468 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
448 449 450 |
# File 'lib/oci/waas/models/waf_log.rb', line 448 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
457 458 459 |
# File 'lib/oci/waas/models/waf_log.rb', line 457 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, , log_type, origin_address, origin_response_time].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
501 502 503 504 505 506 507 508 509 510 |
# File 'lib/oci/waas/models/waf_log.rb', line 501 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_s ⇒ String
Returns the string representation of the object
495 496 497 |
# File 'lib/oci/waas/models/waf_log.rb', line 495 def to_s to_hash.to_s end |