Allowed Methods – F5 WAF for NGINX로 Method 차단 정책 구성
F5 WAF for NGINX의 Allowed Methods 정책은 웹 애플리케이션이 허용하는 HTTP 요청 메서드를 제어하여, 불필요하거나 악의적인 요청을 사전에 차단할 수 있도록 지원합니다.
웹 애플리케이션은 클라이언트와 서버 간 통신 시 GET, POST, PUT, DELETE 등 다양한 Method를 사용하지만, 실제 서비스에서는 일부 Method만 사용되는 경우가 많습니다. 이때 사용하지 않는 Method가 열려 있으면 공격자가 비인가된 요청을 전송하거나 시스템 동작을 탐색하는 데 악용할 수 있습니다.
F5 WAF for NGINX의 Allowed Methods 정책을 통해 허용할 Method를 명시적으로 지정하고, 나머지 요청은 정책에 따라 차단하여 애플리케이션 보안을 한층 강화할 수 있습니다.
이번 포스트에서는 정책의 구성 방식과 실제 차단검증 결과를 확인하겠습니다.
목차
1. 환경 및 버전 정보
2. Allowed Methods 정책 구성
3. Allowed Methods 정책 적용 검증
4. 결론
1. 환경 및 버전 정보
| 구성 요소 | 버전 |
|---|---|
| OS | Ubuntu 24.04.3 |
| NGINX Plus | R35 |
| F5 WAF for NGINX | 5.9.0 |
| NGINX Instance Manager | 2.20.0 |
2. Allowed Methods 정책 구성
NGINX에서 허용하는 GET, POST, PUT, DELETE, HEAD, OPTIONS Methods에 대한 정책은 다음과 같이 구성할 수 있습니다.
{
"policy": {
"name": "blocking_policy",
"template": { "name": "POLICY_TEMPLATE_NGINX_BASE" },
"applicationLanguage": "utf-8",
"enforcementMode": "blocking",
"blocking-settings": {
"violations": [
{
"name": "VIOL_METHOD",
"alarm": true,
"block": true
}
]
},
"methods": [
{
"name": "GET"
},
{
"name": "POST"
},
{
"name": "HEAD"
},
{
"name": "PUT",
"$action": "delete"
},
{
"name": "PATCH"
},
{
"name": "DELETE"
},
{
"name": "OPTIONS"
}
]
}
}
VIOL_METHOD violation의 block을 true로 설정하고, 차단할 Method에 "$action": "delete"를 사용하면 해당 Method를 사용한 요청을 차단할 수 있습니다. "$action": "delete"가 설정되지 않은 Method는 허용되며, 예시와 같이 허용할 Method를 별도로 명시하지 않아도 기본적으로 허용됩니다.
주의사항
- GET, POST Method는 기본적으로 차단 구성이 불가능하며, 구성 시 다음과 같은 에러가 발생합니다.
Failed to import policy 'method_policy' from '/etc/app_protect/conf/method_policy.json': You can not delete required (GET or POST) method.
- GET, POST, PUT, DELETE, HEAD, OPTIONS를 제외한 별도의 커스텀 Method들은 기본적으로 차단됩니다.
3. Allowed Methods 정책 적용 검증
F5 WAF for NGINX 정책에 의해 GET, POST, HEAD를 제외한 Method 요청이 차단되는 것을 확인하기 위해 아래와 같이 정책 파일을 구성했습니다.
method_policy.json
{
"policy": {
"name": "method_policy",
"template": { "name": "POLICY_TEMPLATE_NGINX_BASE" },
"applicationLanguage": "utf-8",
"enforcementMode": "blocking",
"blocking-settings": {
"violations": [
{
"name": "VIOL_METHOD",
"alarm": true,
"block": true
}
]
},
"methods": [
{
"name": "GET"
},
{
"name": "POST"
},
{
"name": "HEAD"
},
{
"name": "PUT",
"$action": "delete"
},
{
"name": "PATCH",
"$action": "delete"
},
{
"name": "DELETE",
"$action": "delete"
},
{
"name": "OPTIONS",
"$action": "delete"
}
]
}
}
정책 적용 및 Security Monitoring을 위한 NGINX 설정 파일은 아래와 같이 구성하였으며, 요청을 전달할 서버는 httpbin 컨테이너로 구성했습니다.
server {
listen 80;
server_name method.devopssong.site;
proxy_set_header Host $Host;
app_protect_enable on;
app_protect_policy_file /etc/app_protect/conf/method_policy.json;
app_protect_security_log_enable on;
app_protect_security_log /etc/app_protect/conf/log_default.json /var/log/nginx/waf.log;
app_protect_security_log /etc/app_protect/conf/log_sm.json syslog:server=192.168.40.225:514;
location / {
proxy_pass http://192.168.40.220:8888/anything;
}
}
POSTMAN을 사용하여 각 Method를 사용해 요청을 전송하고, 결과를 확인합니다.



정책에서 허용된 GET, POST, HEAD Method 요청의 경우 정상 응답합니다.




정책에서 허용되지 않은 PUT, PATCH, DELETE, OPTIONS Method 요청의 경우 차단됩니다.
NGINX Instance Manager의 Security Dashboard에서 로그를 조회하면 아래와 같은 내용을 확인할 수 있습니다.


Illegal Method violation으로 인해서 요청이 차단됩니다.
Bot Client violation의 경우 Postman으로 요청을 전송하여 감지된 내용으로, 차단과 무관합니다(기본 alarm 구성)
4. 결론
HTTP Method 제어는 단순한 요청 필터링을 넘어, 불필요한 공격 표면을 최소화하는 핵심 보안 구성입니다.
F5 WAF for NGINX Allowed Methods 정책을 통해 애플리케이션의 요청 흐름을 명확히 정의하고, 비인가 Method를 차단함으로써 취약점을 줄이고 안정성을 확보할 수 있습니다.
운영 중인 애플리케이션에 Method 제한을 비롯한 보안 강화를 위한 다양한 WAF 기능이 필요하신가요? NGINX STORE를 통해 문의하여 무료로 NGINX One trial을 통해 F5 WAF for NGINX를 체험해 보세요.
댓글을 달려면 로그인해야 합니다.