> For the complete documentation index, see [llms.txt](https://docs.plura.io/ko/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.plura.io/ko/agents/waf.md).

# 웹방화벽(WAF)

{% hint style="info" %}
지원 운영체제

* Rocky Linux 9
  {% endhint %}

### 1. 사전 작업

* 웹방화벽을 설치할 EC2 인스턴스에 터미널 접속 후 root 권한을 획득합니다.
* 타임존 설정 및 시간 동기화를 시스템에 맞게 설정합니다.

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

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

* 방화벽 및 네트워크 보안 설정
  * [x] 웹 서비스에서 사용하는 포트(예: 80, 443)로의 접속을 허용합니다.

### 2. 설치 작업

* 웹방화벽 에이전트 설치

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

```sh
plura 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
plura register ****
```

### 3. 구성 예시 <a href="#id-3" id="id-3"></a>

* 온프레미스&#x20;
  * Public subnet에 위치한 WAF-LB를 통해 PLURA-WAF 인스턴스(WAF1, WAF2)로 트래픽을 전달한 후, 다시 Private subnet의 Web-LB를 거쳐 각 웹 서버(Web1, Web2)로 연결됩니다.

```mermaid
  graph LR
  %% 1. 유저 정의
  User([User]) --> WAF-LB

  %% 2. Public Subnet 영역
  subgraph Public subnet
    WAF-LB[WAF-LB]
  end

  %% 3. PLURA-WAF 영역
  subgraph PLURA-WAF
    WAF1[WAF1]
    WAF2[WAF2]
  end

  %% 4. Private Subnet 영역
  subgraph Private subnet
    Web-LB[Web-LB]
    Web1[Web1]
    Web2[Web2]
  end

  %% 5. 각 컴포넌트 간 연결선 (Flow)
  WAF-LB --> WAF1
  WAF-LB --> WAF2
  
  WAF1 --> Web-LB
  WAF2 --> Web-LB
  
  Web-LB --> Web1
  Web-LB --> Web2

  %% 6. 디자인 스타일 수정 (옵션: 이미지처럼 어두운 테마나 깔끔한 정돈을 위해)
  style User fill:#333,stroke:#fff,stroke-width:1px,color:#fff
  style WAF-LB fill:#222,stroke:#555,color:#fff
  style WAF1 fill:#222,stroke:#555,color:#fff
  style WAF2 fill:#222,stroke:#555,color:#fff
  style Web-LB fill:#222,stroke:#555,color:#fff
  style Web1 fill:#222,stroke:#555,color:#fff
  style Web2 fill:#222,stroke:#555,color:#fff
```

* 퍼블릭 클라우드
  * <https://docs.plura.io/ko/iaas/aws/plurawaf>
  * <https://docs.plura.io/ko/iaas/ncloud/plurawaf>
