create_rule_group
¶
create_rule_group(
rule_group_name: ResourceName,
type: RuleGroupType,
capacity: RuleCapacity,
*,
config_overrides: Optional[NetworkFirewallClientConfig] = None,
rule_group: Optional[RuleGroup] = None,
rules: Optional[RulesString] = None,
description: Optional[Description] = None,
tags: Optional[TagList] = None,
dry_run: Optional[Boolean] = None,
encryption_configuration: Optional[EncryptionConfiguration] = None,
source_metadata: Optional[SourceMetadata] = None,
analyze_rule_group: Optional[Boolean] = None,
summary_configuration: Optional[SummaryConfiguration] = None,
) -> CreateRuleGroupResponse
Creates the specified stateless or stateful rule group, which includes the rules for network traffic inspection, a capacity setting, and tags.
You provide your rule group specification in your request using either RuleGroup or Rules.
Parameters:
-
rule_group_name(ResourceName) –The descriptive name of the rule group. You can't change the name of a rule group after you create it.
-
rule_group(Optional[RuleGroup], default:None) –An object that defines the rule group rules.
You must provide either this rule group setting or a
Rulessetting, but not both. -
rules(Optional[RulesString], default:None) –A string containing stateful rule group rules specifications in Suricata flat format, with one rule per line. Use this to import your existing Suricata compatible rule groups.
You must provide either this rules setting or a populated
RuleGroupsetting, but not both.You can provide your rule group specification in Suricata flat format through this setting when you create or update your rule group. The call response returns a RuleGroup object that Network Firewall has populated from your string.
-
type(RuleGroupType) –Indicates whether the rule group is stateless or stateful. If the rule group is stateless, it contains stateless rules. If it is stateful, it contains stateful rules.
-
description(Optional[Description], default:None) –A description of the rule group.
-
capacity(RuleCapacity) –The maximum operating resources that this rule group can use. Rule group capacity is fixed at creation. When you update a rule group, you are limited to this capacity. When you reference a rule group from a firewall policy, Network Firewall reserves this capacity for the rule group.
You can retrieve the capacity that would be required for a rule group before you create the rule group by calling CreateRuleGroup with
DryRunset toTRUE.You can't change or exceed this capacity when you update the rule group, so leave room for your rule group to grow.
Capacity for a stateless rule group
For a stateless rule group, the capacity required is the sum of the capacity requirements of the individual rules that you expect to have in the rule group.
To calculate the capacity requirement of a single rule, multiply the capacity requirement values of each of the rule's match settings:
-
A match setting with no criteria specified has a value of 1.
-
A match setting with
Anyspecified has a value of 1. -
All other match settings have a value equal to the number of elements provided in the setting. For example, a protocol setting ["UDP"] and a source setting ["10.0.0.0/24"] each have a value of 1. A protocol setting ["UDP","TCP"] has a value of 2. A source setting ["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"] has a value of 3.
A rule with no criteria specified in any of its match settings has a capacity requirement of 1. A rule with protocol setting ["UDP","TCP"], source setting ["10.0.0.0/24","10.0.0.1/24","10.0.0.2/24"], and a single specification or no specification for each of the other match settings has a capacity requirement of 6.
Capacity for a stateful rule group
For a stateful rule group, the minimum capacity required is the number of individual rules that you expect to have in the rule group.
-
-
tags(Optional[TagList], default:None) –The key:value pairs to associate with the resource.
-
dry_run(Optional[Boolean], default:None) –Indicates whether you want Network Firewall to just check the validity of the request, rather than run the request.
If set to
TRUE, Network Firewall checks whether the request can run successfully, but doesn't actually make the requested changes. The call returns the value that the request would return if you ran it with dry run set toFALSE, but doesn't make additions or changes to your resources. This option allows you to make sure that you have the required permissions to run the request and that your request parameters are valid.If set to
FALSE, Network Firewall makes the requested changes to your resources. -
encryption_configuration(Optional[EncryptionConfiguration], default:None) –A complex type that contains settings for encryption of your rule group resources.
-
source_metadata(Optional[SourceMetadata], default:None) –A complex type that contains metadata about the rule group that your own rule group is copied from. You can use the metadata to keep track of updates made to the originating rule group.
-
analyze_rule_group(Optional[Boolean], default:None) –Indicates whether you want Network Firewall to analyze the stateless rules in the rule group for rule behavior such as asymmetric routing. If set to
TRUE, Network Firewall runs the analysis and then creates the rule group for you. To run the stateless rule group analyzer without creating the rule group, setDryRuntoTRUE. -
summary_configuration(Optional[SummaryConfiguration], default:None) –An object that contains a
RuleOptionsarray of strings. You useRuleOptionsto determine which of the following RuleSummary values are returned in response toDescribeRuleGroupSummary.-
Metadata- returns -
Msg -
SID
-
Raises:
-
InsufficientCapacityException–Amazon Web Services doesn't currently have enough available capacity to fulfill your request. Try your request later.
-
InternalServerError–Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request.
-
InvalidRequestException–The operation failed because of a problem with your request. Examples include:
-
You specified an unsupported parameter name or value.
-
You tried to update a property with a value that isn't among the available types.
-
Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.
-
-
LimitExceededException–Unable to perform the operation because doing so would violate a limit setting.
-
ThrottlingException–Unable to process the request due to throttling limitations.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_network_firewall/_services/network_firewall.py
1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 | |