Class: AWSCDK::SecurityHub::CfnAutomationRuleProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
security_hub/cfn_automation_rule_props.rb

Overview

Properties for defining a CfnAutomationRule.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(actions:, criteria:, description:, rule_name:, rule_order:, is_terminal: nil, rule_status: nil, tags: nil) ⇒ CfnAutomationRuleProps

Returns a new instance of CfnAutomationRuleProps.

Parameters:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'security_hub/cfn_automation_rule_props.rb', line 17

def initialize(actions:, criteria:, description:, rule_name:, rule_order:, is_terminal: nil, rule_status: nil, tags: nil)
  @actions = actions
  Jsii::Type.check_type(@actions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjdXJpdHlodWIuQ2ZuQXV0b21hdGlvblJ1bGUuQXV0b21hdGlvblJ1bGVzQWN0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "actions")
  @criteria = criteria.is_a?(Hash) ? ::AWSCDK::SecurityHub::CfnAutomationRule::AutomationRulesFindingFiltersProperty.new(**criteria.transform_keys(&:to_sym)) : criteria
  Jsii::Type.check_type(@criteria, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zZWN1cml0eWh1Yi5DZm5BdXRvbWF0aW9uUnVsZS5BdXRvbWF0aW9uUnVsZXNGaW5kaW5nRmlsdGVyc1Byb3BlcnR5In1dfX0=")), "criteria")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description")
  @rule_name = rule_name
  Jsii::Type.check_type(@rule_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleName")
  @rule_order = rule_order
  Jsii::Type.check_type(@rule_order, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "ruleOrder")
  @is_terminal = is_terminal
  Jsii::Type.check_type(@is_terminal, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "isTerminal") unless @is_terminal.nil?
  @rule_status = rule_status
  Jsii::Type.check_type(@rule_status, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ruleStatus") unless @rule_status.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
end

Instance Attribute Details

#actionsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::SecurityHub::CfnAutomationRule::AutomationRulesActionProperty> (readonly)

One or more actions to update finding fields if a finding matches the conditions specified in Criteria .



40
41
42
# File 'security_hub/cfn_automation_rule_props.rb', line 40

def actions
  @actions
end

#criteriaAWSCDK::IResolvable, AWSCDK::SecurityHub::CfnAutomationRule::AutomationRulesFindingFiltersProperty (readonly)

A set of AWS Security Finding Format (ASFF) finding field attributes and corresponding expected values that Security Hub CSPM uses to filter findings. If a rule is enabled and a finding matches the criteria specified in this parameter, Security Hub CSPM applies the rule action to the finding.



45
46
47
# File 'security_hub/cfn_automation_rule_props.rb', line 45

def criteria
  @criteria
end

#descriptionString (readonly)

A description of the rule.



50
51
52
# File 'security_hub/cfn_automation_rule_props.rb', line 50

def description
  @description
end

#is_terminalBoolean, ... (readonly)

Specifies whether a rule is the last to be applied with respect to a finding that matches the rule criteria.

This is useful when a finding matches the criteria for multiple rules, and each rule has different actions. If a rule is terminal, Security Hub CSPM applies the rule action to a finding that matches the rule criteria and doesn't evaluate other rules for the finding. By default, a rule isn't terminal.



69
70
71
# File 'security_hub/cfn_automation_rule_props.rb', line 69

def is_terminal
  @is_terminal
end

#rule_nameString (readonly)

The name of the rule.



55
56
57
# File 'security_hub/cfn_automation_rule_props.rb', line 55

def rule_name
  @rule_name
end

#rule_orderNumeric (readonly)

An integer ranging from 1 to 1000 that represents the order in which the rule action is applied to findings.

Security Hub CSPM applies rules with lower values for this parameter first.



62
63
64
# File 'security_hub/cfn_automation_rule_props.rb', line 62

def rule_order
  @rule_order
end

#rule_statusString? (readonly)

Whether the rule is active after it is created.

If this parameter is equal to ENABLED , Security Hub CSPM applies the rule to findings and finding updates after the rule is created.



76
77
78
# File 'security_hub/cfn_automation_rule_props.rb', line 76

def rule_status
  @rule_status
end

#tagsHash{String => String}? (readonly)

User-defined tags associated with an automation rule.



81
82
83
# File 'security_hub/cfn_automation_rule_props.rb', line 81

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



83
84
85
86
87
88
89
90
91
92
93
94
# File 'security_hub/cfn_automation_rule_props.rb', line 83

def self.jsii_properties
  {
    :actions => "actions",
    :criteria => "criteria",
    :description => "description",
    :rule_name => "ruleName",
    :rule_order => "ruleOrder",
    :is_terminal => "isTerminal",
    :rule_status => "ruleStatus",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'security_hub/cfn_automation_rule_props.rb', line 96

def to_jsii
  result = {}
  result.merge!({
    "actions" => @actions,
    "criteria" => @criteria,
    "description" => @description,
    "ruleName" => @rule_name,
    "ruleOrder" => @rule_order,
    "isTerminal" => @is_terminal,
    "ruleStatus" => @rule_status,
    "tags" => @tags,
  })
  result.compact
end