Class: AWSCDK::IoT::CfnSecurityProfile::BehaviorCriteriaProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
io_t/cfn_security_profile.rb

Overview

The criteria by which the behavior is determined to be normal.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(comparison_operator: nil, consecutive_datapoints_to_alarm: nil, consecutive_datapoints_to_clear: nil, duration_seconds: nil, ml_detection_config: nil, statistical_threshold: nil, value: nil) ⇒ BehaviorCriteriaProperty

Returns a new instance of BehaviorCriteriaProperty.

Parameters:

  • comparison_operator (String, nil) (defaults to: nil)

    The operator that relates the thing measured ( metric ) to the criteria (containing a value or statisticalThreshold ).

  • consecutive_datapoints_to_alarm (Numeric, nil) (defaults to: nil)

    If a device is in violation of the behavior for the specified number of consecutive datapoints, an alarm occurs.

  • consecutive_datapoints_to_clear (Numeric, nil) (defaults to: nil)

    If an alarm has occurred and the offending device is no longer in violation of the behavior for the specified number of consecutive datapoints, the alarm is cleared.

  • duration_seconds (Numeric, nil) (defaults to: nil)

    Use this to specify the time duration over which the behavior is evaluated, for those criteria that have a time dimension (for example, NUM_MESSAGES_SENT ).

  • ml_detection_config (AWSCDK::IResolvable, AWSCDK::IoT::CfnSecurityProfile::MachineLearningDetectionConfigProperty, nil) (defaults to: nil)

    The confidence level of the detection model.

  • statistical_threshold (AWSCDK::IResolvable, AWSCDK::IoT::CfnSecurityProfile::StatisticalThresholdProperty, nil) (defaults to: nil)

    A statistical ranking (percentile)that indicates a threshold value by which a behavior is determined to be in compliance or in violation of the behavior.

  • value (AWSCDK::IResolvable, AWSCDK::IoT::CfnSecurityProfile::MetricValueProperty, nil) (defaults to: nil)

    The value to be compared with the metric .



686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'io_t/cfn_security_profile.rb', line 686

def initialize(comparison_operator: nil, consecutive_datapoints_to_alarm: nil, consecutive_datapoints_to_clear: nil, duration_seconds: nil, ml_detection_config: nil, statistical_threshold: nil, value: nil)
  @comparison_operator = comparison_operator
  Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparisonOperator") unless @comparison_operator.nil?
  @consecutive_datapoints_to_alarm = consecutive_datapoints_to_alarm
  Jsii::Type.check_type(@consecutive_datapoints_to_alarm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "consecutiveDatapointsToAlarm") unless @consecutive_datapoints_to_alarm.nil?
  @consecutive_datapoints_to_clear = consecutive_datapoints_to_clear
  Jsii::Type.check_type(@consecutive_datapoints_to_clear, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "consecutiveDatapointsToClear") unless @consecutive_datapoints_to_clear.nil?
  @duration_seconds = duration_seconds
  Jsii::Type.check_type(@duration_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "durationSeconds") unless @duration_seconds.nil?
  @ml_detection_config = ml_detection_config.is_a?(Hash) ? ::AWSCDK::IoT::CfnSecurityProfile::MachineLearningDetectionConfigProperty.new(**ml_detection_config.transform_keys(&:to_sym)) : ml_detection_config
  Jsii::Type.check_type(@ml_detection_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3QuQ2ZuU2VjdXJpdHlQcm9maWxlLk1hY2hpbmVMZWFybmluZ0RldGVjdGlvbkNvbmZpZ1Byb3BlcnR5In1dfX0=")), "mlDetectionConfig") unless @ml_detection_config.nil?
  @statistical_threshold = statistical_threshold.is_a?(Hash) ? ::AWSCDK::IoT::CfnSecurityProfile::StatisticalThresholdProperty.new(**statistical_threshold.transform_keys(&:to_sym)) : statistical_threshold
  Jsii::Type.check_type(@statistical_threshold, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3QuQ2ZuU2VjdXJpdHlQcm9maWxlLlN0YXRpc3RpY2FsVGhyZXNob2xkUHJvcGVydHkifV19fQ==")), "statisticalThreshold") unless @statistical_threshold.nil?
  @value = value.is_a?(Hash) ? ::AWSCDK::IoT::CfnSecurityProfile::MetricValueProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pb3QuQ2ZuU2VjdXJpdHlQcm9maWxlLk1ldHJpY1ZhbHVlUHJvcGVydHkifV19fQ==")), "value") unless @value.nil?
end

Instance Attribute Details

#comparison_operatorString? (readonly)

The operator that relates the thing measured ( metric ) to the criteria (containing a value or statisticalThreshold ).

Valid operators include:

  • string-list : in-set and not-in-set
  • number-list : in-set and not-in-set
  • ip-address-list : in-cidr-set and not-in-cidr-set
  • number : less-than , less-than-equals , greater-than , and greater-than-equals


714
715
716
# File 'io_t/cfn_security_profile.rb', line 714

def comparison_operator
  @comparison_operator
end

#consecutive_datapoints_to_alarmNumeric? (readonly)

If a device is in violation of the behavior for the specified number of consecutive datapoints, an alarm occurs.

If not specified, the default is 1.



721
722
723
# File 'io_t/cfn_security_profile.rb', line 721

def consecutive_datapoints_to_alarm
  @consecutive_datapoints_to_alarm
end

#consecutive_datapoints_to_clearNumeric? (readonly)

If an alarm has occurred and the offending device is no longer in violation of the behavior for the specified number of consecutive datapoints, the alarm is cleared.

If not specified, the default is 1.



728
729
730
# File 'io_t/cfn_security_profile.rb', line 728

def consecutive_datapoints_to_clear
  @consecutive_datapoints_to_clear
end

#duration_secondsNumeric? (readonly)

Use this to specify the time duration over which the behavior is evaluated, for those criteria that have a time dimension (for example, NUM_MESSAGES_SENT ).

For a statistical_threshhold metric comparison, measurements from all devices are accumulated over this time duration before being used to calculate percentiles, and later, measurements from an individual device are also accumulated over this time duration before being given a percentile rank. Cannot be used with list-based metric datatypes.



735
736
737
# File 'io_t/cfn_security_profile.rb', line 735

def duration_seconds
  @duration_seconds
end

#ml_detection_configAWSCDK::IResolvable, ... (readonly)

The confidence level of the detection model.



740
741
742
# File 'io_t/cfn_security_profile.rb', line 740

def ml_detection_config
  @ml_detection_config
end

#statistical_thresholdAWSCDK::IResolvable, ... (readonly)

A statistical ranking (percentile)that indicates a threshold value by which a behavior is determined to be in compliance or in violation of the behavior.



745
746
747
# File 'io_t/cfn_security_profile.rb', line 745

def statistical_threshold
  @statistical_threshold
end

#valueAWSCDK::IResolvable, ... (readonly)

The value to be compared with the metric .



750
751
752
# File 'io_t/cfn_security_profile.rb', line 750

def value
  @value
end

Class Method Details

.jsii_propertiesObject



752
753
754
755
756
757
758
759
760
761
762
# File 'io_t/cfn_security_profile.rb', line 752

def self.jsii_properties
  {
    :comparison_operator => "comparisonOperator",
    :consecutive_datapoints_to_alarm => "consecutiveDatapointsToAlarm",
    :consecutive_datapoints_to_clear => "consecutiveDatapointsToClear",
    :duration_seconds => "durationSeconds",
    :ml_detection_config => "mlDetectionConfig",
    :statistical_threshold => "statisticalThreshold",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'io_t/cfn_security_profile.rb', line 764

def to_jsii
  result = {}
  result.merge!({
    "comparisonOperator" => @comparison_operator,
    "consecutiveDatapointsToAlarm" => @consecutive_datapoints_to_alarm,
    "consecutiveDatapointsToClear" => @consecutive_datapoints_to_clear,
    "durationSeconds" => @duration_seconds,
    "mlDetectionConfig" => @ml_detection_config,
    "statisticalThreshold" => @statistical_threshold,
    "value" => @value,
  })
  result.compact
end