Class: AWSCDK::SecurityHub::CfnAutomationRule::StringFilterProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::SecurityHub::CfnAutomationRule::StringFilterProperty
- Defined in:
- security_hub/cfn_automation_rule.rb
Overview
A string filter for filtering AWS Security Hub CSPM findings.
Instance Attribute Summary collapse
-
#comparison ⇒ String
readonly
The condition to apply to a string value when filtering Security Hub CSPM findings.
-
#value ⇒ String
readonly
The string filter value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(comparison:, value:) ⇒ StringFilterProperty
constructor
A new instance of StringFilterProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(comparison:, value:) ⇒ StringFilterProperty
Returns a new instance of StringFilterProperty.
1648 1649 1650 1651 1652 1653 |
# File 'security_hub/cfn_automation_rule.rb', line 1648 def initialize(comparison:, value:) @comparison = comparison Jsii::Type.check_type(@comparison, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparison") @value = value Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") end |
Instance Attribute Details
#comparison ⇒ String (readonly)
The condition to apply to a string value when filtering Security Hub CSPM findings.
To search for values that have the filter value, use one of the following comparison operators:
- To search for values that include the filter value, use
CONTAINS. For example, the filterTitle CONTAINS CloudFrontmatches findings that have aTitlethat includes the string CloudFront. - To search for values that exactly match the filter value, use
EQUALS. For example, the filterAwsAccountId EQUALS 123456789012only matches findings that have an account ID of123456789012. - To search for values that start with the filter value, use
PREFIX. For example, the filterResourceRegion PREFIX usmatches findings that have aResourceRegionthat starts withus. AResourceRegionthat starts with a different value, such asaf,ap, orca, doesn't match.
CONTAINS , EQUALS , and PREFIX filters on the same field are joined by OR . A finding matches if it matches any one of those filters. For example, the filters Title CONTAINS CloudFront OR Title CONTAINS CloudWatch match a finding that includes either CloudFront , CloudWatch , or both strings in the title.
To search for values that don’t have the filter value, use one of the following comparison operators:
- To search for values that exclude the filter value, use
NOT_CONTAINS. For example, the filterTitle NOT_CONTAINS CloudFrontmatches findings that have aTitlethat excludes the string CloudFront. - To search for values other than the filter value, use
NOT_EQUALS. For example, the filterAwsAccountId NOT_EQUALS 123456789012only matches findings that have an account ID other than123456789012. - To search for values that don't start with the filter value, use
PREFIX_NOT_EQUALS. For example, the filterResourceRegion PREFIX_NOT_EQUALS usmatches findings with aResourceRegionthat starts with a value other thanus.
NOT_CONTAINS , NOT_EQUALS , and PREFIX_NOT_EQUALS filters on the same field are joined by AND . A finding matches only if it matches all of those filters. For example, the filters Title NOT_CONTAINS CloudFront AND Title NOT_CONTAINS CloudWatch match a finding that excludes both CloudFront and CloudWatch in the title.
You can’t have both a CONTAINS filter and a NOT_CONTAINS filter on the same field. Similarly, you can't provide both an EQUALS filter and a NOT_EQUALS or PREFIX_NOT_EQUALS filter on the same field. Combining filters in this way returns an error. CONTAINS filters can only be used with other CONTAINS filters. NOT_CONTAINS filters can only be used with other NOT_CONTAINS filters.
You can combine PREFIX filters with NOT_EQUALS or PREFIX_NOT_EQUALS filters for the same field. Security Hub CSPM first processes the PREFIX filters, and then the NOT_EQUALS or PREFIX_NOT_EQUALS filters.
For example, for the following filters, Security Hub CSPM first identifies findings that have resource types that start with either AwsIam or AwsEc2 . It then excludes findings that have a resource type of AwsIamPolicy and findings that have a resource type of AwsEc2NetworkInterface .
ResourceType PREFIX AwsIamResourceType PREFIX AwsEc2ResourceType NOT_EQUALS AwsIamPolicyResourceType NOT_EQUALS AwsEc2NetworkInterface
CONTAINS and NOT_CONTAINS operators can be used only with automation rules V1. CONTAINS_WORD operator is only supported in GetFindingsV2 , GetFindingStatisticsV2 , GetResourcesV2 , and GetResourceStatisticsV2 APIs. For more information, see Automation rules in the AWS Security Hub CSPM User Guide .
1688 1689 1690 |
# File 'security_hub/cfn_automation_rule.rb', line 1688 def comparison @comparison end |
#value ⇒ String (readonly)
The string filter value.
Filter values are case sensitive. For example, the product name for control-based findings is Security Hub CSPM . If you provide security hub as the filter value, there's no match.
1695 1696 1697 |
# File 'security_hub/cfn_automation_rule.rb', line 1695 def value @value end |
Class Method Details
.jsii_properties ⇒ Object
1697 1698 1699 1700 1701 1702 |
# File 'security_hub/cfn_automation_rule.rb', line 1697 def self.jsii_properties { :comparison => "comparison", :value => "value", } end |
Instance Method Details
#to_jsii ⇒ Object
1704 1705 1706 1707 1708 1709 1710 1711 |
# File 'security_hub/cfn_automation_rule.rb', line 1704 def to_jsii result = {} result.merge!({ "comparison" => @comparison, "value" => @value, }) result.compact end |