Closed4

AWS NetworkFirewall の update-rule-group でルールを更新する

chittaichittai

今回は、厳密な順序/ステートフルのルールグループを更新する。基本的には以下のパラメータで大丈夫そうな気がする。

  update-rule-group
--update-token <value>
[--rule-group-arn <value>]
[--rule-group-name <value>]
[--rule-group <value>]
[--rules <value>]
[--type <value>]
chittaichittai

ルールグループはある前提で、TestRuleGroup とする。最初に、describe-rule-groupでupdate-tokenを取得する

aws network-firewall describe-rule-group --rule-group-name TestRuleGroup --type STATEFUL

[cloudshell-user@ip-10-134-26-96 ~]$ aws network-firewall describe-rule-group --rule-group-name TestRuleGroup --type STATEFUL
{
    "UpdateToken": "<Token>",
    "RuleGroup": {
        "RulesSource": {
            "StatefulRules": [
                {
                    "Action": "PASS",
                    "Header": {
                        "Protocol": "IP",
                        "Source": "ANY",
                        "SourcePort": "ANY",
                        "Direction": "FORWARD",
                        "Destination": "ANY",
                        "DestinationPort": "ANY"
                    },
                    "RuleOptions": [
                        {
                            "Keyword": "sid",
                            "Settings": [
                                "1"
                            ]
                        }
                    ]
                }
            ]
        },
        "StatefulRuleOptions": {
            "RuleOrder": "STRICT_ORDER"
        }
    },
    "RuleGroupResponse": {
        "RuleGroupArn": "arn:aws:network-firewall:ap-northeast-1:<AccountID>:stateful-rulegroup/TestRuleGroup",
        "RuleGroupName": "TestRuleGroup",
        "RuleGroupId": "63111700-889b-4273-8b92-90202e52f221",
        "Type": "STATEFUL",
        "Capacity": 1000,
        "RuleGroupStatus": "ACTIVE",
        "Tags": [],
        "ConsumedCapacity": 1,
        "NumberOfAssociations": 0,
        "EncryptionConfiguration": {
            "KeyId": "AWS_OWNED_KMS_KEY",
            "Type": "AWS_OWNED_KMS_KEY"
        },
        "LastModifiedTime": "2024-05-11T08:30:14.345000+00:00"
    }
}
chittaichittai

次はupdate-rule-groupを実行する
その前に、aws network-firewall update-rule-group --generate-cli-skeletonで実行のための引数を作成する

このスクラップは2024/10/13にクローズされました