CfnRuleGroupPropsMixin
- class aws_cdk.mixins_preview.aws_networkfirewall.mixins.CfnRuleGroupPropsMixin(props, *, strategy=None)
Bases:
MixinUse the ` <https://docs.aws.amazon.com/RuleGroup>`_ to define a reusable collection of stateless or stateful network traffic filtering rules. You use rule groups in an firewall policy to specify the filtering behavior of an firewall.
- See:
- CloudformationResource:
AWS::NetworkFirewall::RuleGroup
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins cfn_rule_group_props_mixin = networkfirewall_mixins.CfnRuleGroupPropsMixin(networkfirewall_mixins.CfnRuleGroupMixinProps( capacity=123, description="description", rule_group=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleGroupProperty( reference_sets=networkfirewall_mixins.CfnRuleGroupPropsMixin.ReferenceSetsProperty( ip_set_references={ "ip_set_references_key": { "reference_arn": "referenceArn" } } ), rules_source=networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceProperty( rules_source_list=networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceListProperty( generated_rules_type="generatedRulesType", targets=["targets"], target_types=["targetTypes"] ), rules_string="rulesString", stateful_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleProperty( action="action", header=networkfirewall_mixins.CfnRuleGroupPropsMixin.HeaderProperty( destination="destination", destination_port="destinationPort", direction="direction", protocol="protocol", source="source", source_port="sourcePort" ), rule_options=[networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleOptionProperty( keyword="keyword", settings=["settings"] )] )], stateless_rules_and_custom_actions=networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRulesAndCustomActionsProperty( custom_actions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.CustomActionProperty( action_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.ActionDefinitionProperty( publish_metric_action=networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] ) ), action_name="actionName" )], stateless_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRuleProperty( priority=123, rule_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleDefinitionProperty( actions=["actions"], match_attributes=networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] ) ) )] ) ), rule_variables=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleVariablesProperty( ip_sets={ "ip_sets_key": { "definition": ["definition"] } }, port_sets={ "port_sets_key": networkfirewall_mixins.CfnRuleGroupPropsMixin.PortSetProperty( definition=["definition"] ) } ), stateful_rule_options=networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleOptionsProperty( rule_order="ruleOrder" ) ), rule_group_name="ruleGroupName", summary_configuration=networkfirewall_mixins.CfnRuleGroupPropsMixin.SummaryConfigurationProperty( rule_options=["ruleOptions"] ), tags=[CfnTag( key="key", value="value" )], type="type" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::NetworkFirewall::RuleGroup.- Parameters:
props (
Union[CfnRuleGroupMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['capacity', 'description', 'ruleGroup', 'ruleGroupName', 'summaryConfiguration', 'tags', 'type']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
ActionDefinitionProperty
- class CfnRuleGroupPropsMixin.ActionDefinitionProperty(*, publish_metric_action=None)
Bases:
objectA custom action to use in stateless rule actions settings.
- Parameters:
publish_metric_action (
Union[IResolvable,PublishMetricActionProperty,Dict[str,Any],None]) – Stateless inspection criteria that publishes the specified metrics to Amazon CloudWatch for the matching packet. This setting defines a CloudWatch dimension value to be published. You can pair this custom action with any of the standard stateless rule actions. For example, you could pair this in a rule action with the standard action that forwards the packet for stateful inspection. Then, when a packet matches the rule, Network Firewall publishes metrics for the packet and forwards it.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins action_definition_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.ActionDefinitionProperty( publish_metric_action=networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] ) )
Attributes
- publish_metric_action
Stateless inspection criteria that publishes the specified metrics to Amazon CloudWatch for the matching packet.
This setting defines a CloudWatch dimension value to be published.
You can pair this custom action with any of the standard stateless rule actions. For example, you could pair this in a rule action with the standard action that forwards the packet for stateful inspection. Then, when a packet matches the rule, Network Firewall publishes metrics for the packet and forwards it.
AddressProperty
- class CfnRuleGroupPropsMixin.AddressProperty(*, address_definition=None)
Bases:
objectA single IP address specification.
This is used in the match attributes source and destination specifications.
- Parameters:
address_definition (
Optional[str]) – Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network Firewall supports all address ranges for IPv4 and IPv6. Examples: - To configure Network Firewall to inspect for the IP address 192.0.2.44, specify192.0.2.44/32. - To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify192.0.2.0/24. - To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify1111:0000:0000:0000:0000:0000:0000:0111/128. - To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify1111:0000:0000:0000:0000:0000:0000:0000/64. For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins address_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )
Attributes
- address_definition
Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation.
Network Firewall supports all address ranges for IPv4 and IPv6.
Examples:
To configure Network Firewall to inspect for the IP address 192.0.2.44, specify
192.0.2.44/32.To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
192.0.2.0/24.To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
1111:0000:0000:0000:0000:0000:0000:0111/128.To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
1111:0000:0000:0000:0000:0000:0000:0000/64.
For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
CustomActionProperty
- class CfnRuleGroupPropsMixin.CustomActionProperty(*, action_definition=None, action_name=None)
Bases:
objectAn optional, non-standard action to use for stateless packet handling.
You can define this in addition to the standard action that you must specify.
You define and name the custom actions that you want to be able to use, and then you reference them by name in your actions settings.
You can use custom actions in the following places:
In a
StatelessRulesAndCustomActions. The custom actions are available for use by name inside theStatelessRulesAndCustomActionswhere you define them. You can use them for your stateless rule actions to specify what to do with a packet that matches the rule’s match attributes.In an firewall policy specification, in
StatelessCustomActions. The custom actions are available for use inside the policy where you define them. You can use them for the policy’s default stateless actions settings to specify what to do with packets that don’t match any of the policy’s stateless rules.
- Parameters:
action_definition (
Union[IResolvable,ActionDefinitionProperty,Dict[str,Any],None]) – The custom action associated with the action name.action_name (
Optional[str]) – The descriptive name of the custom action. You can’t change the name of a custom action after you create it.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins custom_action_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.CustomActionProperty( action_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.ActionDefinitionProperty( publish_metric_action=networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] ) ), action_name="actionName" )
Attributes
- action_definition
The custom action associated with the action name.
- action_name
The descriptive name of the custom action.
You can’t change the name of a custom action after you create it.
DimensionProperty
- class CfnRuleGroupPropsMixin.DimensionProperty(*, value=None)
Bases:
objectThe value to use in an Amazon CloudWatch custom metric dimension.
This is used in the
PublishMetricscustom action. A CloudWatch custom metric dimension is a name/value pair that’s part of the identity of a metric.AWS Network Firewall sets the dimension name to
CustomActionand you provide the dimension value.For more information about CloudWatch custom metric dimensions, see Publishing Custom Metrics in the Amazon CloudWatch User Guide .
- Parameters:
value (
Optional[str]) – The value to use in the custom metric dimension.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins dimension_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )
Attributes
- value
The value to use in the custom metric dimension.
HeaderProperty
- class CfnRuleGroupPropsMixin.HeaderProperty(*, destination=None, destination_port=None, direction=None, protocol=None, source=None, source_port=None)
Bases:
objectThe 5-tuple criteria for AWS Network Firewall to use to inspect packet headers in stateful traffic flow inspection.
Traffic flows that match the criteria are a match for the corresponding stateful rule.
- Parameters:
destination (
Optional[str]) –The destination IP address or address range to inspect for, in CIDR notation. To match with any address, specify
ANY. Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network Firewall supports all address ranges for IPv4 and IPv6. Examples: - To configure Network Firewall to inspect for the IP address 192.0.2.44, specify192.0.2.44/32. - To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify192.0.2.0/24. - To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify1111:0000:0000:0000:0000:0000:0000:0111/128. - To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify1111:0000:0000:0000:0000:0000:0000:0000/64. For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .destination_port (
Optional[str]) – The destination port to inspect for. You can specify an individual port, for example1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY.direction (
Optional[str]) – The direction of traffic flow to inspect. If set toANY, the inspection matches bidirectional traffic, both from the source to the destination and from the destination to the source. If set toFORWARD, the inspection only matches traffic going from the source to the destination.protocol (
Optional[str]) – The protocol to inspect for. To specify all, you can useIP, because all traffic on AWS and on the internet is IP.source (
Optional[str]) –The source IP address or address range to inspect for, in CIDR notation. To match with any address, specify
ANY. Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network Firewall supports all address ranges for IPv4 and IPv6. Examples: - To configure Network Firewall to inspect for the IP address 192.0.2.44, specify192.0.2.44/32. - To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify192.0.2.0/24. - To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify1111:0000:0000:0000:0000:0000:0000:0111/128. - To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify1111:0000:0000:0000:0000:0000:0000:0000/64. For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .source_port (
Optional[str]) – The source port to inspect for. You can specify an individual port, for example1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins header_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.HeaderProperty( destination="destination", destination_port="destinationPort", direction="direction", protocol="protocol", source="source", source_port="sourcePort" )
Attributes
- destination
The destination IP address or address range to inspect for, in CIDR notation.
To match with any address, specify
ANY.Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network Firewall supports all address ranges for IPv4 and IPv6.
Examples:
To configure Network Firewall to inspect for the IP address 192.0.2.44, specify
192.0.2.44/32.To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
192.0.2.0/24.To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
1111:0000:0000:0000:0000:0000:0000:0111/128.To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
1111:0000:0000:0000:0000:0000:0000:0000/64.
For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
- destination_port
The destination port to inspect for.
You can specify an individual port, for example
1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY.
- direction
The direction of traffic flow to inspect.
If set to
ANY, the inspection matches bidirectional traffic, both from the source to the destination and from the destination to the source. If set toFORWARD, the inspection only matches traffic going from the source to the destination.
- protocol
The protocol to inspect for.
To specify all, you can use
IP, because all traffic on AWS and on the internet is IP.
- source
The source IP address or address range to inspect for, in CIDR notation.
To match with any address, specify
ANY.Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network Firewall supports all address ranges for IPv4 and IPv6.
Examples:
To configure Network Firewall to inspect for the IP address 192.0.2.44, specify
192.0.2.44/32.To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
192.0.2.0/24.To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
1111:0000:0000:0000:0000:0000:0000:0111/128.To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify
1111:0000:0000:0000:0000:0000:0000:0000/64.
For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing .
- source_port
The source port to inspect for.
You can specify an individual port, for example
1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY.
IPSetProperty
- class CfnRuleGroupPropsMixin.IPSetProperty(*, definition=None)
Bases:
objectA list of IP addresses and address ranges, in CIDR notation.
This is part of a
RuleVariables.- Parameters:
definition (
Optional[Sequence[str]]) – The list of IP addresses and address ranges, in CIDR notation.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins i_pSet_property = { "definition": ["definition"] }
Attributes
- definition
The list of IP addresses and address ranges, in CIDR notation.
IPSetReferenceProperty
- class CfnRuleGroupPropsMixin.IPSetReferenceProperty(*, reference_arn=None)
Bases:
objectConfigures one or more IP set references for a Suricata-compatible rule group.
An IP set reference is a rule variable that references a resource that you create and manage in another AWS service, such as an Amazon VPC prefix list. Network Firewall IP set references enable you to dynamically update the contents of your rules. When you create, update, or delete the IP set you are referencing in your rule, Network Firewall automatically updates the rule’s content with the changes. For more information about IP set references in Network Firewall , see Using IP set references in the Network Firewall Developer Guide .
- Parameters:
reference_arn (
Optional[str]) – The Amazon Resource Name (ARN) of the resource to include in the IP set reference.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins i_pSet_reference_property = { "reference_arn": "referenceArn" }
Attributes
- reference_arn
The Amazon Resource Name (ARN) of the resource to include in the IP set reference.
MatchAttributesProperty
- class CfnRuleGroupPropsMixin.MatchAttributesProperty(*, destination_ports=None, destinations=None, protocols=None, source_ports=None, sources=None, tcp_flags=None)
Bases:
objectCriteria for Network Firewall to use to inspect an individual packet in stateless rule inspection.
Each match attributes set can include one or more items such as IP address, CIDR range, port number, protocol, and TCP flags.
- Parameters:
destination_ports (
Union[IResolvable,Sequence[Union[IResolvable,PortRangeProperty,Dict[str,Any]]],None]) – The destination port to inspect for. You can specify an individual port, for example1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY. This setting is only used for protocols 6 (TCP) and 17 (UDP).destinations (
Union[IResolvable,Sequence[Union[IResolvable,AddressProperty,Dict[str,Any]]],None]) – The destination IP addresses and address ranges to inspect for, in CIDR notation. If not specified, this matches with any destination address.protocols (
Union[Sequence[Union[int,float]],IResolvable,None]) – The protocols to inspect for, specified using the assigned internet protocol number (IANA) for each protocol. If not specified, this matches with any protocol.source_ports (
Union[IResolvable,Sequence[Union[IResolvable,PortRangeProperty,Dict[str,Any]]],None]) – The source port to inspect for. You can specify an individual port, for example1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY. If not specified, this matches with any source port. This setting is only used for protocols 6 (TCP) and 17 (UDP).sources (
Union[IResolvable,Sequence[Union[IResolvable,AddressProperty,Dict[str,Any]]],None]) – The source IP addresses and address ranges to inspect for, in CIDR notation. If not specified, this matches with any source address.tcp_flags (
Union[IResolvable,Sequence[Union[IResolvable,TCPFlagFieldProperty,Dict[str,Any]]],None]) – The TCP flags and masks to inspect for. If not specified, this matches with any settings. This setting is only used for protocol 6 (TCP).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins match_attributes_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] )
Attributes
- destination_ports
The destination port to inspect for.
You can specify an individual port, for example
1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY.This setting is only used for protocols 6 (TCP) and 17 (UDP).
- destinations
The destination IP addresses and address ranges to inspect for, in CIDR notation.
If not specified, this matches with any destination address.
- protocols
The protocols to inspect for, specified using the assigned internet protocol number (IANA) for each protocol.
If not specified, this matches with any protocol.
- source_ports
The source port to inspect for.
You can specify an individual port, for example
1994and you can specify a port range, for example1990:1994. To match with any port, specifyANY.If not specified, this matches with any source port.
This setting is only used for protocols 6 (TCP) and 17 (UDP).
- sources
The source IP addresses and address ranges to inspect for, in CIDR notation.
If not specified, this matches with any source address.
- tcp_flags
The TCP flags and masks to inspect for.
If not specified, this matches with any settings. This setting is only used for protocol 6 (TCP).
PortRangeProperty
- class CfnRuleGroupPropsMixin.PortRangeProperty(*, from_port=None, to_port=None)
Bases:
objectA single port range specification.
This is used for source and destination port ranges in the stateless match attributes.
- Parameters:
from_port (
Union[int,float,None]) – The lower limit of the port range. This must be less than or equal to theToPortspecification.to_port (
Union[int,float,None]) – The upper limit of the port range. This must be greater than or equal to theFromPortspecification.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins port_range_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )
Attributes
- from_port
The lower limit of the port range.
This must be less than or equal to the
ToPortspecification.
- to_port
The upper limit of the port range.
This must be greater than or equal to the
FromPortspecification.
PortSetProperty
- class CfnRuleGroupPropsMixin.PortSetProperty(*, definition=None)
Bases:
objectA set of port ranges for use in the rules in a rule group.
- Parameters:
definition (
Optional[Sequence[str]]) – The set of port ranges.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins port_set_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.PortSetProperty( definition=["definition"] )
Attributes
PublishMetricActionProperty
- class CfnRuleGroupPropsMixin.PublishMetricActionProperty(*, dimensions=None)
Bases:
objectStateless inspection criteria that publishes the specified metrics to Amazon CloudWatch for the matching packet.
This setting defines a CloudWatch dimension value to be published.
- Parameters:
dimensions (
Union[IResolvable,Sequence[Union[IResolvable,DimensionProperty,Dict[str,Any]]],None])- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins publish_metric_action_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] )
Attributes
ReferenceSetsProperty
- class CfnRuleGroupPropsMixin.ReferenceSetsProperty(*, ip_set_references=None)
Bases:
objectConfigures the reference sets for a stateful rule group.
For more information, see the Using IP set references in Suricata compatible rule groups in the Network Firewall User Guide .
- Parameters:
ip_set_references (
Union[IResolvable,Mapping[str,Union[IResolvable,IPSetReferenceProperty,Dict[str,Any]]],None]) – The IP set references to use in the stateful rule group.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins reference_sets_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.ReferenceSetsProperty( ip_set_references={ "ip_set_references_key": { "reference_arn": "referenceArn" } } )
Attributes
- ip_set_references
The IP set references to use in the stateful rule group.
RuleDefinitionProperty
- class CfnRuleGroupPropsMixin.RuleDefinitionProperty(*, actions=None, match_attributes=None)
Bases:
objectThe inspection criteria and action for a single stateless rule.
AWS Network Firewall inspects each packet for the specified matching criteria. When a packet matches the criteria, Network Firewall performs the rule’s actions on the packet.
- Parameters:
actions (
Optional[Sequence[str]]) – The actions to take on a packet that matches one of the stateless rule definition’s match attributes. You must specify a standard action and you can add custom actions. .. epigraph:: Network Firewall only forwards a packet for stateful rule inspection if you specifyaws:forward_to_sfefor a rule that the packet matches, or if the packet doesn’t match any stateless rule and you specifyaws:forward_to_sfefor theStatelessDefaultActionssetting for the firewall policy. For every rule, you must specify exactly one of the following standard actions. - aws:pass - Discontinues all inspection of the packet and permits it to go to its intended destination. - aws:drop - Discontinues all inspection of the packet and blocks it from going to its intended destination. - aws:forward_to_sfe - Discontinues stateless inspection of the packet and forwards it to the stateful rule engine for inspection. Additionally, you can specify a custom action. To do this, you define a custom action by name and type, then provide the name you’ve assigned to the action in thisActionssetting. To provide more than one action in this setting, separate the settings with a comma. For example, if you have a publish metrics custom action that you’ve namedMyMetricsAction, then you could specify the standard actionaws:passcombined with the custom action using[“aws:pass”, “MyMetricsAction”].match_attributes (
Union[IResolvable,MatchAttributesProperty,Dict[str,Any],None]) – Criteria for Network Firewall to use to inspect an individual packet in stateless rule inspection. Each match attributes set can include one or more items such as IP address, CIDR range, port number, protocol, and TCP flags.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins rule_definition_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleDefinitionProperty( actions=["actions"], match_attributes=networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] ) )
Attributes
- actions
The actions to take on a packet that matches one of the stateless rule definition’s match attributes.
You must specify a standard action and you can add custom actions. .. epigraph:
Network Firewall only forwards a packet for stateful rule inspection if you specify ``aws:forward_to_sfe`` for a rule that the packet matches, or if the packet doesn't match any stateless rule and you specify ``aws:forward_to_sfe`` for the ``StatelessDefaultActions`` setting for the firewall policy.
For every rule, you must specify exactly one of the following standard actions.
aws:pass - Discontinues all inspection of the packet and permits it to go to its intended destination.
aws:drop - Discontinues all inspection of the packet and blocks it from going to its intended destination.
aws:forward_to_sfe - Discontinues stateless inspection of the packet and forwards it to the stateful rule engine for inspection.
Additionally, you can specify a custom action. To do this, you define a custom action by name and type, then provide the name you’ve assigned to the action in this
Actionssetting.To provide more than one action in this setting, separate the settings with a comma. For example, if you have a publish metrics custom action that you’ve named
MyMetricsAction, then you could specify the standard actionaws:passcombined with the custom action using[“aws:pass”, “MyMetricsAction”].
- match_attributes
Criteria for Network Firewall to use to inspect an individual packet in stateless rule inspection.
Each match attributes set can include one or more items such as IP address, CIDR range, port number, protocol, and TCP flags.
RuleGroupProperty
- class CfnRuleGroupPropsMixin.RuleGroupProperty(*, reference_sets=None, rules_source=None, rule_variables=None, stateful_rule_options=None)
Bases:
objectThe object that defines the rules in a rule group.
AWS Network Firewall uses a rule group to inspect and control network traffic. You define stateless rule groups to inspect individual packets and you define stateful rule groups to inspect packets in the context of their traffic flow.
To use a rule group, you include it by reference in an Network Firewall firewall policy, then you use the policy in a firewall. You can reference a rule group from more than one firewall policy, and you can use a firewall policy in more than one firewall.
- Parameters:
reference_sets (
Union[IResolvable,ReferenceSetsProperty,Dict[str,Any],None]) – The reference sets for the stateful rule group.rules_source (
Union[IResolvable,RulesSourceProperty,Dict[str,Any],None]) – The stateful rules or stateless rules for the rule group.rule_variables (
Union[IResolvable,RuleVariablesProperty,Dict[str,Any],None]) – Settings that are available for use in the rules in the rule group. You can only use these for stateful rule groups.stateful_rule_options (
Union[IResolvable,StatefulRuleOptionsProperty,Dict[str,Any],None]) – Additional options governing how Network Firewall handles stateful rules. The policies where you use your stateful rule group must have stateful rule options settings that are compatible with these settings. Some limitations apply; for more information, see Strict evaluation order in the AWS Network Firewall Developer Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins rule_group_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleGroupProperty( reference_sets=networkfirewall_mixins.CfnRuleGroupPropsMixin.ReferenceSetsProperty( ip_set_references={ "ip_set_references_key": { "reference_arn": "referenceArn" } } ), rules_source=networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceProperty( rules_source_list=networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceListProperty( generated_rules_type="generatedRulesType", targets=["targets"], target_types=["targetTypes"] ), rules_string="rulesString", stateful_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleProperty( action="action", header=networkfirewall_mixins.CfnRuleGroupPropsMixin.HeaderProperty( destination="destination", destination_port="destinationPort", direction="direction", protocol="protocol", source="source", source_port="sourcePort" ), rule_options=[networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleOptionProperty( keyword="keyword", settings=["settings"] )] )], stateless_rules_and_custom_actions=networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRulesAndCustomActionsProperty( custom_actions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.CustomActionProperty( action_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.ActionDefinitionProperty( publish_metric_action=networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] ) ), action_name="actionName" )], stateless_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRuleProperty( priority=123, rule_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleDefinitionProperty( actions=["actions"], match_attributes=networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] ) ) )] ) ), rule_variables=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleVariablesProperty( ip_sets={ "ip_sets_key": { "definition": ["definition"] } }, port_sets={ "port_sets_key": networkfirewall_mixins.CfnRuleGroupPropsMixin.PortSetProperty( definition=["definition"] ) } ), stateful_rule_options=networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleOptionsProperty( rule_order="ruleOrder" ) )
Attributes
- reference_sets
The reference sets for the stateful rule group.
- rule_variables
Settings that are available for use in the rules in the rule group.
You can only use these for stateful rule groups.
- rules_source
The stateful rules or stateless rules for the rule group.
- stateful_rule_options
Additional options governing how Network Firewall handles stateful rules.
The policies where you use your stateful rule group must have stateful rule options settings that are compatible with these settings. Some limitations apply; for more information, see Strict evaluation order in the AWS Network Firewall Developer Guide .
RuleOptionProperty
- class CfnRuleGroupPropsMixin.RuleOptionProperty(*, keyword=None, settings=None)
Bases:
objectAdditional settings for a stateful rule.
- Parameters:
keyword (
Optional[str]) – The Suricata rule option keywords. For Network Firewall , the keyword signature ID (sid) is required in the formatsid:112233. The sid must be unique within the rule group. For information about Suricata rule option keywords, see Rule options .settings (
Optional[Sequence[str]]) –The Suricata rule option settings. Settings have zero or more values, and the number of possible settings and required settings depends on the keyword. The format for Settings is
number. For information about Suricata rule option settings, see Rule options .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins rule_option_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleOptionProperty( keyword="keyword", settings=["settings"] )
Attributes
- keyword
The Suricata rule option keywords.
For Network Firewall , the keyword signature ID (sid) is required in the format
sid:112233. The sid must be unique within the rule group. For information about Suricata rule option keywords, see Rule options .
- settings
The Suricata rule option settings.
Settings have zero or more values, and the number of possible settings and required settings depends on the keyword. The format for Settings is
number. For information about Suricata rule option settings, see Rule options .
RuleVariablesProperty
- class CfnRuleGroupPropsMixin.RuleVariablesProperty(*, ip_sets=None, port_sets=None)
Bases:
objectSettings that are available for use in the rules in the rule group where this is defined.
- Parameters:
ip_sets (
Union[IResolvable,Mapping[str,Union[IResolvable,IPSetProperty,Dict[str,Any]]],None]) – A list of IP addresses and address ranges, in CIDR notation.port_sets (
Union[IResolvable,Mapping[str,Union[IResolvable,PortSetProperty,Dict[str,Any]]],None]) – A list of port ranges.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins rule_variables_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleVariablesProperty( ip_sets={ "ip_sets_key": { "definition": ["definition"] } }, port_sets={ "port_sets_key": networkfirewall_mixins.CfnRuleGroupPropsMixin.PortSetProperty( definition=["definition"] ) } )
Attributes
- ip_sets
A list of IP addresses and address ranges, in CIDR notation.
RulesSourceListProperty
- class CfnRuleGroupPropsMixin.RulesSourceListProperty(*, generated_rules_type=None, targets=None, target_types=None)
Bases:
objectStateful inspection criteria for a domain list rule group.
For HTTPS traffic, domain filtering is SNI-based. It uses the server name indicator extension of the TLS handshake.
By default, Network Firewall domain list inspection only includes traffic coming from the VPC where you deploy the firewall. To inspect traffic from IP addresses outside of the deployment VPC, you set the
HOME_NETrule variable to include the CIDR range of the deployment VPC plus the other CIDR ranges. For more information, seeRuleVariablesin this guide and Stateful domain list rule groups in AWS Network Firewall in the Network Firewall Developer Guide- Parameters:
generated_rules_type (
Optional[str]) – Whether you want to apply allow, reject, alert, or drop behavior to the domains in your target list. .. epigraph:: When logging is enabled and you choose Alert, traffic that matches the domain specifications generates an alert in the firewall’s logs. Then, traffic either passes, is rejected, or drops based on other rules in the firewall policy.targets (
Optional[Sequence[str]]) – The domains that you want to inspect for in your traffic flows. Valid domain specifications are the following:. - Explicit names. For example,abc.example.commatches only the domainabc.example.com. - Names that use a domain wildcard, which you indicate with an initial ‘.‘. For example,.example.commatchesexample.comand matches all subdomains ofexample.com, such asabc.example.comandwww.example.com.target_types (
Optional[Sequence[str]]) – The types of targets to inspect for. Valid values areTLS_SNIandHTTP_HOST.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins rules_source_list_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceListProperty( generated_rules_type="generatedRulesType", targets=["targets"], target_types=["targetTypes"] )
Attributes
- generated_rules_type
Whether you want to apply allow, reject, alert, or drop behavior to the domains in your target list.
When logging is enabled and you choose Alert, traffic that matches the domain specifications generates an alert in the firewall’s logs. Then, traffic either passes, is rejected, or drops based on other rules in the firewall policy.
- target_types
The types of targets to inspect for.
Valid values are
TLS_SNIandHTTP_HOST.
- targets
.
Explicit names. For example,
abc.example.commatches only the domainabc.example.com.Names that use a domain wildcard, which you indicate with an initial ‘
.‘. For example,.example.commatchesexample.comand matches all subdomains ofexample.com, such asabc.example.comandwww.example.com.
- See:
- Type:
The domains that you want to inspect for in your traffic flows. Valid domain specifications are the following
RulesSourceProperty
- class CfnRuleGroupPropsMixin.RulesSourceProperty(*, rules_source_list=None, rules_string=None, stateful_rules=None, stateless_rules_and_custom_actions=None)
Bases:
objectThe stateless or stateful rules definitions for use in a single rule group.
Each rule group requires a single
RulesSource. You can use an instance of this for either stateless rules or stateful rules.- Parameters:
rules_source_list (
Union[IResolvable,RulesSourceListProperty,Dict[str,Any],None]) – Stateful inspection criteria for a domain list rule group.rules_string (
Optional[str]) – Stateful inspection criteria, provided in Suricata compatible rules. Suricata is an open-source threat detection framework that includes a standard rule-based language for network traffic inspection. These rules contain the inspection criteria and the action to take for traffic that matches the criteria, so this type of rule group doesn’t have a separate action setting. .. epigraph:: You can’t use theprioritykeyword if theRuleOrderoption in StatefulRuleOptions is set toSTRICT_ORDER.stateful_rules (
Union[IResolvable,Sequence[Union[IResolvable,StatefulRuleProperty,Dict[str,Any]]],None]) – An array of individual stateful rules inspection criteria to be used together in a stateful rule group. Use this option to specify simple Suricata rules with protocol, source and destination, ports, direction, and rule options. For information about the SuricataRulesformat, see Rules Format .stateless_rules_and_custom_actions (
Union[IResolvable,StatelessRulesAndCustomActionsProperty,Dict[str,Any],None]) – Stateless inspection criteria to be used in a stateless rule group.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins rules_source_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceProperty( rules_source_list=networkfirewall_mixins.CfnRuleGroupPropsMixin.RulesSourceListProperty( generated_rules_type="generatedRulesType", targets=["targets"], target_types=["targetTypes"] ), rules_string="rulesString", stateful_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleProperty( action="action", header=networkfirewall_mixins.CfnRuleGroupPropsMixin.HeaderProperty( destination="destination", destination_port="destinationPort", direction="direction", protocol="protocol", source="source", source_port="sourcePort" ), rule_options=[networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleOptionProperty( keyword="keyword", settings=["settings"] )] )], stateless_rules_and_custom_actions=networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRulesAndCustomActionsProperty( custom_actions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.CustomActionProperty( action_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.ActionDefinitionProperty( publish_metric_action=networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] ) ), action_name="actionName" )], stateless_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRuleProperty( priority=123, rule_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleDefinitionProperty( actions=["actions"], match_attributes=networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] ) ) )] ) )
Attributes
- rules_source_list
Stateful inspection criteria for a domain list rule group.
- rules_string
Stateful inspection criteria, provided in Suricata compatible rules.
Suricata is an open-source threat detection framework that includes a standard rule-based language for network traffic inspection.
These rules contain the inspection criteria and the action to take for traffic that matches the criteria, so this type of rule group doesn’t have a separate action setting. .. epigraph:
You can't use the ``priority`` keyword if the ``RuleOrder`` option in StatefulRuleOptions is set to ``STRICT_ORDER`` .
- stateful_rules
An array of individual stateful rules inspection criteria to be used together in a stateful rule group.
Use this option to specify simple Suricata rules with protocol, source and destination, ports, direction, and rule options. For information about the Suricata
Rulesformat, see Rules Format .
- stateless_rules_and_custom_actions
Stateless inspection criteria to be used in a stateless rule group.
StatefulRuleOptionsProperty
- class CfnRuleGroupPropsMixin.StatefulRuleOptionsProperty(*, rule_order=None)
Bases:
objectAdditional options governing how Network Firewall handles the rule group.
You can only use these for stateful rule groups.
- Parameters:
rule_order (
Optional[str]) – Indicates how to manage the order of the rule evaluation for the rule group.DEFAULT_ACTION_ORDERis the default behavior. Stateful rules are provided to the rule engine as Suricata compatible strings, and Suricata evaluates them based on certain settings. For more information, see Evaluation order for stateful rules in the AWS Network Firewall Developer Guide .- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins stateful_rule_options_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleOptionsProperty( rule_order="ruleOrder" )
Attributes
- rule_order
Indicates how to manage the order of the rule evaluation for the rule group.
DEFAULT_ACTION_ORDERis the default behavior. Stateful rules are provided to the rule engine as Suricata compatible strings, and Suricata evaluates them based on certain settings. For more information, see Evaluation order for stateful rules in the AWS Network Firewall Developer Guide .
StatefulRuleProperty
- class CfnRuleGroupPropsMixin.StatefulRuleProperty(*, action=None, header=None, rule_options=None)
Bases:
objectA single Suricata rules specification, for use in a stateful rule group.
Use this option to specify a simple Suricata rule with protocol, source and destination, ports, direction, and rule options. For information about the Suricata
Rulesformat, see Rules Format .- Parameters:
action (
Optional[str]) – Defines what Network Firewall should do with the packets in a traffic flow when the flow matches the stateful rule criteria. For all actions, Network Firewall performs the specified action and discontinues stateful inspection of the traffic flow. The actions for a stateful rule are defined as follows: - PASS - Permits the packets to go to the intended destination. - DROP - Blocks the packets from going to the intended destination and sends an alert log message, if alert logging is configured in the firewall logging configuration. - REJECT - Drops traffic that matches the conditions of the stateful rule and sends a TCP reset packet back to sender of the packet. A TCP reset packet is a packet with no payload and aRSTbit contained in the TCP header flags.REJECTis available only for TCP traffic. - ALERT - Permits the packets to go to the intended destination and sends an alert log message, if alert logging is configured in the firewall logging configuration. You can use this action to test a rule that you intend to use to drop traffic. You can enable the rule withALERTaction, verify in the logs that the rule is filtering as you want, then change the action toDROP. - REJECT - Drops TCP traffic that matches the conditions of the stateful rule, and sends a TCP reset packet back to sender of the packet. A TCP reset packet is a packet with no payload and aRSTbit contained in the TCP header flags. Also sends an alert log mesage if alert logging is configured in the firewall logging configuration.REJECTisn’t currently available for use with IMAP and FTP protocols.header (
Union[IResolvable,HeaderProperty,Dict[str,Any],None]) – The stateful inspection criteria for this rule, used to inspect traffic flows.rule_options (
Union[IResolvable,Sequence[Union[IResolvable,RuleOptionProperty,Dict[str,Any]]],None]) – Additional settings for a stateful rule, provided as keywords and settings.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins stateful_rule_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.StatefulRuleProperty( action="action", header=networkfirewall_mixins.CfnRuleGroupPropsMixin.HeaderProperty( destination="destination", destination_port="destinationPort", direction="direction", protocol="protocol", source="source", source_port="sourcePort" ), rule_options=[networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleOptionProperty( keyword="keyword", settings=["settings"] )] )
Attributes
- action
Defines what Network Firewall should do with the packets in a traffic flow when the flow matches the stateful rule criteria.
For all actions, Network Firewall performs the specified action and discontinues stateful inspection of the traffic flow.
The actions for a stateful rule are defined as follows:
PASS - Permits the packets to go to the intended destination.
DROP - Blocks the packets from going to the intended destination and sends an alert log message, if alert logging is configured in the firewall logging configuration.
REJECT - Drops traffic that matches the conditions of the stateful rule and sends a TCP reset packet back to sender of the packet. A TCP reset packet is a packet with no payload and a
RSTbit contained in the TCP header flags.REJECTis available only for TCP traffic.ALERT - Permits the packets to go to the intended destination and sends an alert log message, if alert logging is configured in the firewall logging configuration.
You can use this action to test a rule that you intend to use to drop traffic. You can enable the rule with
ALERTaction, verify in the logs that the rule is filtering as you want, then change the action toDROP.REJECT - Drops TCP traffic that matches the conditions of the stateful rule, and sends a TCP reset packet back to sender of the packet. A TCP reset packet is a packet with no payload and a
RSTbit contained in the TCP header flags. Also sends an alert log mesage if alert logging is configured in the firewall logging configuration.
REJECTisn’t currently available for use with IMAP and FTP protocols.
- header
The stateful inspection criteria for this rule, used to inspect traffic flows.
- rule_options
Additional settings for a stateful rule, provided as keywords and settings.
StatelessRuleProperty
- class CfnRuleGroupPropsMixin.StatelessRuleProperty(*, priority=None, rule_definition=None)
Bases:
objectA single stateless rule.
This is used in
StatelessRulesAndCustomActions.- Parameters:
priority (
Union[int,float,None]) – Indicates the order in which to run this rule relative to all of the rules that are defined for a stateless rule group. Network Firewall evaluates the rules in a rule group starting with the lowest priority setting. You must ensure that the priority settings are unique for the rule group. Each stateless rule group uses exactly oneStatelessRulesAndCustomActionsobject, and eachStatelessRulesAndCustomActionscontains exactly oneStatelessRulesobject. To ensure unique priority settings for your rule groups, set unique priorities for the stateless rules that you define inside any singleStatelessRulesobject. You can change the priority settings of your rules at any time. To make it easier to insert rules later, number them so there’s a wide range in between, for example use 100, 200, and so on.rule_definition (
Union[IResolvable,RuleDefinitionProperty,Dict[str,Any],None]) – Defines the stateless 5-tuple packet inspection criteria and the action to take on a packet that matches the criteria.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins stateless_rule_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRuleProperty( priority=123, rule_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleDefinitionProperty( actions=["actions"], match_attributes=networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] ) ) )
Attributes
- priority
Indicates the order in which to run this rule relative to all of the rules that are defined for a stateless rule group.
Network Firewall evaluates the rules in a rule group starting with the lowest priority setting. You must ensure that the priority settings are unique for the rule group.
Each stateless rule group uses exactly one
StatelessRulesAndCustomActionsobject, and eachStatelessRulesAndCustomActionscontains exactly oneStatelessRulesobject. To ensure unique priority settings for your rule groups, set unique priorities for the stateless rules that you define inside any singleStatelessRulesobject.You can change the priority settings of your rules at any time. To make it easier to insert rules later, number them so there’s a wide range in between, for example use 100, 200, and so on.
- rule_definition
Defines the stateless 5-tuple packet inspection criteria and the action to take on a packet that matches the criteria.
StatelessRulesAndCustomActionsProperty
- class CfnRuleGroupPropsMixin.StatelessRulesAndCustomActionsProperty(*, custom_actions=None, stateless_rules=None)
Bases:
objectStateless inspection criteria.
Each stateless rule group uses exactly one of these data types to define its stateless rules.
- Parameters:
custom_actions (
Union[IResolvable,Sequence[Union[IResolvable,CustomActionProperty,Dict[str,Any]]],None]) – Defines an array of individual custom action definitions that are available for use by the stateless rules in thisStatelessRulesAndCustomActionsspecification. You name each custom action that you define, and then you can use it by name in your stateless rule definitionActionsspecification.stateless_rules (
Union[IResolvable,Sequence[Union[IResolvable,StatelessRuleProperty,Dict[str,Any]]],None]) – Defines the set of stateless rules for use in a stateless rule group.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins stateless_rules_and_custom_actions_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRulesAndCustomActionsProperty( custom_actions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.CustomActionProperty( action_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.ActionDefinitionProperty( publish_metric_action=networkfirewall_mixins.CfnRuleGroupPropsMixin.PublishMetricActionProperty( dimensions=[networkfirewall_mixins.CfnRuleGroupPropsMixin.DimensionProperty( value="value" )] ) ), action_name="actionName" )], stateless_rules=[networkfirewall_mixins.CfnRuleGroupPropsMixin.StatelessRuleProperty( priority=123, rule_definition=networkfirewall_mixins.CfnRuleGroupPropsMixin.RuleDefinitionProperty( actions=["actions"], match_attributes=networkfirewall_mixins.CfnRuleGroupPropsMixin.MatchAttributesProperty( destination_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], destinations=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], protocols=[123], source_ports=[networkfirewall_mixins.CfnRuleGroupPropsMixin.PortRangeProperty( from_port=123, to_port=123 )], sources=[networkfirewall_mixins.CfnRuleGroupPropsMixin.AddressProperty( address_definition="addressDefinition" )], tcp_flags=[networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )] ) ) )] )
Attributes
- custom_actions
Defines an array of individual custom action definitions that are available for use by the stateless rules in this
StatelessRulesAndCustomActionsspecification.You name each custom action that you define, and then you can use it by name in your stateless rule definition
Actionsspecification.
- stateless_rules
Defines the set of stateless rules for use in a stateless rule group.
SummaryConfigurationProperty
- class CfnRuleGroupPropsMixin.SummaryConfigurationProperty(*, rule_options=None)
Bases:
objectA complex type that specifies which Suricata rule metadata fields to use when displaying threat information. Contains:.
RuleOptions- The Suricata rule options fields to extract and display
These settings affect how threat information appears in both the console and API responses. Summaries are available for rule groups you manage and for active threat defense AWS managed rule groups.
- Parameters:
rule_options (
Optional[Sequence[str]]) – Specifies the selected rule options returned byDescribeRuleGroupSummary.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins summary_configuration_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.SummaryConfigurationProperty( rule_options=["ruleOptions"] )
Attributes
- rule_options
Specifies the selected rule options returned by
DescribeRuleGroupSummary.
TCPFlagFieldProperty
- class CfnRuleGroupPropsMixin.TCPFlagFieldProperty(*, flags=None, masks=None)
Bases:
objectTCP flags and masks to inspect packets for. This is used in the match attributes specification.
For example:
"TCPFlags": [ { "Flags": [ "ECE", "SYN" ], "Masks": [ "SYN", "ECE" ] } ]- Parameters:
flags (
Optional[Sequence[str]]) – Used in conjunction with theMaskssetting to define the flags that must be set and flags that must not be set in order for the packet to match. This setting can only specify values that are also specified in theMaskssetting. For the flags that are specified in the masks setting, the following must be true for the packet to match: - The ones that are set in this flags setting must be set in the packet. - The ones that are not set in this flags setting must also not be set in the packet.masks (
Optional[Sequence[str]]) – The set of flags to consider in the inspection. To inspect all flags in the valid values list, leave this with no setting.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_networkfirewall import mixins as networkfirewall_mixins t_cPFlag_field_property = networkfirewall_mixins.CfnRuleGroupPropsMixin.TCPFlagFieldProperty( flags=["flags"], masks=["masks"] )
Attributes
- flags
Used in conjunction with the
Maskssetting to define the flags that must be set and flags that must not be set in order for the packet to match.This setting can only specify values that are also specified in the
Maskssetting.For the flags that are specified in the masks setting, the following must be true for the packet to match:
The ones that are set in this flags setting must be set in the packet.
The ones that are not set in this flags setting must also not be set in the packet.
- masks
The set of flags to consider in the inspection.
To inspect all flags in the valid values list, leave this with no setting.