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 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
-
#access_rule_key ⇒ String
The ‘AccessRule` key that matched the request.
-
#action ⇒ String
The action taken on the request.
-
#address_rate_limiting_key ⇒ String
The ‘AddressRateLimiting` key that matched the request.
-
#captcha_action ⇒ String
The CAPTCHA action taken on the request.
-
#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
The ISO 3166-1 country code of the request.
-
#country_name ⇒ String
The name of the country where the request was made.
-
#device ⇒ String
The type of device that the request was made from.
-
#domain ⇒ String
The domain where the request was sent.
-
#fingerprint ⇒ String
TODO: what is this? MD5 hash of the request? SHA1?.
-
#http_headers ⇒ Hash<String, String>
The map of header names to values of the request sent to the origin.
-
#http_method ⇒ String
The HTTP method of the request.
-
#incident_key ⇒ String
The incident key that matched the 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.
-
#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 original request.
-
#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 ⇒ String
The ‘Date` header value of the request.
-
#user_agent ⇒ String
The ‘User-Agent` header value of the request.
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
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. = 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.
100 101 102 |
# File 'lib/oci/waas/models/waf_log.rb', line 100 def access_rule_key @access_rule_key end |
#action ⇒ String
The action taken on the request.
11 12 13 |
# File 'lib/oci/waas/models/waf_log.rb', line 11 def action @action end |
#address_rate_limiting_key ⇒ String
The ‘AddressRateLimiting` key that matched the request.
104 105 106 |
# File 'lib/oci/waas/models/waf_log.rb', line 104 def address_rate_limiting_key @address_rate_limiting_key end |
#captcha_action ⇒ String
The CAPTCHA action taken on the request.
15 16 17 |
# File 'lib/oci/waas/models/waf_log.rb', line 15 def captcha_action @captcha_action end |
#captcha_expected ⇒ String
The CAPTCHA challenge answer that was expected.
19 20 21 |
# File 'lib/oci/waas/models/waf_log.rb', line 19 def captcha_expected @captcha_expected end |
#captcha_fail_count ⇒ String
The number of times the CAPTCHA challenge was failed.
27 28 29 |
# File 'lib/oci/waas/models/waf_log.rb', line 27 def captcha_fail_count @captcha_fail_count end |
#captcha_received ⇒ String
The CAPTCHA challenge answer that was received.
23 24 25 |
# File 'lib/oci/waas/models/waf_log.rb', line 23 def captcha_received @captcha_received end |
#client_address ⇒ String
The IPv4 address of the requesting client.
31 32 33 |
# File 'lib/oci/waas/models/waf_log.rb', line 31 def client_address @client_address end |
#country_code ⇒ String
The ISO 3166-1 country code of the request.
88 89 90 |
# File 'lib/oci/waas/models/waf_log.rb', line 88 def country_code @country_code end |
#country_name ⇒ String
The name of the country where the request was made.
35 36 37 |
# File 'lib/oci/waas/models/waf_log.rb', line 35 def country_name @country_name end |
#device ⇒ String
The type of device that the request was made from.
84 85 86 |
# File 'lib/oci/waas/models/waf_log.rb', line 84 def device @device end |
#domain ⇒ String
The domain where the request was sent.
43 44 45 |
# File 'lib/oci/waas/models/waf_log.rb', line 43 def domain @domain end |
#fingerprint ⇒ String
TODO: what is this? MD5 hash of the request? SHA1?
80 81 82 |
# File 'lib/oci/waas/models/waf_log.rb', line 80 def fingerprint @fingerprint end |
#http_headers ⇒ Hash<String, String>
The map of header names to values of the request sent to the origin.
59 60 61 |
# File 'lib/oci/waas/models/waf_log.rb', line 59 def http_headers @http_headers end |
#http_method ⇒ String
The HTTP method of the request.
51 52 53 |
# File 'lib/oci/waas/models/waf_log.rb', line 51 def http_method @http_method end |
#incident_key ⇒ String
The incident key that matched the request.
75 76 77 |
# File 'lib/oci/waas/models/waf_log.rb', line 75 def incident_key @incident_key end |
#log_type ⇒ String
The type of log of the request.
112 113 114 |
# File 'lib/oci/waas/models/waf_log.rb', line 112 def log_type @log_type end |
#origin_address ⇒ String
The address of the origin server where the request was sent.
116 117 118 |
# File 'lib/oci/waas/models/waf_log.rb', line 116 def origin_address @origin_address end |
#origin_response_time ⇒ String
The amount of time it took the origin server to respond to the request. TODO: determine unit of time and example
122 123 124 |
# File 'lib/oci/waas/models/waf_log.rb', line 122 def origin_response_time @origin_response_time end |
#protection_rule_detections ⇒ Hash<String, String>
A map of protection rule keys to detection message details.
47 48 49 |
# File 'lib/oci/waas/models/waf_log.rb', line 47 def protection_rule_detections @protection_rule_detections end |
#referrer ⇒ String
The ‘Referrer` header value of the request.
63 64 65 |
# File 'lib/oci/waas/models/waf_log.rb', line 63 def referrer @referrer end |
#request_headers ⇒ Hash<String, String>
A map of header names to values of the original request.
92 93 94 |
# File 'lib/oci/waas/models/waf_log.rb', line 92 def request_headers @request_headers end |
#request_url ⇒ String
The path and query string of the request.
55 56 57 |
# File 'lib/oci/waas/models/waf_log.rb', line 55 def request_url @request_url end |
#response_code ⇒ Integer
The status code of the response.
67 68 69 |
# File 'lib/oci/waas/models/waf_log.rb', line 67 def response_code @response_code end |
#response_size ⇒ Integer
The size in bytes of the response.
71 72 73 |
# File 'lib/oci/waas/models/waf_log.rb', line 71 def response_size @response_size end |
#threat_feed_key ⇒ String
The ‘ThreatFeed` key that matched the request.
96 97 98 |
# File 'lib/oci/waas/models/waf_log.rb', line 96 def threat_feed_key @threat_feed_key end |
#timestamp ⇒ String
The ‘Date` header value of the request.
108 109 110 |
# File 'lib/oci/waas/models/waf_log.rb', line 108 def @timestamp end |
#user_agent ⇒ String
The ‘User-Agent` header value of the request.
39 40 41 |
# File 'lib/oci/waas/models/waf_log.rb', line 39 def user_agent @user_agent end |
Class Method Details
.attribute_map ⇒ Object
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_types ⇒ Object
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.
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 && == 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
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
425 426 427 |
# File 'lib/oci/waas/models/waf_log.rb', line 425 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
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, , log_type, origin_address, origin_response_time].hash end |
#to_hash ⇒ 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_s ⇒ String
Returns the string representation of the object
472 473 474 |
# File 'lib/oci/waas/models/waf_log.rb', line 472 def to_s to_hash.to_s end |