2
0

More than 1 year has passed since last update.

AWS WAF ClassicからAWS WAFv2に移行した話

Last updated at Posted at 2022-12-19

はじめに

AWS WAFについて

以下の資料が詳細まで説明がされていて分かりやすかったので、こちらを御覧ください
https://d1.awsstatic.com/webinars/jp/pdf/services/20200324_AWS_BlackBelt_AWS_WAF_Update.pdf

移行するモチベーション

以下、AWSが公開しているガイドラインから抜粋した内容になります。
AWS WAF Classicでは新しい機能を受け取ることができなくなるため、AWS WAFv2の利用を推奨していることが分かります。

AWS WAF provides two versions of the service: WAFv2 and WAF
Classic. AWS recommends using AWS WAFv2 to stay up to date with the
latest features. AWS WAF Classic no longer receives new features. AWS
WAFv2 includes features that are not available in WAF classic, including a
separate API and Console. This paper focuses on implementation with
AWS WAFv2.

主な変更点

公式ドキュメントでもAWS WAF ClassicとAWS WAFv2を比較して、強化された機能や変更点の解説がされています。

変更点の抜粋

  • AWS Managed Rules for AWS WAF
  • New AWS WAF API
  • Simplified service quotas (limits)
  • Web ACL limits are now based on computing needs
  • Document-based rule writing
  • Rule nesting and full logical operation support
  • Variable CIDR range support for IP set
  • Chainable text transformations
  • Improved console experience
  • Expanded options for Firewall Manager AWS WAF policies
  • AWS CloudFormation support for all rule statement types

全体的に各種機能が向上しており、クォータの制限なども緩和されていることが分かります。

移行手順

公式が提供している仕組みがあるため、今回はその仕組みを使った移行方法をまとめています。

No 作業内容 画面キャプチャ 備考
1 AWS WAFの画面からmigration wizardを押下 1.png AWS WAF Classicのコンソール上で表示されます
2 予めS3にバケットを作成する必要があるため、①にある「Create new」を押下 2.png ここで、指定するバケット名は aws-waf-migration-{xxxxx} とする必要があります
3 バケットのポリシーを設定 {"Version": "2012-10-17", "Statement": [{"Effect": "Allow","Principal": {"Service": "apiv2migration.waf.amazonaws.com"},"Action": "s3:PutObject","Resource": "arn:aws:s3:::<BUCKET_NAME>/AWSWAF/<CUSTOMER_ACCOUNT_ID>/*"}]} 以下はは適宜書き換え
BUCKET_NAME
CUSTOMER_ACCOUNT_ID
4 No2の画面で、②〜④を入力して「Next」を押下 ②では移行したいWeb ACLを選択する
5 「Start creating CloudFormation template」を押下 3.png 設定に不備がある場合はエラーになるので、適宜対応
6 CFnスタックの作成 4.png バケット以下に作成されたCfnのテンプレートファイルを元にスタックの作成が開始

さいごに

移行作業の過程でCFnテンプレートが作成されるので、IaC化がまだの場合は合わせて検討してみても良いかも知れません。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0