# ウェブファイアウォール(WAF)

{% hint style="info" %}
サポートオペレーティングシステム

* Rocky Linux 9
  {% endhint %}

### 1. 事前作業 <a href="#id-1" id="id-1"></a>

* ウェブファイアウォールをインストールするEC2インスタンスにターミナルで接続し、root権限でインストールを行います。
* システムに合わせてタイムゾーンの設定および時刻同期の設定を行います。

```sh
timedatectl set-timezone Asia/Tokyo
```

```sh
ntpdate time.google.com
```

* ファイアウォールおよびネットワークセキュリティの設定:
  * 80番や443番などのウェブサービスで使用されるポートの接続を許可します。

### 2. インストール作業 <a href="#id-2" id="id-2"></a>

* Webファイアウォールエージェントのインストール

```sh
curl https://repo.plura.io/v5/agent/linux/install.sh | bash
```

```sh
/etc/plura/plura.sh install_waf
```

* ヘルスチェッカーアップロード例外設定コマンド

```bash
echo '[{"User-Agent": "ELB-HealthChecker/2.0"}]' > /etc/plura/conf/weblog-excluder.json
```

```bash
echo '[{"User-Agent": "ELB-HealthChecker/2.0"}]' > /etc/plura/conf/weblog-excluder.json
```

* ライセンスキーの登録と実行

```sh
/etc/plura/plura.sh register ****
```
