Class: Falcon::SadomainRule
- Inherits:
-
Object
- Object
- Falcon::SadomainRule
- Defined in:
- lib/crimson-falcon/models/sadomain_rule.rb
Instance Attribute Summary collapse
-
#breach_monitor_only ⇒ Object
Monitor only for exposed data.
-
#breach_monitoring_enabled ⇒ Object
Whether to monitor for exposed data.
-
#cid ⇒ Object
Returns the value of attribute cid.
-
#created_by ⇒ Object
The UUID of the user that created a given rule or or "Crowdstrike" if the rule was system generated.
-
#created_timestamp ⇒ Object
The creation time for a given rule.
-
#filter ⇒ Object
The FQL filter contained in a rule and used for searching.
-
#id ⇒ Object
The ID of a given rule.
-
#lookback_period ⇒ Object
The duration for which the rule will look back in the past at the first run.
-
#match_on_tsq_result_types ⇒ Object
Which result types to monitor for.
-
#name ⇒ Object
The name of a given rule.
-
#originating_template_id ⇒ Object
If the rule was generated based on a template, the id of the template.
-
#ownership_assets ⇒ Object
Returns the value of attribute ownership_assets.
-
#permissions ⇒ Object
The permissions for a given rule which specifies the rule’s access by other users.
-
#priority ⇒ Object
The priority of a given rule.
-
#status ⇒ Object
The status of a given rule.
-
#status_message ⇒ Object
The detailed status message of a given rule.
-
#substring_matching_enabled ⇒ Object
Whether to monitor for substring matches.
-
#template_priority ⇒ Object
Returns the value of attribute template_priority.
-
#topic ⇒ Object
The topic of a given rule.
-
#updated_timestamp ⇒ Object
The last updated time for a given rule.
-
#user_id ⇒ Object
The user ID of the user that created a given rule.
-
#user_name ⇒ Object
The user name of the user that created a given rule.
-
#user_uuid ⇒ Object
The UUID of the user that created a given rule.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SadomainRule
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ SadomainRule
Initializes the object
171 172 173 174 175 176 177 178 179 180 181 182 183 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 218 219 220 221 222 223 224 225 226 227 228 229 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 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 171 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Falcon::SadomainRule` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Falcon::SadomainRule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'breach_monitor_only') self.breach_monitor_only = attributes[:'breach_monitor_only'] end if attributes.key?(:'breach_monitoring_enabled') self.breach_monitoring_enabled = attributes[:'breach_monitoring_enabled'] end if attributes.key?(:'cid') self.cid = attributes[:'cid'] end if attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] end if attributes.key?(:'created_timestamp') self. = attributes[:'created_timestamp'] end if attributes.key?(:'filter') self.filter = attributes[:'filter'] end if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'lookback_period') self.lookback_period = attributes[:'lookback_period'] end if attributes.key?(:'match_on_tsq_result_types') if (value = attributes[:'match_on_tsq_result_types']).is_a?(Array) self.match_on_tsq_result_types = value end end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'originating_template_id') self.originating_template_id = attributes[:'originating_template_id'] end if attributes.key?(:'ownership_assets') self.ownership_assets = attributes[:'ownership_assets'] end if attributes.key?(:'permissions') self. = attributes[:'permissions'] end if attributes.key?(:'priority') self.priority = attributes[:'priority'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'status_message') self. = attributes[:'status_message'] end if attributes.key?(:'substring_matching_enabled') self.substring_matching_enabled = attributes[:'substring_matching_enabled'] end if attributes.key?(:'template_priority') self.template_priority = attributes[:'template_priority'] end if attributes.key?(:'topic') self.topic = attributes[:'topic'] end if attributes.key?(:'updated_timestamp') self. = attributes[:'updated_timestamp'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'user_name') self.user_name = attributes[:'user_name'] end if attributes.key?(:'user_uuid') self.user_uuid = attributes[:'user_uuid'] end end |
Instance Attribute Details
#breach_monitor_only ⇒ Object
Monitor only for exposed data. Must be accompanied by breach_monitoring_enabled:true.
35 36 37 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 35 def breach_monitor_only @breach_monitor_only end |
#breach_monitoring_enabled ⇒ Object
Whether to monitor for exposed data. Available only for ‘Company Domains` and `Email addresses` rule topics.
38 39 40 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 38 def breach_monitoring_enabled @breach_monitoring_enabled end |
#cid ⇒ Object
Returns the value of attribute cid.
40 41 42 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 40 def cid @cid end |
#created_by ⇒ Object
The UUID of the user that created a given rule or or "Crowdstrike" if the rule was system generated
43 44 45 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 43 def created_by @created_by end |
#created_timestamp ⇒ Object
The creation time for a given rule
46 47 48 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 46 def @created_timestamp end |
#filter ⇒ Object
The FQL filter contained in a rule and used for searching. Parentheses may be added automatically for clarity
49 50 51 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 49 def filter @filter end |
#id ⇒ Object
The ID of a given rule
52 53 54 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 52 def id @id end |
#lookback_period ⇒ Object
The duration for which the rule will look back in the past at the first run. Time unit: nanoseconds. Possible values: [‘604800000000000 (7 days)`, `2592000000000000 (1 month)`, `15552000000000000 (6 months)`, `31536000000000000 (1 year)`]
55 56 57 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 55 def lookback_period @lookback_period end |
#match_on_tsq_result_types ⇒ Object
Which result types to monitor for. Can be set to only monitor domains or subdomains, as well as both. Only available for the ‘Typosquatting` rule topic.
58 59 60 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 58 def match_on_tsq_result_types @match_on_tsq_result_types end |
#name ⇒ Object
The name of a given rule
61 62 63 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 61 def name @name end |
#originating_template_id ⇒ Object
If the rule was generated based on a template, the id of the template
64 65 66 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 64 def originating_template_id @originating_template_id end |
#ownership_assets ⇒ Object
Returns the value of attribute ownership_assets.
66 67 68 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 66 def ownership_assets @ownership_assets end |
#permissions ⇒ Object
The permissions for a given rule which specifies the rule’s access by other users. Possible values: [‘public (All Recon users)`, `private (Recon admins)`]
69 70 71 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 69 def @permissions end |
#priority ⇒ Object
The priority of a given rule
72 73 74 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 72 def priority @priority end |
#status ⇒ Object
The status of a given rule
75 76 77 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 75 def status @status end |
#status_message ⇒ Object
The detailed status message of a given rule
78 79 80 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 78 def @status_message end |
#substring_matching_enabled ⇒ Object
Whether to monitor for substring matches. Only available for the ‘Typosquatting` rule topic
81 82 83 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 81 def substring_matching_enabled @substring_matching_enabled end |
#template_priority ⇒ Object
Returns the value of attribute template_priority.
83 84 85 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 83 def template_priority @template_priority end |
#topic ⇒ Object
The topic of a given rule. Possible values: [‘SA_BRAND_PRODUCT (Brands and products)`, `SA_VIP (High-profile-employees)`, `SA_THIRD_PARTY (Supply chain vendors)`, `SA_IP (IP addresses)`, `SA_CVE (Vulnerabilities (CVEs))`, `SA_BIN (Bank identification numbers (BINs))`, `SA_DOMAIN (Company domains)`, `SA_EMAIL (Email addresses)`, `SA_ALIAS (Company names)`, `SA_AUTHOR (Authors)`, `SA_CUSTOM (Custom)`, `SA_TYPOSQUATTING (Typosquatting)`]
86 87 88 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 86 def topic @topic end |
#updated_timestamp ⇒ Object
The last updated time for a given rule
89 90 91 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 89 def @updated_timestamp end |
#user_id ⇒ Object
The user ID of the user that created a given rule
92 93 94 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 92 def user_id @user_id end |
#user_name ⇒ Object
The user name of the user that created a given rule
95 96 97 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 95 def user_name @user_name end |
#user_uuid ⇒ Object
The UUID of the user that created a given rule
98 99 100 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 98 def user_uuid @user_uuid end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
130 131 132 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 130 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 101 def self.attribute_map { :'breach_monitor_only' => :'breach_monitor_only', :'breach_monitoring_enabled' => :'breach_monitoring_enabled', :'cid' => :'cid', :'created_by' => :'created_by', :'created_timestamp' => :'created_timestamp', :'filter' => :'filter', :'id' => :'id', :'lookback_period' => :'lookback_period', :'match_on_tsq_result_types' => :'match_on_tsq_result_types', :'name' => :'name', :'originating_template_id' => :'originating_template_id', :'ownership_assets' => :'ownership_assets', :'permissions' => :'permissions', :'priority' => :'priority', :'status' => :'status', :'status_message' => :'status_message', :'substring_matching_enabled' => :'substring_matching_enabled', :'template_priority' => :'template_priority', :'topic' => :'topic', :'updated_timestamp' => :'updated_timestamp', :'user_id' => :'user_id', :'user_name' => :'user_name', :'user_uuid' => :'user_uuid' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
412 413 414 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 412 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
164 165 166 167 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 164 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 135 def self.openapi_types { :'breach_monitor_only' => :'Boolean', :'breach_monitoring_enabled' => :'Boolean', :'cid' => :'String', :'created_by' => :'String', :'created_timestamp' => :'Time', :'filter' => :'String', :'id' => :'String', :'lookback_period' => :'Integer', :'match_on_tsq_result_types' => :'Array<String>', :'name' => :'String', :'originating_template_id' => :'String', :'ownership_assets' => :'SadomainCustomerAssets', :'permissions' => :'String', :'priority' => :'String', :'status' => :'String', :'status_message' => :'String', :'substring_matching_enabled' => :'Boolean', :'template_priority' => :'Integer', :'topic' => :'String', :'updated_timestamp' => :'Time', :'user_id' => :'String', :'user_name' => :'String', :'user_uuid' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
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 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 369 def ==(o) return true if self.equal?(o) self.class == o.class && breach_monitor_only == o.breach_monitor_only && breach_monitoring_enabled == o.breach_monitoring_enabled && cid == o.cid && created_by == o.created_by && == o. && filter == o.filter && id == o.id && lookback_period == o.lookback_period && match_on_tsq_result_types == o.match_on_tsq_result_types && name == o.name && originating_template_id == o.originating_template_id && ownership_assets == o.ownership_assets && == o. && priority == o.priority && status == o.status && == o. && substring_matching_enabled == o.substring_matching_enabled && template_priority == o.template_priority && topic == o.topic && == o. && user_id == o.user_id && user_name == o.user_name && user_uuid == o.user_uuid end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 443 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Falcon.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
514 515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 514 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 419 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
399 400 401 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 399 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
405 406 407 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 405 def hash [breach_monitor_only, breach_monitoring_enabled, cid, created_by, , filter, id, lookback_period, match_on_tsq_result_types, name, originating_template_id, ownership_assets, , priority, status, , substring_matching_enabled, template_priority, topic, , user_id, user_name, user_uuid].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 281 def list_invalid_properties invalid_properties = Array.new if @breach_monitor_only.nil? invalid_properties.push('invalid value for "breach_monitor_only", breach_monitor_only cannot be nil.') end if @breach_monitoring_enabled.nil? invalid_properties.push('invalid value for "breach_monitoring_enabled", breach_monitoring_enabled cannot be nil.') end if @cid.nil? invalid_properties.push('invalid value for "cid", cid cannot be nil.') end if @created_timestamp.nil? invalid_properties.push('invalid value for "created_timestamp", created_timestamp cannot be nil.') end if @filter.nil? invalid_properties.push('invalid value for "filter", filter cannot be nil.') end if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @match_on_tsq_result_types.nil? invalid_properties.push('invalid value for "match_on_tsq_result_types", match_on_tsq_result_types cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @permissions.nil? invalid_properties.push('invalid value for "permissions", permissions cannot be nil.') end if @priority.nil? invalid_properties.push('invalid value for "priority", priority cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @substring_matching_enabled.nil? invalid_properties.push('invalid value for "substring_matching_enabled", substring_matching_enabled cannot be nil.') end if @topic.nil? invalid_properties.push('invalid value for "topic", topic cannot be nil.') end if @updated_timestamp.nil? invalid_properties.push('invalid value for "updated_timestamp", updated_timestamp cannot be nil.') end if @user_uuid.nil? invalid_properties.push('invalid value for "user_uuid", user_uuid cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
490 491 492 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 490 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 496 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
484 485 486 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 484 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/crimson-falcon/models/sadomain_rule.rb', line 348 def valid? return false if @breach_monitor_only.nil? return false if @breach_monitoring_enabled.nil? return false if @cid.nil? return false if @created_timestamp.nil? return false if @filter.nil? return false if @id.nil? return false if @match_on_tsq_result_types.nil? return false if @name.nil? return false if @permissions.nil? return false if @priority.nil? return false if @status.nil? return false if @substring_matching_enabled.nil? return false if @topic.nil? return false if @updated_timestamp.nil? return false if @user_uuid.nil? true end |