KR20190028597A - Matching method of high speed snort rule and yara rule based on fpga - Google Patents

Matching method of high speed snort rule and yara rule based on fpga Download PDF

Info

Publication number
KR20190028597A
KR20190028597A KR1020170115181A KR20170115181A KR20190028597A KR 20190028597 A KR20190028597 A KR 20190028597A KR 1020170115181 A KR1020170115181 A KR 1020170115181A KR 20170115181 A KR20170115181 A KR 20170115181A KR 20190028597 A KR20190028597 A KR 20190028597A
Authority
KR
South Korea
Prior art keywords
packet
rule
matching
pcre
pattern
Prior art date
Application number
KR1020170115181A
Other languages
Korean (ko)
Other versions
KR102014741B1 (en
Inventor
이호재
강병완
장성민
박석영
Original Assignee
(주)피즐리소프트
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by (주)피즐리소프트 filed Critical (주)피즐리소프트
Priority to KR1020170115181A priority Critical patent/KR102014741B1/en
Publication of KR20190028597A publication Critical patent/KR20190028597A/en
Application granted granted Critical
Publication of KR102014741B1 publication Critical patent/KR102014741B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC

Abstract

The present invention relates to a method for matching a high-speed snort rule and yara rule based on FPGA, which comprises: a rule conversion step of converting a snort rule and a yara rule in a detection rule converter, and storing a fixed pattern and a PCRE pattern in a memory on a hardware board; a pattern matching step of receiving a packet input from a network on the basis of the converted rule, and performing packet parsing in a packet FIFO and a high-speed packet processing module to separately perform matching with the fixed pattern and the PCRE pattern; a hash matching step of receiving a header value and a payload of the packet from the packet parsing to reconfigure a file, storing the same in a memory in an FPGA, and matching the same with hash values stored based on an additionally inputted packet to generate a mitigation control signal in a detection result processing module; and a packet forwarding step of reading the packet from the packet FIFO to determine whether to mitigate the packet, and continuously generating packet dropping and packet forwarding.

Description

FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법{MATCHING METHOD OF HIGH SPEED SNORT RULE AND YARA RULE BASED ON FPGA}FIELD OF THE INVENTION [0001] The present invention relates to an FPGA-based fast snooze rule and a method of matching a high-

본 발명은 FPGA 기반 고속 스노트(SNORT) 룰과 야라(YARA) 룰(Rule) 매칭 방법에 관한 것이다.The present invention relates to an FPGA-based fast SNORT rule and a YARA rule matching method.

많은 회사와 개인이 정보를 공유하기 위해 컴퓨터를 사용하여 네트워크에 액세스한다. 또한 이러한 네트워크 사용자는 일반적으로 여러 목적으로 웹 사이트를 통해 인터넷을 사용하여 네트워크 외부에 있는 컴퓨터와 컴퓨터간에 최소한의 정보를 공유하려고 한다. 이러한 정보 공유는 서버 컴퓨터와 클라이언트 컴퓨터 간의 통신 세션을 설정하여 수행된다. 이러한 컴퓨터 간의 물리적 및 논리적 연결은 인터넷과 같은 글로벌 컴퓨터 네트워크를 구축한다.Many companies and individuals use a computer to access the network to share information. In addition, these network users typically want to share a minimal amount of information between computers and computers outside the network using the Internet through a Web site for multiple purposes. This information sharing is performed by establishing a communication session between the server computer and the client computer. These physical and logical connections between computers establish a global computer network such as the Internet.

불행히도 악의적인 컴퓨터 사용자는 인터넷 연결을 사용하여 인터넷을 통한 네트워크의 통신을 방해하거나 기밀 데이터에 액세스하거나 데이터를 지울 수 있다. 이러한 공격의 한 예로 공격자가 희생된 컴퓨터의 특정 클라이언트에 대한 서비스 제공을 거부하려고 시도하는 서비스 거부("DoS") 공격이 있다. Unfortunately, a malicious computer user may use an Internet connection to interfere with the communication of the network over the Internet, access sensitive data, or erase data. An example of such an attack is a denial of service attack ("DoS") in which an attacker attempts to deny service to a particular client on a victim machine.

DoS 공격은 서버의 메모리 및 네트워크 연결을 사용하는 등 다양한 방법을 통해 수행 할 수 있다. 서버 컴퓨터의 서비스는 IDS 또는 IPS 시스템에서 감지 할 수 있는 네트워크 공격으로 인해 중단 될 수도 있다.DoS attacks can be performed in a variety of ways, including using the server's memory and network connections. The services of the server computer may be interrupted by a network attack that can be detected by the IDS or IPS system.

네트워크 연결을 설정하려면 클라이언트 컴퓨터와 서버간에 세션설정 과정이 있어야 한다. 예를 들어 클라이언트 컴퓨터는 서버에 서비스를 요청한다. 이 요청에 대한 응답으로 서버는 메모리 공간과 처리 시간을 할당하고 응답을 컴퓨터로 다시 보내고 클라이언트 컴퓨터가 응답하기를 기다린다. 클라이언트 컴퓨터는 서버에 대한 서비스 요청을 많이 보낼 수는 있지만 서버로 회신하지 않을 수 있다. 그런 다음 서버는 메모리와 처리 시간을 낭비하는 동안 절대로 수신할 수 없는 응답을 기다린다. 기다리는 동안 추가 데이터 패킷을 수신하는 동안 서버의 메모리가 부족하거나 공간을 처리하거나 네트워크 연결이 끊어 질 수 있다. 결국 요청이 너무 많아서 서버가 합법적인 사용자에게 연결을 제공할 수 없으며 인터넷을 통한 서버의 통신이 본질적으로 종료된다. 이로 인해 전자 메일, 인터넷 액세스 및 웹 서버 기능이 손실될 수 있다.To establish a network connection, there must be a session establishment process between the client computer and the server. For example, a client computer requests a service from a server. In response to this request, the server allocates memory space and processing time, sends the response back to the computer, and waits for the client computer to respond. The client computer can send a lot of service requests to the server, but it can not reply to the server. The server then waits for a response that it never receives while wasting memory and processing time. During the wait while the server receives additional data packets, the server may run out of memory, process the space, or disconnect the network. Eventually, the request is too much so that the server can not provide the connection to the legitimate user and the communication of the server over the Internet is essentially terminated. This can result in loss of e-mail, Internet access, and Web server functionality.

이러한 공격의 또 다른 예로는 모든 CPU 전력을 소비하기 위해 서버에 많은 양의 데이터 패킷을 넘치게 함으로써 서버에 수많은 프로그램이나 스크립트를 실행하여 합법적인 사용자가 네트워크에 액세스하지 못하게 하거나 사용 가능한 메모리 공간을 소모하는 경우가 있다.Another example of such an attack is to flood the server with large amounts of data packets to consume all CPU power, thereby causing the server to run numerous programs or scripts to prevent legitimate users from accessing the network or consuming the available memory space There is a case.

수많은 네트워크 공격 유형 중에서 많은 패킷을 검사해야 할 때 패킷 페이로드의 시그니쳐를 사용하는 공격을 탐지하기가 어렵다. 현재 사용되고 있는 시그니쳐 탐지 및 탐지 후 탐지정책을 적용하는 프로세스들은 순수 CPU 전력을 이용한 소프트웨어 기반 솔루션들이다. CPU 기반 솔루션들은 S/W의 논리적 구조를 바탕으로 하여 기본적으로 처리되어야 할 기능들이 순차적으로 진행이 되게 되어 있어서 성능을 높이는데 문제가 많이 따른다. 따라서 정해진 링크 속도를 단일 네트워크 시큐리티 시스템에서 처리를 할 수 없게 되면 네트워크 구조가 복잡하게 되며 운용의 어려움이 따르게 된다.It is difficult to detect attacks that use the signatures of packet payloads when many of the network attack types have to check many packets. Currently used processes for applying signature detection and detection detection policies are software based solutions using pure CPU power. The CPU-based solutions are based on the logical structure of the S / W, and the functions to be basically processed are sequentially executed, which causes a lot of problems in improving the performance. Therefore, if the link speed can not be processed in a single network security system, the network structure becomes complicated and operation becomes difficult.

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은 스노트와 야라에서 적용되는 룰들을 장치에서 사용될 탐지 룰로 변환하고 매칭 장치의 시동 후 항상 룰을 적용하여 장치에 입력되는 패킷의 유입량에 대해 최대한 고속으로 패킷, 세션, 및 파일 단위로 룰을 탐지하여 탐지 후 대응 방식에 따라 실시간으로 네트워크의 보안을 위해 패킷 단위의 방어를 통해 유해 패킷과 파일의 유입을 막는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법을 제공하는 데 있다.It is an object of the present invention to solve the above problems and to provide an apparatus and method for converting a rule applied to Snort and Yarara into a detection rule to be used in a device, Based fast snooze rule and yara rule matching that detects rules in packet, session, and file units and prevents malicious packets and files from infiltrating through packet-based defense for real-time network security Method.

또한, 본 발명의 다른 목적은 FPGA을 이용하여 성능예측 가능한 하드웨어 기반 병렬처리 기능을 구현하여 네트워크 구조가 복잡하고 CPU 전력이 소모되는 시그너쳐 매칭 프로세스에 기인한 검출 및 방지 성능 저하를 극복하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법을 제공하는 데 있다.It is another object of the present invention to provide an FPGA-based high-speed FPGA that overcomes the deterioration in detection and prevention performance due to a complicated network structure and a CPU-consuming signature matching process by implementing a hardware- And to provide a method of matching Snort rules and Yarar rules.

상기와 같은 목적을 달성하기 위한 본 발명의 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법은, 스노트 룰과 야라 룰을 탐지 룰 변환기에서 변환하여 고정 패턴과 PCRE 패턴을 하드웨어 보드상의 메모리에 저장하는 룰 변환 단계; 상기 변환된 룰을 바탕으로 네트워크로부터 입력되는 패킷을 수신하여 패킷 FIFO과 고속 패킷 처리 모듈에서 패킷 파싱을 하여 각각 고정 패턴과 PCRE 패턴 매칭을 수행하는 패턴 매칭 단계; 상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 파일을 재구성하여 FPGA 내부에 있는 메모리에 저장하고, 추가적으로 입력되는 패킷을 바탕으로 저장된 해시값들과 매칭하여 탐지 결과 처리 모듈에서 완화 제어 신호를 발생하는 해시 매칭 단계; 및 상기 패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭과 패킷 포워딩을 연속적으로 발생하는 패킷 포워딩 단계;를 포함하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided an FPGA-based fast snooze rule and a Yahara rule matching method, wherein a Snort rule and a Yarar rule are transformed by a detection rule converter to store a fixed pattern and a PCRE pattern in a memory on a hardware board A rule conversion step; A pattern matching step of receiving a packet input from the network based on the converted rule and performing packet parsing in a packet FIFO and a fast packet processing module to perform a fixed pattern and a PCRE pattern matching, respectively; Receives the header value and payload of the packet from the packet parsing, reconstructs the file, stores it in a memory in the FPGA, matches the hash values stored on the basis of the further input packet, and outputs a mitigation control signal in the detection result processing module A generated hash matching step; And a packet forwarding step of continuously generating a packet drop and a packet forwarding by determining whether to mitigate the packet by reading the packet from the packet FIFO.

상기 룰 변환 단계는, 상기 스노트와 야라 룰을 탐지 룰 변환기에서 변환하는 스노트 룰 및 야라 룰 편집 단계; 상기 스노트 룰과 야라 룰에서 변환된 고정 패턴들이 고속 패킷 처리 모듈에서 적용될 수 있도록 탐지 엔진이 동작하는 FPGA의 내부 듀얼 포트 RAM 블럭 메모리에 저장하는 고정 패턴 저장 단계; 및 상기 스노트 및 야라 룰에서 변환된 결과값 중의 PCRE 패턴을 FPGA 보드 상에 있는 메모리에 저장하는 PCRE 패턴 저장 단계;를 포함하는 것을 특징으로 한다.Wherein the rule conversion step includes: a snoop rule and a jaarule editing step for converting the snoop and jaarul rule in the detection rule converter; A fixed pattern storage step of storing the fixed patterns converted in the Snort rule and the Jahar rule in an internal dual port RAM block memory of the FPGA in which the detection engine operates so that the fixed patterns can be applied in the high speed packet processing module; And a PCRE pattern storing step of storing the PCRE pattern among the result values converted from the Snoop and Yarar rules in a memory on the FPGA board.

상기 패턴 매칭 단계는, 입력 패킷이 수신되어 패킷 FIFO에 저장되고 동시에 고속 패킷 처리 모듈(200)에 전달되어 패킷 파싱을 하게 되고 헤더값과 페이로드를 구별하는 네트워크 패킷 수신 단계; 추출된 결과중 페이로드에 해당되는 내용은 FPGA안에 저장되어 있는 고정 패턴과 실시간으로 비교하는 고정 패턴 매칭 단계; 고정 패턴 매칭 탐지의 결과가 나올 경우 각 고정 패턴에 할당되어 있는 룰 번호를 식별하여 룰 번호를 확인하면 해당 룰에 적용되는 PCRE패턴이 있는지를 확인하는 PCRE 패턴 매칭 요구 단계; 및 PCRE 패턴 매칭이 필요한 룰일 경우 관련 PCRE 패턴이 PCRE 패턴 매칭에 적용될 수 있도록 PCRE 패턴 저장으로부터 읽어와서 관련 DFA를 프로그램하여 PCRE 패턴 매칭이 진행될 수 있게 하는 PCRE 패턴 매칭 단계;를 포함하는 것을 특징으로 한다.In the pattern matching step, the input packet is received and stored in the packet FIFO, and simultaneously transmitted to the high-speed packet processing module 200 to perform packet parsing, and a network packet receiving step for distinguishing a header value from a payload; Among the extracted results, the contents corresponding to the payload are a fixed pattern matching step to compare with the fixed pattern stored in the FPGA in real time; A PCRE pattern matching request step of identifying a rule number assigned to each fixed pattern when a result of the fixed pattern matching detection is found and confirming whether the PCRE pattern is applied to the rule by confirming the rule number; And a PCRE pattern matching step for reading from the PCRE pattern storage so that the related PCRE pattern can be applied to the PCRE pattern matching when the PCRE pattern matching is required and programming the related DFA so that PCRE pattern matching can be performed .

상기 해시 매칭 단계는, 상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 해당 세션을 바탕으로 파일을 재구성하는 파일 재집회 단계; 상기 재구성된 파일에 대한 MD5 해싱(hashing) 결과값을 FPGA내부에 있는 메모리에 저장하는 파일 기반 해시 연산 및 업데이터 단계; 추가적으로 입력되는 패킷을 바탕으로 재구성되는 파일들의 해시(Hash) 값을 계산한 후 저장된 해시값들과 비교하는 해시값 매칭 단계; PCRE룰 매칭을 할 것인지 아닌지를 판단하는 PCRE 패턴 매칭 요구 단계; 및 상기 패턴 매칭 단계와 해시 매칭 단계에서 탐지결과들을 바탕으로 완화 제어 신호를 발생하여 패킷 포워딩 엔진으로 전달하는 탐지 결과 처리 단계;를 포함하는 것을 특징으로 한다.The hash matching step may include a file re-gathering step of receiving a header value and a payload of a packet from the packet parsing and reconstructing a file based on the session; A file-based hash computation and updater for storing MD5 hashing results for the reconstructed file in a memory within the FPGA; A hash value matching step of calculating a hash value of files to be reconstructed based on a further input packet and comparing the hash values with stored hash values; A PCRE pattern matching request step for determining whether to perform PCRE rule matching; And a detection result processing step of generating a mitigation control signal based on the detection results in the pattern matching step and the hash matching step and delivering the mitigation control signal to the packet forwarding engine.

상기 패킷 포워딩 단계는, 네트워크로부터 입력되는 패킷을 수신하여 버퍼링하는 패킷 버퍼링 단계; 및 패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭(packet drop)과 패킷 포워딩 기능이 연속적으로 발생되도록 하는 완화 정책 응용 단계;를 포함하는 것을 특징으로 한다.The packet forwarding step may include: a packet buffering step of receiving and buffering a packet input from the network; And a mitigation policy application step of determining whether to mitigate a packet by reading a packet from the packet FIFO and causing a packet drop and a packet forwarding function to be successively generated.

상기와 같이, 본 발명에 따르면 하드웨어 소자인 FPGA를 이용하여 스노트 룰과 야라 룰 탐지 엔진을 구현하여 탐지결과를 이용한 추가 프로세싱을 하여 인라인 완화(mitigation)에 적용할 수 있다.As described above, according to the present invention, the Snort rule and the jaruaru detection engine can be implemented using FPGA, which is a hardware element, and further processing using the detection result can be applied to inline mitigation.

그리고. 본 발명에 따르면 스노트 룰과 야라 룰을 FPGA 기반 패턴 매칭, PCRE 룰 매칭, 야라 룰 매칭 용 자체 룰 포맷으로 컴파일하여 탐지 속도 및 FPGA 내부소요 소자의 적용 양을 최적화하여 구현할 수 있다.And. According to the present invention, it is possible to optimize the detection speed and the application amount of the elements required in the FPGA by compiling Snort rule and JAAR rule into FPGA-based pattern matching, PCRE rule matching, and JAAR rule matching rule format.

또한, 본 발명에 따르면 탐지결과를 하드웨어 보드상의 논리 소자에서 적용하여 인라인 엔진으로 적용할 수 있다.Also, according to the present invention, the detection result can be applied to the inline engine by applying the detection result to the logic element on the hardware board.

또한, 본 발명에 따르면 FPGA 내부에서 병렬신호처리 방식과 병렬 기능모듈을 적용하여 고속의 성능을 구현할 수 있다.Also, according to the present invention, high performance can be achieved by applying a parallel signal processing method and a parallel function module in an FPGA.

또한, 본 발명에 따르면 탐지엔진의 내부 동작 모듈의 시동을 줄여 전체 성능을 높이기 위한 세션 데이타 전처리를 통해 자체 다이나믹 탐지 화이트리스트 엔트리(whitelist entry)에 적용하여 동작 속도를 향상시킬 수 있다.In addition, according to the present invention, it is possible to improve the operation speed by applying a self-dynamic whitelist entry (whitelist entry) through a session data preprocessing to improve the overall performance by reducing the startup of the internal operation module of the detection engine.

또한, 본 발명에 따르면 동일한 웹서버로부터 다운로드 되어 들어오는 파일들을 구별하여 동일한 파일에 대해서는 한 번만 전체 탐지 루틴을 거치게 하도록 실시간 다이나믹 파일탐지 결과 엔트리 생성 및 탐지 과정에서 적용할 수 있다.In addition, according to the present invention, it is possible to apply the present invention to a real-time dynamic file detection result entry generation and detection process so that the files downloaded from the same web server are distinguished and the same file is subjected only once to the entire detection routine.

도 1은 본 발명에 따른 FPGA 기반 고속 스노트(SNORT) 룰(Rule)과 야라(YARA) 룰(Rule) 매칭 장치의 블록 구성도이다.
도 2는 본 발명에 따른 스노트 룰과 야라 룰에 적용되는 탐지 룰 변환기 출력 테이블이다.
도 3은 본 발명에 따른 고속 패킷 처리 모듈의 세부 기능모듈의 블록 구성도이다.
도 4는 본 발명에 따른 시그니쳐 매칭 모듈의 세부 기능모듈의 블록 구성도이다.
도 5는 본 발명에 따른 고속 시그니쳐 스케닝 모듈의 기능 블록 구성도이다.
도 6은 본 발명에 따른 고속 시그니쳐 길이 스케닝 모듈의 내부 구조의 블록 구성도이다.
도 7은 본 발명에 따른 PCRE 탐지 모듈의 블록 구성도이다.
도 8은 본 발명에 따른 다이나믹 해시(Hash)와 매치 모듈의 블록 구성도이다.
도 9는 본 발명에 따른 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법의 흐름도이다.
1 is a block diagram of an FPGA-based fast SNORT rule and a YARA rule matching apparatus according to the present invention.
2 is a detection rule converter output table applied to the Snort rule and the Yarra rule according to the present invention.
3 is a block diagram of a detailed functional module of a high speed packet processing module according to the present invention.
4 is a block diagram of a detailed function module of a signature matching module according to the present invention.
FIG. 5 is a functional block diagram of the Fast Signature Scanning Module according to the present invention.
6 is a block diagram of the internal structure of the high-speed signature length scanning module according to the present invention.
7 is a block diagram of a PCRE detection module according to the present invention.
8 is a block diagram of a dynamic hash and a match module according to the present invention.
9 is a flowchart of an FPGA-based fast snooze rule and a jara rule matching method according to the present invention.

아래에서는 첨부한 도면을 참고로 하여 본 발명의 실시예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily carry out the present invention. The present invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein.

그러면, 이하에서 본 발명의 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 장치에 대한 바람직한 실시예를 상세히 설명하기로 한다.Hereinafter, a preferred embodiment of the FPGA-based fast snooze rule and the Yahara matching device of the present invention will be described in detail.

도 1은 본 발명에 따른 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 장치의 블록 구성도이다.FIG. 1 is a block diagram of an FPGA-based fast snooze rule and a Yahara matching device according to the present invention.

도 1을 참조하면, 본 발명의 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 장치는 스노트 룰과 야라 룰을 변환해 주는 탐지 룰 변환기(Detection Rule Compiler)(100)와 탐지 엔진(Detection Engine)(1000)으로 구성된다.Referring to FIG. 1, an FPGA-based high-speed snort rule and a jara rule matching apparatus according to the present invention includes a detection rule converter 100 and a detection engine 100 for converting a snort rule and a jara rule 1000).

스노트(SNORT)는 오픈 소스 네트워크 기반 침입 탐지 시스템(NIDS)과 네트워크 기반 침입 차단 시스템(NIPS)으로 사용되는 탐지 및 차단 툴이며 인터넷 트래픽(IP) 네트워크에서 실시간 트래픽 분석 및 패킷 로깅을 수행 할 수 있다. 여기서, 상기 스노트는 프로토콜 분석, 컨텐츠 검색 및 매칭을 수행하며 이러한 기능을 구현하기 위해 스노트는 탐지 룰을 사용한다. Snort is a detection and blocking tool used as an open source network-based intrusion detection system (NIDS) and network-based intrusion prevention system (NIPS). It can perform real-time traffic analysis and packet logging in an Internet traffic (IP) have. Here, the snort performs protocol analysis, content search, and matching, and Snort uses a detection rule to implement this function.

야라(YARA)는 정의하기 쉬운 룰을 사용하여 악성 소프트웨어 샘플을 식별하고 분류하는 데 적용되는 도구이며, 야라를 사용하여 파일을 분류하거나 프로세스를 실행하여 악성 코드의 종류를 확인 하는데 사용된다. 이 도구를 사용하면 안티 바이러스 솔루션이 사용자를 위해 수행 할 수 있는 것과 유사한 맬웨어의 서명 기반 탐지(Signature-based detection)를 수행 할 수 있다.YARA is a tool used to identify and classify malicious software samples using easy-to-define rules, and is used to classify files or run processes using YARA to identify the type of malicious code. Using this tool, you can perform signature-based detection of malware that is similar to what an anti-virus solution can do for you.

탐지 룰 변환기(100)는 스노트 룰과 야라 룰 포멧(format)을 변환하여 탐지 엔진(Detection Engine)(1000)의 고속 패킷 처리 모듈(Fast Packet Processing Module)(200), PCRE 탐지 모듈(Perl Compatible Regular Expressions Detection Module)(300), 및 탐지 결과 처리 모듈(Detection Result Processing Module)(500)로 전달한다.The detection rule transformer 100 transforms the Snort rule and the jara rule format into a Fast Packet Processing Module 200 of the detection engine 1000 and a PCRE detection module A Regular Expression Detection Module 300, and a Detection Result Processing Module 500.

탐지 엔진(1000)은 탐지 룰 변환기(100)로부터 제공되는 룰의 내용을 바탕으로 네트워크로부터 입력되는 입력 패킷(Input Packet)을 수신하여 고속 패킷 처리 모듈(200)에서 고정 패턴을 탐지, PCRE 탐지 모듈(300)에서 PCRE 패턴 매칭, 그리고 동적 해시 및 매치 제어 모듈(Dynamic Hash & Match Control Module)(400)에서 수행되는 동일 파일 검색 결과와, 탐지 결과 처리 모듈(Detection Result Processing Module)(500)에서 고속 패킷 처리 모듈(200)과 PCRE 탐지 모듈(300), 그리고 동적 해시 및 매치 제어 모듈(400) 결과를 바탕으로 탐지 결과가 포지티브(positive)하게 판단이 되었을 경우에 적용할 정책(policy)을 확인한 후 탐지 결과 처리 모듈(500)로부터 제공되는 완화 제어 신호(Mitigation Control)를 완화 정책 적용 모듈(Mitigation Policy Application Module)(700)로 보내주면 완화 정책 적용 모듈(700)는 패킷 FIFO(600)에 저장되어 있는 해당 입력 패킷을 리드(READ)하여 탐지 결과 적용 정책을 적용한 후 출력 패킷으로 보내게 된다.The detection engine 1000 receives an input packet input from the network based on the contents of the rule provided from the detection rule converter 100 and detects a fixed pattern in the high speed packet processing module 200, The PCRE pattern matching in the PC 300 and the same file search result performed in the dynamic Hash & Match Control Module 400 and the detection result processing module 500 in the detection result processing module 500, Based on the results of the packet processing module 200, the PCRE detection module 300 and the dynamic hash and match control module 400, a policy to be applied when the detection result is determined to be positive is checked When the mitigation control module 700 transmits mitigation control signals provided from the detection result processing module 500 to the mitigation policy application module 700, Reads the corresponding input packet stored in the memory 600 and applies the detection result applying policy to the output packet.

입력된 입력 패킷이 패킷 FIFO(600)에 저장되었다가 해당 패킷에 대한 탐지 엔진(1000)에서의 프로세싱 결과가 완화 정책 적용 모듈(700)에서 준비되면 바로 리드(Read) 적용되어 출력 패킷으로 나가게 된다.When the inputted input packet is stored in the packet FIFO 600 and the processing result of the detection engine 1000 for the packet is prepared in the mitigation policy application module 700, the read packet is applied to the output packet .

이하에서는 입력되는 입력 패킷의 흐름을 방향으로 하여 설명하기로 한다.Hereinafter, the flow of the input packet to be input will be described in the direction.

탐지 룰 변환기(100)는 스노트 룰과 야라 룰을 입력 받아 탐지 기능을 위한 룰 포멧으로 변환하여 그 결과를 저장하며 탐지 엔진(1000)에 적용한다. PCRE 패턴의 경우 탐지 엔진(1000)으로부터 패킷 단위로 새로운 PCRE 패턴 적용을 요청 받으면 실시간으로 요청 받은 PCRE 패턴을 탐지 엔진(1000)으로 전달하여 PCRE 탐지 모듈(300)에서 사용될 수 있는 구조를 가진다.The detection rule transformer 100 receives the snort rule and the jara rule, converts the snort rule and the jara rule into a rule format for the detection function, stores the result, and applies the result to the detection engine 1000. In the case of the PCRE pattern, when a new PCRE pattern is requested in units of packets from the detection engine 1000, the PCRE pattern can be used in the PCRE detection module 300 by transmitting the PCRE pattern requested in real time to the detection engine 1000.

입력 패킷(Input Packets)들은 네트워크로부터 수신되어 패킷 FIFO(600)에 저장된다.The input packets are received from the network and stored in the packet FIFO 600.

입력 패킷들이 패킷 FIFO(600)에 라이트(Write) 되는 순간에 동시에 고속 패킷 처리 모듈(200)과 동적 해시 및 매치 제어 모듈(400)에 공급된다.The input packet is supplied to the fast packet processing module 200 and the dynamic hash and match control module 400 at the same time as the input packets are written to the packet FIFO 600.

고속 패킷 처리 모듈(200)에서는 패킷 파싱을 하여 헤더값과 페이로드 값으로 구별하고 고정 패턴 시그니쳐(fixed pattern signature)를 탐지한다. 또한, 추출된 헤더 값과 페이로드 정보를 동적 해시 및 매치 제어 모듈(400), PCRE 탐지 모듈(300), 탐지 결과 처리 모듈(500)에 전하고 고정 패턴(Fixed Pattern) 탐지 결과는 탐지 결과 처리 모듈(500)로 전달한다. 고정 패턴들은 탐지 룰 변환기(100)로부터 공급되며 새로운 고정 패턴 값들은 탐지 룰 변환기(100)에서 새로운 엔트리를 업데이트하거나 기존의 엔트리를 지울 수 있도록 구성되어 있다.In the fast packet processing module 200, packet parsing is performed to distinguish a header value from a payload value, and a fixed pattern signature is detected. The extracted header value and payload information are transmitted to the dynamic hash and match control module 400, the PCRE detection module 300 and the detection result processing module 500. The fixed pattern detection result is transmitted to the detection result processing module (500). The fixed patterns are supplied from the detection rule converter 100 and the new fixed pattern values are configured so that the detection rule converter 100 can update a new entry or erase an existing entry.

여기서, 고속 패킷 처리 모듈(200)은 변환된 룰의 탐지 파라메타들 중에서 고정 패턴을 고속으로 탐지하는 기능을 수행하는 모듈이다. 고정 패턴 매칭 결과 신호들은 PCRE 탐지 모듈(300)의 기능을 활성화하는 기준 신호로서 사용될 수 있다.Here, the fast packet processing module 200 performs a function of detecting a fixed pattern at a high speed among the detection parameters of the converted rule. The fixed pattern matching result signals may be used as a reference signal to activate the function of the PCRE detection module 300.

PCRE 탐지 모듈(300)은 탐지 룰 변환기(100)와 장치가 동작되는 동안 지속적으로 통신을 한다. 고속 패킷 처리 모듈(200)로부터 고정 패턴 매칭 결과 가 포지티브로 나오고 탐지 룰 변환기(100)에서 제공된 룰 넘버에 적용되는 PCRE 패턴이 있는 경우 해당 PCRE 패턴을 받아 내부 DFA가 해당 PCRE 패턴을 탐지할 수 있도록 프로그램 한다. 이 작업은 패킷 단위로 이루어지게 된다. The PCRE detection module 300 continuously communicates with the detection rule transformer 100 while the device is in operation. When the fixed pattern matching result is positive from the high speed packet processing module 200 and there is a PCRE pattern applied to the rule number provided in the detection rule converter 100, the internal DFA receives the PCRE pattern so that the internal DFA can detect the PCRE pattern Program. This operation is performed on a packet-by-packet basis.

여기서, PCRE 탐지 모듈(300)은 변환된 룰의 탐지 파라메타들 중에서 PCRE 룰을 탐지하는 기능을 수행하는 모듈이다. 고속 패킷 처리 모듈(200)의 매칭 결과를 바탕으로 해서 해당 PCRE 룰을 실시간으로 공용으로 사용되는 PCRE 탐지 서브 엔진(Detection Sub-Engine)들에 로딩하여 내부 소요 로직의 양을 최소화하여 비용 효율적인 조건으로서 PCRE룰을 탐지하고 많은 양의 PCRE 룰을 탐지하는데 효과적으로 사용할 수 있다.Here, the PCRE detection module 300 is a module that detects the PCRE rule among the detection parameters of the converted rule. Based on the matching result of the high-speed packet processing module 200, the PCRE rule is loaded into PCRE detection sub-engines commonly used in real time to minimize the amount of internal required logic, It can be used effectively to detect PCRE rules and detect large amounts of PCRE rules.

입력 패킷은 또한 동적 해시 및 매치 제어 모듈(400)에도 입력된다. 동일 패킷에 대한 헤더값과 페이로드 값은 고속 패킷 처리 모듈(200)로부터 공급받게 된다. 페이로드로부터 파일을 재조합할 수 있는 내용을 확인하여 파일을 조합한 후 입력 데이터에서 반복적으로 나타날 수 있는 데이터의 형태(예를 들어 파일)들을 구별할 수 있는 자체 파라메타를 추출하여 반복적으로 같은 파일에 대한 해시(Hash)값을 계산하는 절차를 줄여서 시스템의 전체 성능을 높이도록 한다.The input packet is also input to the dynamic hash and match control module 400. The header value and the payload value for the same packet are supplied from the fast packet processing module 200. After combining the files by checking the contents of the file that can be reassembled from the payload, it extracts its own parameters that can distinguish the type of data (for example, files) that can appear repeatedly in the input data, The procedure for calculating the hash value of the system is reduced to improve the overall performance of the system.

여기서, 동적 해시 및 매치 제어 모듈(400)은 입력되는 인입 패킷(Incoming Packet)들로부터 파일 관련 데이터를 누적하여 파일을 재조합하고, 재조합되기 시작하는 파일의 메타데이터(Metadata)를 먼저 추출하여 파일의 전체 패킷들을 누적하여 파일 재조합을 하고 해시(Hash) 값을 생성하는 프로세스를 시작할 지에 대한 판단, 그리고 재조합된 파일의 해시 값과 저장되어 있는 해시 값들과의 비교하는 기능들을 수행할 수 있다.Here, the dynamic hash and match control module 400 accumulates file-related data from input incoming packets and reassembles the file. The metadata of the file to be reassembled is extracted first, It is possible to accumulate the entire packets to perform file reassembly, to judge whether to start the process of generating a hash value, and to compare the hash value of the reassembled file with the stored hash values.

고속 패킷 처리 모듈(200), PCRE 탐지 모듈(300), 동적 해시 및 매치 제어 모듈(400)로부터 각각 나오는 고정 패턴 매칭 결과, PCRE 매칭 결과, 및 해시 매칭 결과(Hash Matching Results)는 패킷 단위로 프로세스되어 결과가 나오며 이 결과 값들은 종합적으로 동시에 비교되어 탐지 룰 변환기(100)에서 제공되는 룰 정책(Rule Policies)을 토대로 완화 제어(Mitigation Control) 신호를 발생하게 된다.The fixed pattern matching result, the PCRE matching result, and the hash matching result, which are respectively obtained from the high-speed packet processing module 200, the PCRE detecting module 300, the dynamic hash and the match control module 400, The results are comprehensively and simultaneously compared with each other, and a mitigation control signal is generated based on a rule policy provided by the detection rule transformer 100.

완화 정책 적용 모듈(700)는 탐지 결과 처리 모듈(500)으로부터 제공되는 완화 제어 신호를 바탕으로 패킷 FIFO(600)에 저장되어 있는 입력 패킷을 어떻게 처리해야 될지 알게 되며 패킷 FIFO(600)으로 부터 패킷을 리드(READ)하여 관련 패킷에 대한 완화 제어를 하여(packet drop 또는 forwarding) 출력 패킷으로 보내게 된다.Based on the mitigation control signal provided from the detection result processing module 500, the mitigation policy application module 700 knows how to process an input packet stored in the packet FIFO 600, (Packet drop or forwarding) and sends the packet as an output packet.

여기서, 탐지 결과 처리 모듈(500)은 탐지 룰 변환기(100), 고속 패킷 처리 모듈(200), 그리고 PCRE 탐지 모듈(300)에서 진행되는 탐지 및 매칭 결과들을 실시간으로 종합하여 패킷 단위의 완화(mitigation)가 발생되게 하여, 패킷기반, 세션기반, 파일 단위의 유해 트래픽을 인라인(inline)상에서 방어할 수 있게 한다. 특히 파일기반 공격의 경우에는 전체 파일의 조합이 완벽히 되어야만 되는 유해 트래픽(파일)의 마지막 패킷을 차단하는 기법을 이용하여 트래픽(traffic)의 흐름에 지연을 주지 않고 탐지, 차단 및 추가 완화 기능을 구현할 수 있게 하는 기능을 제공한다. 패킷을 세션별로 누적하고 파일을 재조합하는 기능은 FPGA와 연동되어 있는 SDRAM(수 기가 바이트 사이즈)을 이용하여 구현된다.Here, the detection result processing module 500 synthesizes the detection and matching results of the detection rule converter 100, the high-speed packet processing module 200, and the PCRE detection module 300 in real- ), Thereby enabling to protect the packet-based, session-based, and file-based harmful traffic in inline. In particular, in the case of file-based attacks, detection, blocking, and additional mitigation functions are implemented without delaying the flow of traffic using the technique of blocking the last packet of harmful traffic (file) It provides the ability to The ability to accumulate packets on a per-session basis and reassemble the file is implemented using an SDRAM (several gigabytes in size) interfaced with the FPGA.

여기서, 패킷 FIFO(600)는 탐지 결과 처리 모듈(500)에서 처리된 결과신호(Mitigation Control)가 완화 정책 적용 모듈(700)에서 처리되어 출력 패킷(Output Packet)으로 출력될 수 있도록 시스템 지연을 조절하여 버퍼링 할 수 있다.The packet FIFO 600 controls the system delay so that the resultant signal (Mitigation Control) processed by the detection result processing module 500 is processed in the mitigation policy application module 700 and output as an output packet (Output Packet) And then buffered.

도 2는 본 발명에 따른 스노트 룰과 야라 룰에 적용되는 탐지 룰 변환기 출력 테이블이고, IPS 장비 또는 차세대 IPS에서 유해 패턴을 탐지하기 위해 사용되는 스노트 룰과 야라 룰에서 적용되는 탐지 룰들을 본 발명에서 사용되는 탐지 엔진 기반 유해 패턴 탐지용 모듈에 적용할 수 있는 형태로 변환한 결과의 예를 보여 주는 것이다.FIG. 2 is a table showing a detection rule converter output table to be applied to Snort rule and Jara rule according to the present invention. The Snort rule and the detection rule applied in the Jara rule are shown in FIG. FIG. 5 shows an example of the result of conversion into a form applicable to a detection-engine based harmful pattern detection module used in the invention.

본 발명에 의해 구현된 기능 모듈은 탐지 룰 변환기 출력 테이블(110) 에서 보이는 모든 파라메타들(Protocol, Source IP, Source Port, Direction, Destination IP, Destination Port, Fixed Pattern, PCRE)을 토대로 탐지되어야 할 룰을 찾아 내게 된다.The functional module implemented by the present invention is configured to detect a rule to be detected based on all the parameters (Protocol, Source IP, Source Port, Direction, Destination IP, Destination Port, Fixed Pattern, PCRE) .

도 3은 본 발명에 따른 고속 패킷 처리 모듈의 세부 기능모듈의 구성도이며 세부 기능모듈들은 다음과 같다.3 is a block diagram of a detailed functional module of the high speed packet processing module according to the present invention, and detailed functional modules are as follows.

도 3을 참조하면, 고속 패킷 처리 모듈(200)은 스노트 룰과 야라 룰의 세부 파라메타들 중에서 고정 패턴(Fixed Pattern)을 탐지한다.Referring to FIG. 3, the fast packet processing module 200 detects a fixed pattern among the detailed parameters of the Snort rule and the Yarar rule.

입력되는 트래픽(인입 패킷, 예를들어 레이어(Layer) 2 이더넷 프레임)은 시그니쳐 매칭 모듈(Signature Matching Module)(210)과 패킷 파싱(Packet Parsing) 모듈(220)에 입력된다.The input traffic (incoming packet, for example, Layer 2 Ethernet frame) is input to a Signature Matching Module 210 and a Packet Parsing Module 220.

시그니쳐 매칭 모듈(210)은 입력되는 모든 패킷으로부터 레이어(layer) 2, 레이어 3, 레이어 4의 헤더 정보들을 추출하고 레이어 7 데이터 영역을 확인할 수 있는 기준 신호를 발생한다.The signature matching module 210 extracts header information of layers 2, 3, and 4 from all input packets, and generates a reference signal that can identify the layer 7 data area.

레이어 3과 레이어 4 헤더 정보의 경우 통신 세션을 통해 전달되는 패킷 또는 파일의 내용을 누적할 수 있는 파일들을 추출할 수 있는 기본 데이터를 저장하거나 탐지된 결과의 내용을 구분하는데 적용될 수 있다.Layer 3 and Layer 4 header information can be used to store basic data that can extract packets or files that accumulate the contents of a file that is delivered over a communication session or to identify the content of the detected results.

레이어 7 데이터 영역이 시작되는 지점을 알리는 신호를 기준으로 해서 탐지 룰 변환기 출력 테이블(110)의 고정 패턴(Fixed Pattern)들을 이용한 매칭이 시작된다. 고정 패턴 엔트리(Fixed Pattern entry)들은 본 발명과 관련된 소프트웨어 프로그램에 의해서 리드(READ)되어 내부 매칭로직에 프로그램되어 입력되는 인입 패킷(Incoming Packet)들과 비교된다.Matching using the fixed pattern of the detection rule converter output table 110 is started based on a signal indicating a point where the layer 7 data area starts. Fixed Pattern entries are read by a software program associated with the present invention and compared to incoming packets that are programmed into the internal matching logic.

시그니쳐 매칭 모듈(210)은 입력되는 모든 패킷의 페이로드(payload)와 실시간으로 비교되며 매칭 결과(Signature matching results)들은 헤더 정보와 함께 패킷 처리 결정 모듈(Packet Handling Decision Module)(230)으로 전달이 되어서 고속 패턴 결정 결과 신호로서 PCRE 탐지 모듈(300)과 탐지 결과 처리 모듈(500)으로 전달이 된다.The signature matching module 210 compares the payload of all incoming packets in real time and sends the matching results to the packet handling decision module 230 together with the header information. And transmitted to the PCRE detection module 300 and the detection result processing module 500 as a high-speed pattern determination result signal.

도 4는 본 발명에 따른 시그니쳐 매칭 모듈의 세부 기능모듈의 구성도이며 세부 기능모듈들은 다음과 같다.FIG. 4 is a block diagram of a detailed function module of the signature matching module according to the present invention.

도 4를 참조하면, 시그니쳐 매칭 모듈(210)은 고속 시그니쳐 스케닝 모듈(Fast Signature Scanning Module)(211), 스켄 데이터 저장 모듈(Scanned Data Storage Module)(212)와 완전 패턴 매칭 모듈(Exact Pattern Matching Module)(213)으로 구성되어 있다.4, the signature matching module 210 includes a Fast Signature Scanning Module 211, a Scanned Data Storage Module 212, and an Exact Pattern Matching Module ) 213 as shown in Fig.

시그니쳐 매칭은 바이트 단위로 진행되는데 고정 패턴(Fixed Pattern)들이 고속 시그니쳐 스케닝 모듈(211)과 완전 패턴 매칭 모듈(213)에 프로그램 되어 입력되는 입력 패킷 데이터와 비교된다.Signature matching is performed on a byte-by-byte basis. Fixed patterns are compared with the input packet data that is programmed and input into the fast signature scanning module 211 and the full pattern matching module 213.

고속 시그니쳐 스케닝 모듈(211)의 경우 고정 패턴의 일부분과 길이를 비교하여 실제 고속 패턴이 존재할 수 있는 데이터의 영역을 확인 하는 것을 주된 목표로 한다. 이 기능은 이중 포트(Dual-Port) RAM을 이용하여 구현이 되며 고정 패턴의 일부 패턴과 패턴의 길이 등에 대한 정보를 저장하여 입력되는 패킷의 데이터에서 비교되어야 할 영역을 구제적으로 확인하게 된다. 이렇게 생성된 스켄 데이터 스트림(Scanned Data Stream)은 스켄 데이터 저장 모듈(Scanned Data Storage Module)(212)에 전달되어 확인된 길이만큼의 데이터가 패턴 메칭 윈도우(Pattern Matching Window) 신호 길이만큼 완전 패턴 매칭 모듈(Exact Pattern Matching Module)(213)의 내부 메모리에 저장된다.In the case of the high-speed signature scanning module 211, the main goal is to compare the length of a portion of the fixed pattern with the length to identify an area of data in which an actual high-speed pattern may exist. This function is realized by using dual-port RAM and stores information about a pattern of a fixed pattern and a length of a pattern to reliably check the area to be compared in the data of the input packet. The generated Scanned Data Stream is transmitted to a Scanned Data Storage Module 212, and data of a length corresponding to the determined length is sent to a pattern matching window (Exact Pattern Matching Module)

이렇게 저장된 데이터는 고속 시그니쳐 스케닝 모듈(211)에 입력되는 스켄 데이터 스트림과 함께 완전 패턴 매칭 모듈(213)에서 비교되게 된다.The stored data is compared in the full pattern matching module 213 together with the scan data stream input to the fast signature scanning module 211.

이렇게 비교된 결과가 포지티브(Positive)일 경우에는 포지티브 시그니쳐 매칭 결과(Positive Signature Matching Result)를 발생하게 된다.If the comparison result is positive, a positive signature matching result is generated.

이렇게 탐지되는 패턴과 함께 한 개의 룰에 포함되어 있는 PCRE 파라메타가 있는 경우 특정 PCRE 룰이 PCRE 탐지 모듈(300)로 프로그램 되어 PCRE 관련 매칭을 시작할 수 있도록 한다.If there is a PCRE parameter contained in one rule along with the detected pattern, then a particular PCRE rule is programmed into the PCRE detection module 300 to allow PCRE-related matching to begin.

도 5는 본 발명에 따른 고속 시그니쳐 스케닝 모듈의 기능 블럭들의 세부 기능을 나타낸 것이다.5 shows the detailed function of the functional blocks of the fast signature screening module according to the present invention.

도 5에서는 입력되는 패킷의 데이터와 매치(match)되어야 할 시그니쳐를 찾아 내는 과정을 시그니쳐 "/script/update.asp" 을 예로 들어 설명하고 있다.In FIG. 5, a process of finding a signature to be matched with data of an input packet is described by using a signature "/script/update.asp" as an example.

ASCII 텍스트인"/script/update.asp"의 16진수 텍스트(Hexadecimal text)는"2f 73 63 72 69 70 74 2f 75 70 64 61 74 65 2e 61 73 70"이다.The hexadecimal text of the ASCII text "/script/update.asp" is "2f 73 63 72 69 70 74 2f 75 70 64 61 74 65 2e 61 73 70".

고속 시그니쳐 스케닝 모듈(211)에는 "/script/update.asp" 를 탐지되어야 할 고정 패턴(Fixed Pattern)으로 업로드되면서 ".asp" 와 "/script/update.asp" 의 패턴의 길이를 저장하게 된다. 이와 같은 내용은 고속 시그니쳐 길이 스케닝 모듈(Fast Signature Length Scanning Module)(217)과 고속 시그니쳐 패턴 매칭 모듈(218)에 저장이 되게 되며 고속 시그니쳐 길이 스케닝 모듈(217)은 시그니쳐의 길이를 확인하고 고속 시그니쳐 패턴 매칭 모듈(218)은 시그니쳐의 일부 패턴영역을 실제로 비교한다.The high-speed signature scanning module 211 stores the length of the pattern of ".asp" and "/script/update.asp" while uploading "/script/update.asp" as a fixed pattern to be detected . This information is stored in the fast signature length scanning module 217 and the fast signature pattern matching module 218. The fast signature length scanning module 217 checks the length of the signature and generates a fast signature The pattern matching module 218 actually compares some pattern areas of the signature.

고속 시그니쳐 길이 스케닝 모듈(217)과 고속 시그니쳐 패턴 매칭 모듈(218)에는 다수의 고정 패턴에 대한 시그니쳐가 저장이 되어 있으며 각각 매치된 패턴 길이 값(Matched Pattern Length Values)과 부분적인 패턴 매칭 결과(Partial Pattern Matching Result) 값들을 발생하여 시그니쳐 윈도우 선택 모듈(Signature Window Selection Module)(219)로 전달한다. 그렇게 되면 시그니쳐 윈도우 선택 모듈(219)에서는 저장된 고정 패턴들 중에 두 가지 조건에 맞은 고정 패턴에 대한 고정 패턴의 길이와 비교 위치를 정하여 패턴 매칭 윈도우 신호를 발생하여 PCRE 탐색 모듈(300)과 탐색 결과 처리 모듈(500)으로 공급하게 된다.Signatures for a plurality of fixed patterns are stored in the high-speed signature length scanning module 217 and the high-speed signature pattern matching module 218, and the matched pattern length values and the partial pattern matching results Pattern Matching Result) to the Signature Window Selection Module 219. Then, the signature window selection module 219 generates a pattern matching window signal by determining the fixed pattern length and the comparison position for the fixed pattern matching the two conditions among the stored fixed patterns, and outputs the pattern matching window signal to the PCRE search module 300 and the search result processing Module 500 as shown in FIG.

도 6은 본 발명에 따른 고속 시그니쳐 길이 스케닝 모듈의 내부 구조를 설명하고 있다.6 illustrates the internal structure of a fast signature length scanning module according to the present invention.

도 6을 참조하면, 고속 시그니쳐 길이 스케닝 모듈(217)는 다수의 듀얼 포트 RAM(220)을 이용하여 탐지 하고자 하는 패턴의 길이를 확인하는데 사용한다.Referring to FIG. 6, the fast signature length scanning module 217 uses a plurality of dual port RAMs 220 to check the length of a pattern to be detected.

듀얼 포트 RAM(220)의 한쪽 어드레스 포트(address port)와 데이터 포트(data port)들을 통해 업로드 되는 고정 패턴(Fixed Pattern)의 길이에 대한 정보를 저장하게 된다. 예를 들어 "/script/update.asp"의 경우 마지막 4개 ASCII 텍스트의 값에 해당되는".asp" 의 16진수 텍스트(Hexadecimal text)들을 어드레스로 사용하고 고장패턴의 길이를 데이터로 사용하여 듀열 포트 RAM(220) 에 쓰게(WRITE) 한다.Information about the length of a fixed pattern that is uploaded via one of the address port and the data port of the dual port RAM 220 is stored. For example, in the case of "/script/update.asp", hexadecimal texts of ".asp" corresponding to the values of the last 4 ASCII texts are used as addresses and the length of the failure pattern is used as data, And writes it to the port RAM 220 (WRITE).

이렇게 업데이트 되어 있는 듀얼 포트 RAM(220)의 다른 쪽 포트의 어드레스에 인입 패킷(Incoming Packet)을 적용하게 되면 읽게(READ) 되어 나오는 값들은 각 입력 바이트 값을 포함하고 있는 패턴의 길이를 나타내는 것이 다. 현재와 같은 경우에 패턴 매칭을 하고자 하는 패턴의 길이에 대한 값이 4번 연속적으로 같은 길이의 값으로 읽게 되어 나오게 된다.When an incoming packet is applied to the address of the other port of the dual port RAM 220 thus updated, the values read out indicate the length of the pattern including each input byte value . In the present case, the value of the length of the pattern to be pattern-matched is read out as four consecutive identical length values.

고속 시그니쳐 패턴 매칭 모듈(218)에서도 같은 방법으로 하여 업데이트 되는 패턴의 나머지 부분에 대한 16진수 값을 이용하여 듀얼 포트 RAM(220)의 메모리 영역을 업데이트 하게 된다.The fast signature pattern matching module 218 updates the memory area of the dual port RAM 220 using the hexadecimal value for the remaining portion of the pattern updated in the same manner.

이 때는 각 데이터로 사용되는 비트들 중의 일부 비트를 이용하여 "1" 값으로 쓰게 되면 어드레스 라인(address line)에 적용된 인입 패킷(Incoming Packet)의 바이트가 탐지 되어야 할 패턴의 일부임을 나타내게 된다.In this case, when a bit of "1" is written using some of the bits used for each data, the byte of the incoming packet applied to the address line indicates that it is a part of a pattern to be detected.

도 7은 본 발명에 따른 PCRE 탐지 모듈의 구조를 보여 준다.7 shows the structure of the PCRE detection module according to the present invention.

도 7을 참조하면, PCRE 탐지 모듈은(300)은 다수의 PCRE 탐지 서브 모듈(310)로 구성되어 있다. PCRE 탐지 서브 모듈(310)은 멀티 패턴 탐지 모듈(Multi-Pattern Detection Module)(320)과 프로그래머블(Programmable) PCRE 매치 모듈(330)로 이루어진다.Referring to FIG. 7, the PCRE detection module 300 includes a plurality of PCRE detection submodules 310. The PCRE detection sub-module 310 comprises a Multi-Pattern Detection Module 320 and a Programmable PCRE Match module 330.

멀티 패턴 탐지 모듈(320)은 고속 패킷 처리 모듈(200)에서 탐지된 고정 패턴 매칭 결과들을 수신하여 관련 고정 패턴이 포함되어 있는 룰(Rule)의 경우 고정 패턴(Fixed Pattern)의 수가 여러 개일 경우에, 멀티패턴들을 탐지한 후 PCRE 룰 요청 신호(Rule Request Signal)을 발생하고 해당되는 룰에 포함되어 있는 PCRE를 프로그래머블 PCRE 매치 모듈(330)로 PCRE 룰을 쓰게 되도록 한다.The multi-pattern detection module 320 receives the fixed pattern matching results detected by the high-speed packet processing module 200, and when the number of fixed patterns is several in the case of a rule including an associated fixed pattern, , Generates a PCRE rule request signal (Rule Request Signal) after detecting the multi-patterns, and causes the PCRE included in the corresponding rule to be written into the programmable PCRE matching module 330 using the PCRE rule.

본 발명에서 구현하고자 하는 주요 기능들은 PCRE 탐지 기능을 통해 가능하며 프로그래머블 PCRE 매치 모듈(330)의 경우, 멀티 패턴 탐지 모듈(320)의 결과를 바탕으로 해서 관련이 있는 PCRE가 실시간으로 프로그램 되도록 소량의 로직을 사용하여 PCRE 탐지 기능이 구현된다.The main functions to be implemented in the present invention are enabled by the PCRE detection function. In the case of the programmable PCRE match module 330, based on the result of the multi-pattern detection module 320, PCRE detection is implemented using logic.

PCRE 탐지 서브 모듈(310)은 고정 패턴의 결과에 따라 구현이 되는데, 고정 패턴의 해석 결과가 여러 개의 룰에 포함될 가능성이 있는 경우에는 다수의 PCRE 탐지 서브 모듈(310)이 동시에 구동되어 패킷의 페이로드(payload)에 대한 PCRE 매칭이 실 시간으로 처리될 수 있도록 한다.When the analysis result of the fixed pattern is likely to be included in several rules, a plurality of PCRE detection submodules 310 are simultaneously driven and the packet payout So that the PCRE matching for the payload can be processed in real time.

각 PCRE 탐지 서브 모듈(310)은 PCRE 매칭 결과 들을 발생하게 되며 이 결과들은 탐지 결과 처리 모듈(500)로 전달 되게 된다.Each PCRE detection sub-module 310 generates PCRE matching results, which are passed to the detection result processing module 500.

도 8은 본 발명에 따른 다이나믹 해시(Hash) 및 매치 모듈의 구조를 보이고 있다.FIG. 8 shows a structure of a dynamic hash and a match module according to the present invention.

도 8을 참조하면, 다이나믹 해시 및 매치 모듈(400)의 주된 목적은 입력 데이터에서 반복적으로 나타날 수 있는 데이터의 형태(예를 들어 파일)들을 구별할 수 있는 자체 파라메타를 추출하여 반복적으로 같은 파일에 대한 해시(Hash) 값을 계산하는 절차를 줄여서 시스템의 전체 성능을 높이는 것이다.Referring to FIG. 8, the main purpose of the dynamic hash and match module 400 is to extract the self-parameters that can distinguish the types of data (e.g., files) that can appear repeatedly in the input data, It reduces the procedure for calculating the hash value for the entire system.

다이나믹 해시와 매치 모듈(400)은 파일 콘텐츠 해싱 모듈(File Content Hashing Module)(410), 해시 매치 모듈(420), 메타데이터 추출 모듈(Metadata Extraction Module)(430), 메타데이터 매치 모듈(440), 메타데이터 엔트리 테이블(450)을 포함하여 구성된다.The dynamic hash and match module 400 includes a file content hashing module 410, a hash match module 420, a metadata extraction module 430, a metadata match module 440, , And a metadata entry table (450).

파일 콘텐츠 해싱 모듈(410)은 입력되는 패킷들로 이루어 지는 세션정보를 통해 전달되는 파일의 시작점을 파악한 후 관련 파일에 속하는 패킷들을 수집해서 본 발명의 장치 안에서 CPU와의 연동 기능이 없이 파일을 복원한다. 이렇게 복원된 파일에 포함되어 있는 유해패턴의 유무를 확인 하기 위한 Hash 기능(예를 들어 MD5 hash)을 구동하여 해시 결과 값(Hash Result)을 만든다.The file content hashing module 410 grasps the start point of the file transmitted through the session information composed of the input packets and collects the packets belonging to the related file to restore the file without the interoperation function with the CPU in the apparatus of the present invention . A hash function (for example, MD5 hash) is operated to check whether there is a harmful pattern included in the restored file, thereby creating a hash result value.

해시 매치 모듈(420)은 이미 유해성을 가지고 있는 파일의 해시 결과 값으로 정의되어 기존 해시 값 테이블(Existing Hash Value Table)(421)에 저장되어 있는 값들과 파일 콘텐츠 해싱 모듈(410) 에서 파일이 재구성되어 해시 결과 값으로 입력되는 값을 비교한다.The hash match module 420 is defined as the hash result value of the already harmful file, and the values stored in the existing hash value table 421 and the values stored in the file content hashing module 410, And compares the input value with the hash result value.

특히 해시 매치 모듈(420)의 해시 매치 기능은 메타데이터 추출 모듈(Metadata Extraction Module)(430)에서 제공되는 해시 매치 제어신호에 의해서 시작된다. 해시 매치 제어신호가 포지티브(Positive)일 경우에는 해시 읽기(Hash Read) 신호가 기존 해시 값 테이블(421)을 트리거(trigger)하고 읽게 되는 해시 읽기 값(Hash Read Value)과 비교 된다. 이렇게 비교된 결과 값은 해시 매칭 결과의 일부로서 탐지 결과 처리 모듈(500)에 전달되게 된다.Particularly, the hash match function of the hash match module 420 is started by the hash match control signal provided by the metadata extraction module 430. When the hash match control signal is positive, a hash read signal is compared with a hash read value that triggers the existing hash value table 421 and is read. The result of the comparison is transmitted to the detection result processing module 500 as a part of the hash matching result.

메타데이터 추출 모듈(430)은 파일 콘텐츠 해싱 모듈(410)에서 제공되는 파일 파일 시작 지시 신호를 기준으로 하여 입력되는 인입 패킷들로부터 각 파일에 대한 파일 메타데이터를 추출하게 된다.The metadata extraction module 430 extracts the file metadata of each file from the incoming packets based on the file file start instruction signal provided by the file content hashing module 410.

메타데이터 매치 모듈(440)은 특정 파일의 종류에 따라 정의된 메타데이터 값이 메타데이터 추출 모듈(430)로부터 제공되면 메타데이터 엔트리 테이블(Metadata Entry Table)(450)로 부터 자체적으로 생성하여 저장되어 있는 메타데이터 값을 읽어와서 비교하게 된다. 메타데이터 엔트리 테이블(450)에 저장되어 있는 메타데이터 값이 화이트리스트(Whitelist)로서 작용이 되는 경우, 즉 해시 매치 모듈(420)의 해시 매칭 결과가 네가티브(Negative)이면(해시 값으로 확인된 파일의 유해 가능성이 없는 경우), 해시 매치 모듈(420)로 해시 매치 제어 신호가 네가티브로 해서 보내게 되며 해시 매치 모듈(420)은 세션 리셋(Session Reset) 신호를 파일 해싱 모듈(410)로 보내게 되며 해당 파일 재조합 과정을 시작하지 않게 하여 본 장치의 해싱 기반 매칭 성능을 높게 유지할 수 있게 한다.The metadata matching module 440 generates and stores metadata values automatically defined from the metadata entry table 450 when the metadata values defined according to the type of the specific file are provided from the metadata extraction module 430 The metadata values are read and compared. When the metadata value stored in the metadata entry table 450 acts as a whitelist, that is, when the hash matching module 420 has a negative hash value (a file identified as a hash value The hash match module 420 sends a negative hash match control signal to the hash match module 420 and the hash match module 420 sends a session reset signal to the file hash module 410 And does not start the process of reassembling the file, so that the hashing-based matching performance of the present apparatus can be kept high.

메타데이터 엔트리 테이블(450)에는 메타데이터 추출 모듈(430)에서 추출된 파일 메타데이터가 저장되게 된다. 해시 매치 모듈(420)의 결과가 네가티브일 경우에 인에이블(Enable)되는 메타데이터 업데이터(Metadata Update) 신호에 의해 파일 메타데이터가 저장된다.In the metadata entry table 450, the file metadata extracted by the metadata extraction module 430 is stored. The file metadata is stored by a metadata update signal which is enabled when the result of the hash match module 420 is negative.

메타데이터 엔트리 테이블(450)에 저장되어 있는 메타데이터는 실시간으로 업데이트 가능한 구조로 구현되어 메타데이터 매치 모듈(440)로부터의 메타 읽기 신호에 의해 저장되어 있는 메터데이터를 전달하게 된다.The meta data stored in the meta data entry table 450 is implemented in a structure that can be updated in real time, and the meta data stored by the meta read signal from the meta data match module 440 is transmitted.

도 9는 본 발명에 따른 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법의 흐름도이다.9 is a flowchart of an FPGA-based fast snooze rule and a Yahara rule matching method according to the present invention.

도 9를 참조하면, 본 발명의 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법은 룰 변환 단계(S100), 패턴 매칭 단계(S200), 해시 매칭 단계(S300), 및 패킷 포워딩 단계(S400)로 구성된다. Referring to FIG. 9, the FPGA-based fast Snooze rule and Yarra rule matching method includes a rule conversion step S100, a pattern matching step S200, a hash matching step S300, and a packet forwarding step S400 .

여기서, 4개의 단계들은 모두 실시간으로 통신 가능하고 동시에 각 기능을 처리하는 병렬처리를 바탕으로 구현된다. 룰 변환 단계의 경우 CPU에서 룰 변환 작업이 수행되고 변환된 결과 값, 즉 본 발명에서 사용되는 탐지 식별자들은 FPGA가 있는 하드웨어 보드에 있는 메모리에 저장되어 FPGA내부에서 동작되는 패턴 매칭 단계, 해시 매칭 단계, 그리고 패킷 포워딩 단계들에서 패킷 단위 프로세싱을 하는 과정에서 필요한 룰에 대한 정보를 실시간으로 제공해 주기도 한다. 룰 변환 단계의 경우 새로운 스노트 룰과 야라 룰을 적용하고자 할 때 FPGA 보드가 동작하는 것과는 무관하게 진행이 될 수 있다.Here, the four steps are all implemented based on parallel processing capable of communicating in real time and simultaneously processing each function. In the rule conversion step, a rule conversion operation is performed in the CPU, and the converted result values, that is, the detection identifiers used in the present invention are stored in a memory on a hardware board of the FPGA and are operated in the FPGA, , And provides information on rules in real time in the process of packet-based processing in packet forwarding steps. For the rule translation step, you can proceed regardless of whether the FPGA board is running when you want to apply the new Snort rule and the Yarar rule.

도 9를 참조하여 각 엔진의 단계별로 설명하기로 한다.The steps of each engine will be described with reference to FIG.

룰 변환 단계(S100)가 동작하는 기능모듈은 탐지 룰 변환기(100)이다.The function module in which the rule conversion step (S100) operates is the detection rule converter (100).

룰 변환 단계(S100)는 스노트 룰 및 야라 룰 편집 단계(S110), 고정 패턴 저장 단계(S120), 및 PCRE 패턴 저장 단계(S130)로 이루어진다.The rule conversion step S100 includes a Snort rule and a Yarra rule editing step S110, a fixed pattern storing step S120, and a PCRE pattern storing step S130.

스노트 룰 및 야라 룰 편집 단계(S110)는 스노트와 야라 룰들을 본 발명에서 적용하고자 하는 룰의 형태로 변환하여 고정 패턴 저장 단계(Fixed Pattern Storage stage)(S120)과 PCRE 패턴 저장 단계(S120)에서 각각 할당되어 있는 하드웨어 보드상의 메모리에 저장되게 된다.The Snort rule and Yarar rule editing step S110 converts the Snort and Yarar rules into a form of a rule to be applied in the present invention and stores them in a fixed pattern storage step S120 and a PCRE pattern storing step S120 ) To be stored in the memory on the hardware board that is assigned to each.

고정 패턴 저장 단계(S120)는 스노트 및 야라 룰에서 변환되어 나온 고정 패턴들이 탐지 엔지(1000)에 있는 고속 패킷 처리 모듈(200)에서 적용될 수 있도록 탐지 엔진(1000)이 동작하는 FPGA의 내부 듀얼 포트 RAM 블럭 메모리에 저장된다.The fixed pattern storage step S120 is a step in which the fixed patterns converted in the snoop and yahoo rules are applied to the fast packet processing module 200 in the detection engine 1000, Port RAM is stored in block memory.

PCRE 패턴 저장 단계(S130)는 스노트 및 야라 룰에서 변환된 결과값 중의 PCRE 패턴을 FPGA 보드 상에 있는 메모리에 저장하게 된다. 이 때 저장되는 데이터의 형태는 탐지 엔진(1000)의 PCRE 탐지 모듈(300)에서 준비되어 있는 DFA세부 엔진을 프로그램 할 수 있는 형태로 되어 있다. 즉 각 패킷에 대한 고속 패킷 처리 모듈(200)의 처리 결과가 PCRE 패턴 매칭을 해야 하는 경우 룰 변환 엔진(Rule Compilation Engine)에서 해당 패턴의 고유번호를 바탕으로 정확한 PCRE 패턴값을 PCRE 탐지 모듈(300)으로 전달하여 DFA를 프로그램한 후 바로 PCRE 패턴 동작을 실행할 수 있게 한다.The PCRE pattern storing step (S130) stores the PCRE pattern among the converted result values in the Snort and Yarar rules in the memory on the FPGA board. The type of data to be stored at this time is such that the DFA detailed engine prepared in the PCRE detection module 300 of the detection engine 1000 can be programmed. That is, when the processing result of the fast packet processing module 200 for each packet requires PCRE pattern matching, a rule conversion engine (Rule Compilation Engine) sets an accurate PCRE pattern value based on the unique number of the pattern to the PCRE detection module 300 ) So as to execute the PCRE pattern operation immediately after programming the DFA.

패턴 매칭 단계(S200)는 고속 패킷 처리 모듈(200), PCRE 탐지 모듈(300), 및 다이나믹 해시 및 매치 제어 모듈(400)에서 구현된다.The pattern matching step S200 is implemented in the fast packet processing module 200, the PCRE detection module 300, and the dynamic hash and match control module 400.

패턴 매칭 단계(S200)는 네트워크 패킷 수신 단계(S210), 패킷 파싱(parsing) 단계(S220), 고정 패턴 매칭 단계(S230), PCRE 패턴 매칭 요구 단계(S240), alc PCRE 패턴 매칭 단계(S250)로 이루어진다.The pattern matching step S200 includes a network packet receiving step S210, a packet parsing step S220, a fixed pattern matching step S230, a PCRE pattern matching request step S240, an alc PCRE pattern matching step S250, .

네트워크 패킷 수신 단계(S210)에서는 입력 패킷이 수신되어 패킷 FIFO(600)에 저장되고 동시에 고속 패킷 처리 모듈(200)에 전달되어 패킷 파싱(parsing)(S220)을 하게 되고 L3/L4 헤더값과 페이로드(payload)를 구별된다. 추출된 결과중 페이로드에 해당되는 내용은 고정 패턴 매칭 단계(S230)에서 FPGA안에 저장되어 있는 고정 패턴(fixed pattern)과 실시간으로 비교하는 작업이 진행된다. 고정 패턴 매칭(Fixed Pattern Matching) 탐지의 결과가 나올 경우 각 고장 패턴에 할당되어 있는 룰 번호를 식별하게 된다. 이렇게 구별된 룰 번호를 확인 하면 해당 룰에 적용되는 PCRE 패턴이 있는지를 PCRE 패턴 매칭 요구 단계(S240)에서 확인하게 된다. In the network packet receiving step S210, the input packet is received and stored in the packet FIFO 600, and simultaneously transmitted to the high speed packet processing module 200 to perform packet parsing (S220). The L3 / L4 header value and the payload The payload is distinguished. The contents corresponding to the payload among the extracted results are compared with the fixed pattern stored in the FPGA in the fixed pattern matching step (S230). Fixed Pattern Matching When the result of detection is found, the rule number assigned to each fault pattern is identified. When the rule numbers thus identified are checked, the PCRE pattern matching request step (S240) confirms whether there is a PCRE pattern applied to the rule.

이때의 결과에 따라 PCRE 패턴 매칭이 필요한 룰일 경우에는 PCRE 패턴 매칭 단계(S250)에서 관련 PCRE 패턴이 본 발명의 PCRE 패턴 매칭에 적용될 수 있도록 PCRE 패턴 저장(Pattern Storage)으로부터 읽어와서 관련 DFA를 프로그램하여 PCRE 패턴 매칭이 진행될 수 있게 한다.If the PCRE pattern matching is required according to the result, the PCRE pattern matching step S250 reads the PCRE pattern from the PCRE pattern storage so that the related PCRE pattern can be applied to the PCRE pattern matching of the present invention, Allow PCRE pattern matching to proceed.

해시 매칭 단계(S300)는 패턴 매칭 단계의 패킷 파싱(S220)으로부터 패킷의 헤더 값과 패이로드를 수신하여 파일 재집회 단계(S310)에서 해당 세션을 바탕으로 파일을 재구성하게 된다. 이렇게 재구성된 파일에 대한 MD5 해싱(hashing) 결과값을 파일 기반 해시 연산(File-based Hash Calculation) 및 업데이터 단계(S320) 에서 FPGA내부에 있는 메모리에 저장하게 된다.The hash matching step S300 receives the header value and the payload of the packet from the packet parsing S220 of the pattern matching step and reconstructs the file based on the session in the file re-gathering step S310. The MD5 hashing result for the reconstructed file is stored in a memory inside the FPGA in a file-based hash calculation and an updater step S320.

이렇게 저장된 값은 추가적으로 입력되는 패킷을 바탕으로 재구성되는 파일들의 해시(Hash) 값을 계산한 후 저장된 해시값들과 해시값 매칭 (S330)에서 비교하게 된다.The stored value is calculated by calculating a hash value of files to be reconstructed on the basis of the input packet, and then compared with the stored hash values in a hash value matching operation (S330).

이렇게 비교된 결과는 PCRE 패턴 매칭 요구 단계(S330)에 전달되며 PCRE룰 관련(야라 룰 매칭)을 할 것인지 아닌지를 판단하게 된다.The result of the comparison is transmitted to the PCRE pattern matching request step S330, and it is determined whether or not to perform the PCRE rule (yara rule matching).

탐지 결과 처리 단계(S340)는 탐지 결과 처리 모듈(500)에서 구현되는데 패턴 매칭 엔진과 해시 메칭 엔진에서의 탐지결과들을 바탕으로 완화 제어(Mitigation Control) 신호를 발생하여 패킷 포워딩 엔진으로 전달되게 된다.The detection result processing step S340 is implemented in the detection result processing module 500. The mitigation control signal is generated based on the detection results in the pattern matching engine and the hash-matching engine, and is transmitted to the packet forwarding engine.

패킷 포워딩 단계(S400)는 패킷 버퍼링 단계(S410)과 완화 정책 응용 단계 (S420)으로 구성되는데 입력된 한 개의 입력 패킷에 대해 패턴 매칭 엔진과 해시 매칭 엔진에서의 프로세싱이 마무리 된 다음 완화 제어신호가 발생되게 되면, 해당 패킷에 대한 매칭 절차가 완료된 것으로 인식하여 패킷 FIFO(600)으로 부터 패킷을 읽어 내어 완화 정책 응용 단계(S420) 에서 패킷을 완화(드롭)할지에 대한 판단을 하여 패킷 드롭(packet drop)과 패킷 포워딩 기능이 연속적으로 발생되도록 하는 역할을 한다.The packet forwarding step S400 includes a packet buffering step S410 and a mitigation policy application step S420. The processing of the pattern matching engine and the hash matching engine is completed for one inputted packet, and then the mitigation control signal It is determined that the matching procedure for the packet has been completed and the packet is read from the packet FIFO 600 to determine whether to mitigate (drop) the packet in the mitigation policy application step (S420) drop and packet forwarding functions are continuously generated.

상기 내용에서 설명한 바와 같이 룰 변환 단계, 패턴 매칭 단계, 해시 매칭 단계와 패킷 포워딩 단계는 동시에 각 기능들을 수행하여 본 발명에서 필요한 세부 기능들을 FPGA 기반 초고속으로 구현할 수 있게 한다.As described above, the rules conversion step, the pattern matching step, the hash matching step, and the packet forwarding step simultaneously perform respective functions to enable detailed functions required in the present invention to be implemented at an FPGA-based super high speed.

이상에서 설명한 본 발명은 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 있어 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 한정되는 것은 아니다.It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the invention. It is not.

Claims (5)

스노트 룰과 야라 룰을 탐지 룰 변환기에서 변환하여 고정 패턴과 PCRE 패턴을 하드웨어 보드상의 메모리에 저장하는 룰 변환 단계;
상기 변환된 룰을 바탕으로 네트워크로부터 입력되는 패킷을 수신하여 패킷 FIFO과 고속 패킷 처리 모듈에서 패킷 파싱을 하여 각각 고정 패턴과 PCRE 패턴 매칭을 수행하는 패턴 매칭 단계;
상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 파일을 재구성하여 FPGA 내부에 있는 메모리에 저장하고, 추가적으로 입력되는 패킷을 바탕으로 저장된 해시값들과 매칭하여 탐지 결과 처리 모듈에서 완화 제어 신호를 발생하는 해시 매칭 단계; 및
상기 패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭과 패킷 포워딩을 연속적으로 발생하는 패킷 포워딩 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
A rule conversion step of converting the Snort rule and the Yarar rule in the detection rule converter to store the fixed pattern and the PCRE pattern in the memory on the hardware board;
A pattern matching step of receiving a packet input from the network based on the converted rule and performing packet parsing in a packet FIFO and a fast packet processing module to perform a fixed pattern and a PCRE pattern matching, respectively;
Receives the header value and payload of the packet from the packet parsing, reconstructs the file, stores it in a memory in the FPGA, matches the hash values stored on the basis of the further input packet, and outputs a mitigation control signal in the detection result processing module A generated hash matching step; And
And a packet forwarding step of continuously generating a packet drop and a packet forwarding by determining whether to mitigate a packet by reading a packet from the packet FIFO.
제1항에 있어서,
상기 룰 변환 단계는,
상기 스노트와 야라 룰을 탐지 룰 변환기에서 변환하는 스노트 룰 및 야라 룰 편집 단계;
상기 스노트 룰과 야라 룰에서 변환된 고정 패턴들이 고속 패킷 처리 모듈에서 적용될 수 있도록 탐지 엔진이 동작하는 FPGA의 내부 듀얼 포트 RAM 블럭 메모리에 저장하는 고정 패턴 저장 단계; 및
상기 스노트 및 야라 룰에서 변환된 결과값 중의 PCRE 패턴을 FPGA 보드 상에 있는 메모리에 저장하는 PCRE 패턴 저장 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method according to claim 1,
The rule transformation step includes:
A snooze rule and a yaho rule editing step for converting the snoop and yaho rules in the detection rule converter;
A fixed pattern storage step of storing the fixed patterns converted in the Snort rule and the Jahar rule in an internal dual port RAM block memory of the FPGA in which the detection engine operates so that the fixed patterns can be applied in the high speed packet processing module; And
And a PCRE pattern storing step of storing the PCRE pattern among the converted result values in the Snort and Yarar rules in a memory on the FPGA board.
제1항에 있어서,
상기 패턴 매칭 단계는,
입력 패킷이 수신되어 패킷 FIFO에 저장되고 동시에 고속 패킷 처리 모듈(200)에 전달되어 패킷 파싱을 하게 되고 헤더값과 페이로드를 구별하는 네트워크 패킷 수신 단계;
추출된 결과중 페이로드에 해당되는 내용은 FPGA안에 저장되어 있는 고정 패턴과 실시간으로 비교하는 고정 패턴 매칭 단계;
고정 패턴 매칭 탐지의 결과가 나올 경우 각 고정 패턴에 할당되어 있는 룰 번호를 식별하여 룰 번호를 확인하면 해당 룰에 적용되는 PCRE패턴이 있는지를 확인하는 PCRE 패턴 매칭 요구 단계; 및
PCRE 패턴 매칭이 필요한 룰일 경우 관련 PCRE 패턴이 PCRE 패턴 매칭에 적용될 수 있도록 PCRE 패턴 저장으로부터 읽어와서 관련 DFA를 프로그램하여 PCRE 패턴 매칭이 진행될 수 있게 하는 PCRE 패턴 매칭 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method according to claim 1,
Wherein the pattern matching step comprises:
A network packet receiving step of receiving the input packet and storing it in the packet FIFO and simultaneously transmitting the packet to the high speed packet processing module 200 to perform packet parsing and to distinguish the header value from the payload;
Among the extracted results, the contents corresponding to the payload are a fixed pattern matching step to compare with the fixed pattern stored in the FPGA in real time;
A PCRE pattern matching request step of identifying a rule number assigned to each fixed pattern when a result of the fixed pattern matching detection is found and confirming whether the PCRE pattern is applied to the rule by confirming the rule number; And
And a PCRE pattern matching step of reading from the PCRE pattern storage so that the related PCRE pattern can be applied to the PCRE pattern matching when the PCRE pattern matching is required and programming the related DFA so that the PCRE pattern matching can proceed. Based fast snooze rule and yara rule matching method.
제1항에 있어서,
상기 해시 매칭 단계는,
상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 해당 세션을 바탕으로 파일을 재구성하는 파일 재집회 단계;
상기 재구성된 파일에 대한 MD5 해싱(hashing) 결과값을 FPGA내부에 있는 메모리에 저장하는 파일 기반 해시 연산 및 업데이터 단계;
추가적으로 입력되는 패킷을 바탕으로 재구성되는 파일들의 해시(Hash) 값을 계산한 후 저장된 해시값들과 비교하는 해시값 매칭 단계;
PCRE룰 매칭을 할 것인지 아닌지를 판단하는 PCRE 패턴 매칭 요구 단계; 및
상기 패턴 매칭 단계와 해시 매칭 단계에서 탐지결과들을 바탕으로 완화 제어 신호를 발생하여 패킷 포워딩 엔진으로 전달하는 탐지 결과 처리 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method according to claim 1,
The hash matching step comprises:
Receiving a header value and a payload of a packet from the packet parsing and reconstructing a file based on the session;
A file-based hash computation and updater for storing MD5 hashing results for the reconstructed file in a memory within the FPGA;
A hash value matching step of calculating a hash value of files to be reconstructed based on a further input packet and comparing the hash values with stored hash values;
A PCRE pattern matching request step for determining whether to perform PCRE rule matching; And
And a detection result processing step of generating a mitigation control signal based on the detection results in the pattern matching step and the hash matching step and delivering the mitigation control signal to the packet forwarding engine.
제1항에 있어서,
상기 패킷 포워딩 단계는,
네트워크로부터 입력되는 패킷을 수신하여 버퍼링하는 패킷 버퍼링 단계; 및
패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭(packet drop)과 패킷 포워딩 기능이 연속적으로 발생되도록 하는 완화 정책 응용 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method according to claim 1,
Wherein the packet forwarding step comprises:
A packet buffering step of receiving and buffering a packet input from the network; And
And a mitigation policy application step of causing a packet drop and a packet forwarding function to be successively generated by determining whether to mitigate a packet by reading a packet from the packet FIFO, And a method of matching a rule.
KR1020170115181A 2017-09-08 2017-09-08 Matching method of high speed snort rule and yara rule based on fpga KR102014741B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170115181A KR102014741B1 (en) 2017-09-08 2017-09-08 Matching method of high speed snort rule and yara rule based on fpga

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170115181A KR102014741B1 (en) 2017-09-08 2017-09-08 Matching method of high speed snort rule and yara rule based on fpga

Publications (2)

Publication Number Publication Date
KR20190028597A true KR20190028597A (en) 2019-03-19
KR102014741B1 KR102014741B1 (en) 2019-08-28

Family

ID=65908437

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170115181A KR102014741B1 (en) 2017-09-08 2017-09-08 Matching method of high speed snort rule and yara rule based on fpga

Country Status (1)

Country Link
KR (1) KR102014741B1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460611A (en) * 2019-08-16 2019-11-15 国家计算机网络与信息安全管理中心 Full flow attack detecting technology based on machine learning
KR20210045562A (en) * 2019-10-16 2021-04-27 한국전자통신연구원 Method of shareing cyber threat information based on anonymized network traffic and system using the same
CN115208682A (en) * 2022-07-26 2022-10-18 上海欣诺通信技术股份有限公司 High-performance network attack feature detection method and device based on snort

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100809416B1 (en) * 2006-07-28 2008-03-05 한국전자통신연구원 Appatus and method of automatically generating signatures at network security systems
KR101378115B1 (en) * 2012-11-01 2014-03-27 한국전자통신연구원 Intrusion detection apparatus and method using pattern matching technology based on perl compatible regular expressions
KR20140090123A (en) * 2014-06-20 2014-07-16 (주)소만사 Hardward Engine for High-capacity Packet Processing of Network Data Loss Prevention Appliance

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100809416B1 (en) * 2006-07-28 2008-03-05 한국전자통신연구원 Appatus and method of automatically generating signatures at network security systems
KR101378115B1 (en) * 2012-11-01 2014-03-27 한국전자통신연구원 Intrusion detection apparatus and method using pattern matching technology based on perl compatible regular expressions
KR20140090123A (en) * 2014-06-20 2014-07-16 (주)소만사 Hardward Engine for High-capacity Packet Processing of Network Data Loss Prevention Appliance

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110460611A (en) * 2019-08-16 2019-11-15 国家计算机网络与信息安全管理中心 Full flow attack detecting technology based on machine learning
CN110460611B (en) * 2019-08-16 2022-01-11 国家计算机网络与信息安全管理中心 Machine learning-based full-flow attack detection technology
KR20210045562A (en) * 2019-10-16 2021-04-27 한국전자통신연구원 Method of shareing cyber threat information based on anonymized network traffic and system using the same
CN115208682A (en) * 2022-07-26 2022-10-18 上海欣诺通信技术股份有限公司 High-performance network attack feature detection method and device based on snort
CN115208682B (en) * 2022-07-26 2023-12-12 上海欣诺通信技术股份有限公司 High-performance network attack feature detection method and device based on snort

Also Published As

Publication number Publication date
KR102014741B1 (en) 2019-08-28

Similar Documents

Publication Publication Date Title
US11916933B2 (en) Malware detector
US7596809B2 (en) System security approaches using multiple processing units
US10027691B2 (en) Apparatus and method for performing real-time network antivirus function
JP4490994B2 (en) Packet classification in network security devices
US7873998B1 (en) Rapidly propagating threat detection
Xinidis et al. An active splitter architecture for intrusion detection and prevention
US20090055930A1 (en) Content Security by Network Switch
US20090307776A1 (en) Method and apparatus for providing network security by scanning for viruses
US11290484B2 (en) Bot characteristic detection method and apparatus
US9294487B2 (en) Method and apparatus for providing network security
JP7388613B2 (en) Packet processing method and apparatus, device, and computer readable storage medium
EP1122932A2 (en) Protection of computer networks against malicious content
US20160269443A1 (en) Exploit detection based on heap spray detection
CN109688153A (en) Use threat detection on the zero of host application/program to user agent mapping
WO2007104988A1 (en) A method and apparatus for providing network security
KR102014741B1 (en) Matching method of high speed snort rule and yara rule based on fpga
CN111865996A (en) Data detection method and device and electronic equipment
US20150019631A1 (en) Server-based system, method, and computer program product for scanning data on a client using only a subset of the data
US9306908B2 (en) Anti-malware system, method of processing packet in the same, and computing device
GB2417655A (en) Network-based platform for providing security services to subscribers
KR102014736B1 (en) Matching device of high speed snort rule and yara rule based on fpga
WO2017217247A1 (en) Malignant event detection apparatus, malignant event detection method, and malignant event detection program
JP7411775B2 (en) Inline malware detection
US20050289245A1 (en) Restricting virus access to a network
Hsu et al. Scalable network-based buffer overflow attack detection

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant