nginx - Naxsi

Nginx 기반 LEMP 스택을 구성하던 중 Naxsi라는 것을 알게되어 자료를 찾아보려고 했으나 N포탈에도 나와있지 않고 GitHub에서 영문으로 된 대략의 설명만을 볼 수 있었다.

해외 이용자가 대략의 설명을 해준 것을 따라 해본 결과 SSL같이 Nginx기반 모듈이며 대부분의 웹 방화벽과는 다르게 서명기반에 의존하지 않는다고 한다.

아래는 GItHub에서 설명하는 Naxsi에 대한 설명을 의역한 것이다.



Naxsi란?

NAXSI(Nginx Anti Xss & Sql Injection)는 안티 XSS & SQL Injection Nginx를 의미한다.
기술적으로, UNIX기반 플랫폼 용 패키지로 제공되는 3rd party Nginx 모듈이다.
기본적으로 naxsi모듈은 웹 사이트 취약점 같이 이미 알려진 패턴들의 99%를 포함하는, 간단한 규칙들의 작은 부분들을 읽어들인다. 
예를 들어서 <, | 또는 drop은 URI 형식이 아닌 것으로 여겨진다.

간단하게 이런 패턴들은 적당한 쿼리와 매칭되는데 Naxsi의 관리자는 허용목록이 될 특정한 규칙을 추가할 의무가 있다.
관리자는 Nginx error log를 분석해서 직접 허용목록을 추가하거나 웹사이트에 대해서 자동으로 허용목록 규칙을 생성하는 자동학습 프로젝트를 실행할 수 있다.(사이트에서는 후자를 추천한다)

 Naxsi는 DROP-by-dafult 방화벽처럼 작동하지만 유일한 작업은 대상 웹 사이트가 ACCEPT 규칙이 제대로 작동되도록 추가하는 것이다.


Naxsi만의 특징

Naxsi는 대부분의 웹 어플리케이션 방화벽과는 다르게 안티바이러스같은 서명기반 방식에 의존하지 않기 때문에 "Unknown" 공격 패턴을 막을 수 있다.
Naxsi와 다른 WAF들와의 중요한 차이점은 오로지 GET과 POST 요청만 필터링한다는 것이다.
또 Naxsi는 무료다.(강조하고 싶었던 모양)





아래는 원문

What is Naxsi?

NAXSI means Nginx Anti XSS & SQL Injection.
Technically, it is a third party nginx module, available as a package for many UNIX-like platforms. This module, by default, reads a small subset of simple (and readable) rules containing 99% of known patterns involved in website vulnerabilities. For example, <| or drop are not supposed to be part of a URI.
Being very simple, those patterns may match legitimate queries, it is the Naxsi's administrator duty to add specific rules that will whitelist legitimate behaviours. The administrator can either add whitelists manually by analyzing nginx's error log, or (recommended) start the project with an intensive auto-learning phase that will automatically generate whitelisting rules regarding a website's behaviour.
In short, Naxsi behaves like a DROP-by-default firewall, the only task is to add required ACCEPT rules for the target website to work properly.

Why is it different?

Contrary to most Web Application Firewalls, Naxsi doesn't rely on a signature base like an antivirus, and thus cannot be circumvented by an "unknown" attack pattern. Another main difference between Naxsi and other WAFs, Naxsi filters only GET and POST requests, is Free software (as in freedom) and free (as in free beer) to use.

댓글 쓰기

0 댓글