Class: AWSCDK::CloudTrail::CfnEventDataStore::AdvancedFieldSelectorProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_trail/cfn_event_data_store.rb

Overview

A single selector statement in an advanced event selector.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field:, ends_with: nil, equal_to: nil, not_ends_with: nil, not_equals: nil, not_starts_with: nil, starts_with: nil) ⇒ AdvancedFieldSelectorProperty

Returns a new instance of AdvancedFieldSelectorProperty.

Parameters:

  • field (String)

    A field in a CloudTrail event record on which to filter events to be logged.

  • ends_with (Array<String>, nil) (defaults to: nil)

    An operator that includes events that match the last few characters of the event record field specified as the value of Field .

  • equal_to (Array<String>, nil) (defaults to: nil)

    An operator that includes events that match the exact value of the event record field specified as the value of Field .

  • not_ends_with (Array<String>, nil) (defaults to: nil)

    An operator that excludes events that match the last few characters of the event record field specified as the value of Field .

  • not_equals (Array<String>, nil) (defaults to: nil)

    An operator that excludes events that match the exact value of the event record field specified as the value of Field .

  • not_starts_with (Array<String>, nil) (defaults to: nil)

    An operator that excludes events that match the first few characters of the event record field specified as the value of Field .

  • starts_with (Array<String>, nil) (defaults to: nil)

    An operator that includes events that match the first few characters of the event record field specified as the value of Field .



824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
# File 'cloud_trail/cfn_event_data_store.rb', line 824

def initialize(field:, ends_with: nil, equal_to: nil, not_ends_with: nil, not_equals: nil, not_starts_with: nil, starts_with: nil)
  @field = field
  Jsii::Type.check_type(@field, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "field")
  @ends_with = ends_with
  Jsii::Type.check_type(@ends_with, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "endsWith") unless @ends_with.nil?
  @equal_to = equal_to
  Jsii::Type.check_type(@equal_to, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "equalTo") unless @equal_to.nil?
  @not_ends_with = not_ends_with
  Jsii::Type.check_type(@not_ends_with, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notEndsWith") unless @not_ends_with.nil?
  @not_equals = not_equals
  Jsii::Type.check_type(@not_equals, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notEquals") unless @not_equals.nil?
  @not_starts_with = not_starts_with
  Jsii::Type.check_type(@not_starts_with, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "notStartsWith") unless @not_starts_with.nil?
  @starts_with = starts_with
  Jsii::Type.check_type(@starts_with, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "startsWith") unless @starts_with.nil?
end

Instance Attribute Details

#ends_withArray<String>? (readonly)

An operator that includes events that match the last few characters of the event record field specified as the value of Field .



903
904
905
# File 'cloud_trail/cfn_event_data_store.rb', line 903

def ends_with
  @ends_with
end

#equal_toArray<String>? (readonly)

An operator that includes events that match the exact value of the event record field specified as the value of Field .

This is the only valid operator that you can use with the read_only , event_category , and resources.type fields.



910
911
912
# File 'cloud_trail/cfn_event_data_store.rb', line 910

def equal_to
  @equal_to
end

#fieldString (readonly)

A field in a CloudTrail event record on which to filter events to be logged.

For event data stores for CloudTrail Insights events, AWS Config configuration items, Audit Manager evidence, or events outside of AWS , the field is used only for selecting events as filtering is not supported.

For CloudTrail management events, supported fields include event_category (required), event_source , and read_only . The following additional fields are available for event data stores: event_name , event_type , session_credential_from_console , and userIdentity.arn .

For CloudTrail data events, supported fields include event_category (required), event_name , event_source , event_type , resources.type (required), read_only , resources.ARN , session_credential_from_console , and userIdentity.arn .

For CloudTrail network activity events, supported fields include event_category (required), event_source (required), event_name , error_code , and vpc_endpoint_id .

For event data stores for CloudTrail Insights events, AWS Config configuration items, Audit Manager evidence, or events outside of AWS , the only supported field is event_category .

Selectors don't support the use of wildcards like * . To match multiple values with a single condition, you may use StartsWith , EndsWith , NotStartsWith , or NotEndsWith to explicitly match the beginning or end of the event field.

  • read_only - This is an optional field that is only used for management events and data events. This field can be set to Equals with a value of true or false . If you do not add this field, CloudTrail logs both read and write events. A value of true logs only read events. A value of false logs only write events.
  • event_source - This field is only used for management events, data events, and network activity events.

For management events for trails, this is an optional field that can be set to NotEquals kms.amazonaws.com to exclude KMS management events, or NotEquals rdsdata.amazonaws.com to exclude RDS management events.

For data events for trails, this is an optional field that you can use to include or exclude any event source and can use any operator.

For management and data events for event data stores, this is an optional field that you can use to include or exclude any event source and can use any operator.

For network activity events, this is a required field that only uses the Equals operator. Set this field to the event source for which you want to log network activity events. If you want to log network activity events for multiple event sources, you must create a separate field selector for each event source. For a list of services supporting network activity events, see Logging network activity events in the AWS CloudTrail User Guide .

  • event_name - This is an optional field that is only used for data events, management events (for event data stores only), and network activity events. You can use any operator with event_name . You can use it to filter in or filter out specific events. You can have multiple values for this field, separated by commas.
  • event_category - This field is required and must be set to Equals .
  • For CloudTrail management events, the value must be Management .
  • For CloudTrail data events, the value must be Data .
  • For CloudTrail network activity events, the value must be NetworkActivity .

The following are used only for event data stores:

  • For CloudTrail Insights events, the value must be Insight .
  • For AWS Config configuration items, the value must be ConfigurationItem .
  • For Audit Manager evidence, the value must be Evidence .
  • For events outside of AWS , the value must be ActivityAuditLog .
  • event_type - For event data stores, this is an optional field available for event data stores to filter management and data events on the event type. For trails, this is an optional field to filter data events on the event type. For information about available event types, see CloudTrail record contents in the AWS CloudTrail user guide .
  • error_code - This field is only used to filter CloudTrail network activity events and is optional. This is the error code to filter on. Currently, the only valid error_code is VpceAccessDenied . error_code can only use the Equals operator.
  • session_credential_from_console - For event data stores, this is an optional field used to filter management and data events based on whether the events originated from an AWS Management Console session. For trails, this is an optional field used to filter data events. session_credential_from_console can only use the Equals and NotEquals operators.
  • resources.type - This field is required for CloudTrail data events. resources.type can only use the Equals operator.

For a list of available resource types for data events, see Data events in the AWS CloudTrail User Guide .

You can have only one resources.type field per selector. To log events on more than one resource type, add another selector.

  • resources.ARN - The resources.ARN is an optional field for data events. You can use any operator with resources.ARN , but if you use Equals or NotEquals , the value must exactly match the ARN of a valid resource of the type you've specified in the template as the value of resources.type. To log all data events for all objects in a specific S3 bucket, use the StartsWith operator, and include only the bucket ARN as the matching value.

For more information about the ARN formats of data event resources, see Actions, resources, and condition keys for AWS services in the Service Authorization Reference .

You can't use the resources.ARN field to filter resource types that do not have ARNs.

  • userIdentity.arn - For event data stores, this is an optional field used to filter management and data events for actions taken by specific IAM identities. For trails, this is an optional field used to filter data events. You can use any operator with userIdentity.arn . For more information on the userIdentity element, see CloudTrail userIdentity element in the AWS CloudTrail User Guide .
  • vpc_endpoint_id - This field is only used to filter CloudTrail network activity events and is optional. This field identifies the VPC endpoint that the request passed through. You can use any operator with vpc_endpoint_id .


898
899
900
# File 'cloud_trail/cfn_event_data_store.rb', line 898

def field
  @field
end

#not_ends_withArray<String>? (readonly)

An operator that excludes events that match the last few characters of the event record field specified as the value of Field .



915
916
917
# File 'cloud_trail/cfn_event_data_store.rb', line 915

def not_ends_with
  @not_ends_with
end

#not_equalsArray<String>? (readonly)

An operator that excludes events that match the exact value of the event record field specified as the value of Field .



920
921
922
# File 'cloud_trail/cfn_event_data_store.rb', line 920

def not_equals
  @not_equals
end

#not_starts_withArray<String>? (readonly)

An operator that excludes events that match the first few characters of the event record field specified as the value of Field .



925
926
927
# File 'cloud_trail/cfn_event_data_store.rb', line 925

def not_starts_with
  @not_starts_with
end

#starts_withArray<String>? (readonly)

An operator that includes events that match the first few characters of the event record field specified as the value of Field .



930
931
932
# File 'cloud_trail/cfn_event_data_store.rb', line 930

def starts_with
  @starts_with
end

Class Method Details

.jsii_propertiesObject



932
933
934
935
936
937
938
939
940
941
942
# File 'cloud_trail/cfn_event_data_store.rb', line 932

def self.jsii_properties
  {
    :field => "field",
    :ends_with => "endsWith",
    :equal_to => "equalTo",
    :not_ends_with => "notEndsWith",
    :not_equals => "notEquals",
    :not_starts_with => "notStartsWith",
    :starts_with => "startsWith",
  }
end

Instance Method Details

#to_jsiiObject



944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'cloud_trail/cfn_event_data_store.rb', line 944

def to_jsii
  result = {}
  result.merge!({
    "field" => @field,
    "endsWith" => @ends_with,
    "equalTo" => @equal_to,
    "notEndsWith" => @not_ends_with,
    "notEquals" => @not_equals,
    "notStartsWith" => @not_starts_with,
    "startsWith" => @starts_with,
  })
  result.compact
end