KR102014741B1 - 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
KR102014741B1
KR102014741B1 KR1020170115181A KR20170115181A KR102014741B1 KR 102014741 B1 KR102014741 B1 KR 102014741B1 KR 1020170115181 A KR1020170115181 A KR 1020170115181A KR 20170115181 A KR20170115181 A KR 20170115181A KR 102014741 B1 KR102014741 B1 KR 102014741B1
Authority
KR
South Korea
Prior art keywords
packet
rule
pcre
pattern
matching
Prior art date
Application number
KR1020170115181A
Other languages
Korean (ko)
Other versions
KR20190028597A (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Power Engineering (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

본 발명은 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법에 관한 것으로, 스노트 룰과 야라 룰을 탐지 룰 변환기에서 변환하여 고정 패턴과 PCRE 패턴을 하드웨어 보드상의 메모리에 저장하는 룰 변환 단계; 상기 변환된 룰을 바탕으로 네트워크로부터 입력되는 패킷을 수신하여 패킷 FIFO과 고속 패킷 처리 모듈에서 패킷 파싱을 하여 각각 고정 패턴과 PCRE 패턴 매칭을 수행하는 패턴 매칭 단계; 상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 파일을 재구성하여 FPGA 내부에 있는 메모리에 저장하고, 추가적으로 입력되는 패킷을 바탕으로 저장된 해시값들과 매칭하여 탐지 결과 처리 모듈에서 완화 제어 신호를 발생하는 해시 매칭 단계; 및 상기 패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭과 패킷 포워딩을 연속적으로 발생하는 패킷 포워딩 단계;를 포함하는 것을 특징으로 한다.The present invention relates to an FPGA-based fast snort rule and Yarra rule matching method, comprising: a rule conversion step of converting a snort rule and a yarra rule in a detection rule converter to store 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 based on the converted rule, parsing the packet in a packet FIFO and a fast packet processing module, and performing fixed pattern and 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 inside the FPGA, and matches the stored hash values based on the additionally input packet to match the mitigation control signal in the detection result processing module. A hash matching step occurring; And a packet forwarding step of successively generating packet drop and packet forwarding by determining whether to relax the packet by reading the packet from the packet FIFO.

Description

FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법{MATCHING METHOD OF HIGH SPEED SNORT RULE AND YARA RULE BASED ON FPGA}MATCHING METHOD OF HIGH SPEED SNORT RULE AND YARA RULE BASED ON FPGA

본 발명은 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 computers to access the network to share information. In addition, these network users typically use the Internet through Web sites for many purposes to share minimal information between computers and computers outside the network. This sharing of information is accomplished by establishing a communication session between the server computer and the client computer. Physical and logical connections between these computers create a global computer network such as the Internet.

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

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

네트워크 연결을 설정하려면 클라이언트 컴퓨터와 서버간에 세션설정 과정이 있어야 한다. 예를 들어 클라이언트 컴퓨터는 서버에 서비스를 요청한다. 이 요청에 대한 응답으로 서버는 메모리 공간과 처리 시간을 할당하고 응답을 컴퓨터로 다시 보내고 클라이언트 컴퓨터가 응답하기를 기다린다. 클라이언트 컴퓨터는 서버에 대한 서비스 요청을 많이 보낼 수는 있지만 서버로 회신하지 않을 수 있다. 그런 다음 서버는 메모리와 처리 시간을 낭비하는 동안 절대로 수신할 수 없는 응답을 기다린다. 기다리는 동안 추가 데이터 패킷을 수신하는 동안 서버의 메모리가 부족하거나 공간을 처리하거나 네트워크 연결이 끊어 질 수 있다. 결국 요청이 너무 많아서 서버가 합법적인 사용자에게 연결을 제공할 수 없으며 인터넷을 통한 서버의 통신이 본질적으로 종료된다. 이로 인해 전자 메일, 인터넷 액세스 및 웹 서버 기능이 손실될 수 있다.To establish a network connection, you need to establish a session 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 many service requests to the server but may not reply back to the server. The server then waits for a response that it can never receive while wasting memory and processing time. While waiting, the server may run out of memory, process space, or lose network connectivity while receiving additional data packets. As a result, there are so many requests that the server cannot provide a connection to a legitimate user and the server's communication over the Internet is essentially terminated. This can cause loss of e-mail, internet access, and web server functionality.

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

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

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은 스노트와 야라에서 적용되는 룰들을 장치에서 사용될 탐지 룰로 변환하고 매칭 장치의 시동 후 항상 룰을 적용하여 장치에 입력되는 패킷의 유입량에 대해 최대한 고속으로 패킷, 세션, 및 파일 단위로 룰을 탐지하여 탐지 후 대응 방식에 따라 실시간으로 네트워크의 보안을 위해 패킷 단위의 방어를 통해 유해 패킷과 파일의 유입을 막는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법을 제공하는 데 있다.An object of the present invention for solving the above problems is to convert the rules applied in the snort and Yarra to detection rules to be used in the device and to always apply the rules after the start of the matching device to the highest speed for the inflow of packets input to the device. FPGA-based fast snort rule and Yarra rule matching that detects rules by packet, session, and file, and prevents the introduction of harmful packets and files through packet-based defense for real-time security of the network according to the detection and response method. To provide a way.

또한, 본 발명의 다른 목적은 FPGA을 이용하여 성능예측 가능한 하드웨어 기반 병렬처리 기능을 구현하여 네트워크 구조가 복잡하고 CPU 전력이 소모되는 시그너쳐 매칭 프로세스에 기인한 검출 및 방지 성능 저하를 극복하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법을 제공하는 데 있다.In addition, another object of the present invention is to implement a hardware-based parallel processing function capable of predicting performance using an FPGA, FPGA-based high-speed to overcome the detection and prevention performance degradation caused by a signature matching process that is complex network structure and consumes CPU power It is to provide a snort rule and Yarra rule matching method.

상기와 같은 목적을 달성하기 위한 본 발명의 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법은, 스노트 룰과 야라 룰을 탐지 룰 변환기에서 변환하여 고정 패턴과 PCRE 패턴을 하드웨어 보드상의 메모리에 저장하는 룰 변환 단계; 상기 변환된 룰을 바탕으로 네트워크로부터 입력되는 패킷을 수신하여 패킷 FIFO과 고속 패킷 처리 모듈에서 패킷 파싱을 하여 각각 고정 패턴과 PCRE 패턴 매칭을 수행하는 패턴 매칭 단계; 상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 파일을 재구성하여 FPGA 내부에 있는 메모리에 저장하고, 추가적으로 입력되는 패킷을 바탕으로 저장된 해시값들과 매칭하여 탐지 결과 처리 모듈에서 완화 제어 신호를 발생하는 해시 매칭 단계; 및 상기 패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭과 패킷 포워딩을 연속적으로 발생하는 패킷 포워딩 단계;를 포함하는 것을 특징으로 한다.The FPGA-based fast snort rule and Yarra rule matching method of the present invention for achieving the above object is to convert the snort rule and Yarra rule in the detection rule converter to store the fixed pattern and PCRE pattern in the memory on the hardware board Rule conversion step; A pattern matching step of receiving a packet input from a network based on the converted rule, parsing the packet in a packet FIFO and a fast packet processing module, and performing fixed pattern and 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 inside the FPGA, and matches the stored hash values based on the additionally input packet to match the mitigation control signal in the detection result processing module. A hash matching step occurring; And a packet forwarding step of successively generating packet drop and packet forwarding by determining whether to relax the packet by reading the packet from the packet FIFO.

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

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

상기 해시 매칭 단계는, 상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 해당 세션을 바탕으로 파일을 재구성하는 파일 재집회 단계; 상기 재구성된 파일에 대한 MD5 해싱(hashing) 결과값을 FPGA내부에 있는 메모리에 저장하는 파일 기반 해시 연산 및 업데이터 단계; 추가적으로 입력되는 패킷을 바탕으로 재구성되는 파일들의 해시(Hash) 값을 계산한 후 저장된 해시값들과 비교하는 해시값 매칭 단계; PCRE룰 매칭을 할 것인지 아닌지를 판단하는 PCRE 패턴 매칭 요구 단계; 및 상기 패턴 매칭 단계와 해시 매칭 단계에서 탐지결과들을 바탕으로 완화 제어 신호를 발생하여 패킷 포워딩 엔진으로 전달하는 탐지 결과 처리 단계;를 포함하는 것을 특징으로 한다.The hash matching step may include: a file reassociation step of receiving a header value and a payload of a packet from the packet parsing and reconstructing a file based on a corresponding session; A file based hash operation and updater for storing an MD5 hashing result of the reconstructed file in a memory inside the FPGA; A hash value matching step of calculating hash values of files reconstructed based on an additionally input packet and comparing the hash values with stored hash values; A PCRE pattern matching request step of determining whether or not 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 a network; And a mitigation policy application step of determining whether to relax the packet by reading the packet from the packet FIFO so that a packet drop and a packet forwarding function are continuously generated.

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

그리고. 본 발명에 따르면 스노트 룰과 야라 룰을 FPGA 기반 패턴 매칭, PCRE 룰 매칭, 야라 룰 매칭 용 자체 룰 포맷으로 컴파일하여 탐지 속도 및 FPGA 내부소요 소자의 적용 양을 최적화하여 구현할 수 있다.And. According to the present invention, the snow rules and the Yarra rules can be compiled into their own rule formats for FPGA-based pattern matching, PCRE rule matching, and Yarra rule matching, thereby optimizing the detection speed and the amount of application of the FPGA internal requirements.

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

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

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

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

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

아래에서는 첨부한 도면을 참고로 하여 본 발명의 실시예에 대하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. DETAILED DESCRIPTION Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art may easily implement the present invention. As those skilled in the art would realize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention.

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

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

도 1을 참조하면, 본 발명의 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 장치는 스노트 룰과 야라 룰을 변환해 주는 탐지 룰 변환기(Detection Rule Compiler)(100)와 탐지 엔진(Detection Engine)(1000)으로 구성된다.Referring to FIG. 1, the FPGA-based fast snort rule and Yarra rule matching device of the present invention may include a detection rule converter 100 and a detection engine (Detection Engine) for converting a snort rule and a yarra 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 a network-based intrusion prevention system (NIPS). It can perform real-time traffic analysis and packet logging on Internet traffic (IP) networks. have. Here, the snort performs protocol analysis, content searching, and matching, and snort uses a detection rule to implement such a function.

야라(YARA)는 정의하기 쉬운 룰을 사용하여 악성 소프트웨어 샘플을 식별하고 분류하는 데 적용되는 도구이며, 야라를 사용하여 파일을 분류하거나 프로세스를 실행하여 악성 코드의 종류를 확인 하는데 사용된다. 이 도구를 사용하면 안티 바이러스 솔루션이 사용자를 위해 수행 할 수 있는 것과 유사한 맬웨어의 서명 기반 탐지(Signature-based detection)를 수행 할 수 있다.YARA is a tool used to identify and classify malicious software samples using easy-to-define rules. It is used to classify files using YARA or run processes to identify the types of malicious code. This tool allows you to perform signature-based detection of malware similar to what an antivirus 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 converter 100 converts the snort rule and the Yarra rule format to enable the fast packet processing module 200 and the PCRE detection module of the detection engine 1000. 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 detects a fixed pattern in the fast packet processing module 200 by receiving an input packet input from a network based on the content of a rule provided from the detection rule converter 100, and the PCRE detection module. PCRE pattern matching at 300, and identical file search results performed at Dynamic Hash & Match Control Module 400, and high speed at Detection Result Processing Module 500. Based on the results of the packet processing module 200 and the PCRE detection module 300 and the dynamic hash and match control module 400, the policy to be applied when the detection result is positively determined is determined. When the mitigation control signal provided from the detection result processing module 500 is transmitted to the mitigation policy application module 700, the mitigation policy application module 700 sends a packet FIFO. The input packet stored in the 600 is read, the detection result application policy is applied, and then sent as an output packet.

입력된 입력 패킷이 패킷 FIFO(600)에 저장되었다가 해당 패킷에 대한 탐지 엔진(1000)에서의 프로세싱 결과가 완화 정책 적용 모듈(700)에서 준비되면 바로 리드(Read) 적용되어 출력 패킷으로 나가게 된다.When the 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 applying module 700, it is read and applied to the output packet. .

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

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

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

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

고속 패킷 처리 모듈(200)에서는 패킷 파싱을 하여 헤더값과 페이로드 값으로 구별하고 고정 패턴 시그니쳐(fixed pattern signature)를 탐지한다. 또한, 추출된 헤더 값과 페이로드 정보를 동적 해시 및 매치 제어 모듈(400), PCRE 탐지 모듈(300), 탐지 결과 처리 모듈(500)에 전하고 고정 패턴(Fixed Pattern) 탐지 결과는 탐지 결과 처리 모듈(500)로 전달한다. 고정 패턴들은 탐지 룰 변환기(100)로부터 공급되며 새로운 고정 패턴 값들은 탐지 룰 변환기(100)에서 새로운 엔트리를 업데이트하거나 기존의 엔트리를 지울 수 있도록 구성되어 있다.The high speed packet processing module 200 parses the packet to distinguish between the header value and the payload value, and detects a fixed pattern signature. In addition, 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, and the fixed pattern detection result is detected. Forward to 500. The fixed patterns are supplied from the detection rule converter 100 and the new fixed pattern values are configured to update the new entry or to delete the existing entry in the detection rule converter 100.

여기서, 고속 패킷 처리 모듈(200)은 변환된 룰의 탐지 파라메타들 중에서 고정 패턴을 고속으로 탐지하는 기능을 수행하는 모듈이다. 고정 패턴 매칭 결과 신호들은 PCRE 탐지 모듈(300)의 기능을 활성화하는 기준 신호로서 사용될 수 있다.Here, the fast packet processing module 200 is a module that detects a fixed pattern at high speed among detection parameters of the converted rule. The fixed pattern matching result signals may be used as a reference signal for activating 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 converter 100 while the device is in operation. If the fixed pattern matching result is positive from the fast packet processing module 200 and there is a PCRE pattern applied to the rule number provided by the detection rule converter 100, the PCRE pattern is received so that the internal DFA can detect the PCRE pattern. Program. This is done on a 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 that are commonly used in real time to minimize the amount of internal required logic as a cost-effective condition. It can be used effectively to detect PCRE rules and to detect large amounts of PCRE rules.

입력 패킷은 또한 동적 해시 및 매치 제어 모듈(400)에도 입력된다. 동일 패킷에 대한 헤더값과 페이로드 값은 고속 패킷 처리 모듈(200)로부터 공급받게 된다. 페이로드로부터 파일을 재조합할 수 있는 내용을 확인하여 파일을 조합한 후 입력 데이터에서 반복적으로 나타날 수 있는 데이터의 형태(예를 들어 파일)들을 구별할 수 있는 자체 파라메타를 추출하여 반복적으로 같은 파일에 대한 해시(Hash)값을 계산하는 절차를 줄여서 시스템의 전체 성능을 높이도록 한다.Input packets are 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 high speed packet processing module 200. Check the recombination of the files from the payload, combine the files, and extract their own parameters that can distinguish the types of data that may appear repeatedly in the input data (for example, files). Reduce the procedure for calculating hash values for the system 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 incoming packets (Incoming Packets) to recombine the file, and first extracts metadata of the file starting to be recombined. Determining whether to start the process of accumulating the file and generating a hash value by accumulating the entire packets, and comparing the hash value of the recombined file with the stored hash values.

고속 패킷 처리 모듈(200), PCRE 탐지 모듈(300), 동적 해시 및 매치 제어 모듈(400)로부터 각각 나오는 고정 패턴 매칭 결과, PCRE 매칭 결과, 및 해시 매칭 결과(Hash Matching Results)는 패킷 단위로 프로세스되어 결과가 나오며 이 결과 값들은 종합적으로 동시에 비교되어 탐지 룰 변환기(100)에서 제공되는 룰 정책(Rule Policies)을 토대로 완화 제어(Mitigation Control) 신호를 발생하게 된다.Fixed pattern matching results, PCRE matching results, and hash matching results from the fast packet processing module 200, the PCRE detection module 300, the dynamic hash, and the match control module 400 are processed in packet units. The result values are comprehensively compared at the same time to generate a Mitigation Control signal based on the Rule Policies provided by the detection rule converter 100.

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

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

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

도 2는 본 발명에 따른 스노트 룰과 야라 룰에 적용되는 탐지 룰 변환기 출력 테이블이고, IPS 장비 또는 차세대 IPS에서 유해 패턴을 탐지하기 위해 사용되는 스노트 룰과 야라 룰에서 적용되는 탐지 룰들을 본 발명에서 사용되는 탐지 엔진 기반 유해 패턴 탐지용 모듈에 적용할 수 있는 형태로 변환한 결과의 예를 보여 주는 것이다.2 is a detection rule converter output table applied to the snort rule and the Yarra rule according to the present invention, and the detection rules applied to the Snort rule and Yarra rule used to detect harmful patterns in IPS equipment or next-generation IPS. It shows an example of the results of the conversion to a form that can be applied to the 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 function module implemented by the present invention is a rule to be detected based on all parameters (Protocol, Source IP, Source Port, Direction, Destination IP, Destination Port, Fixed Pattern, PCRE) shown in the detection rule converter output table 110. Find me.

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

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

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

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

레이어 3과 레이어 4 헤더 정보의 경우 통신 세션을 통해 전달되는 패킷 또는 파일의 내용을 누적할 수 있는 파일들을 추출할 수 있는 기본 데이터를 저장하거나 탐지된 결과의 내용을 구분하는데 적용될 수 있다.The layer 3 and layer 4 header information may be applied to store basic data for extracting files capable of accumulating the contents of a packet or a file transmitted through a communication session or to classify the detected result.

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

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

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

도 4를 참조하면, 시그니쳐 매칭 모듈(210)은 고속 시그니쳐 스케닝 모듈(Fast Signature Scanning Module)(211), 스켄 데이터 저장 모듈(Scanned Data Storage Module)(212)와 완전 패턴 매칭 모듈(Exact Pattern Matching Module)(213)으로 구성되어 있다.Referring to FIG. 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).

시그니쳐 매칭은 바이트 단위로 진행되는데 고정 패턴(Fixed Pattern)들이 고속 시그니쳐 스케닝 모듈(211)과 완전 패턴 매칭 모듈(213)에 프로그램 되어 입력되는 입력 패킷 데이터와 비교된다.Signature matching is performed in units of bytes, and fixed patterns are compared with input packet data programmed and input to the fast signature scanning module 211 and the complete 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, a main objective of the fast signature scanning module 211 is to identify a region of data in which an actual high speed pattern may exist by comparing a length with a portion of a fixed pattern. This function is implemented by using dual-port RAM and stores information on some patterns of the fixed pattern and the length of the pattern, and specifically checks the area to be compared in the data of the input packet. The scanned data stream generated in this way is transferred to the Scanned Data Storage Module 212 so that the data corresponding to the identified length is completely matched by the pattern matching window signal length. It is stored in the internal memory of the (Exact Pattern Matching Module) 213.

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

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

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

도 5는 본 발명에 따른 고속 시그니쳐 스케닝 모듈의 기능 블럭들의 세부 기능을 나타낸 것이다.5 shows the detailed functions of the functional blocks of the fast signature scanning 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 using the 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"이다.Hexadecimal text of 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 fast signature scanning module 211 stores the lengths of the patterns ".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 checks the high speed signature. The pattern matching module 218 actually compares some pattern regions of the signature.

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

도 6은 본 발명에 따른 고속 시그니쳐 길이 스케닝 모듈의 내부 구조를 설명하고 있다.Figure 6 illustrates the internal structure of the 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 is used to check the length of a pattern to be detected using a plurality of dual port RAM 220.

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

이렇게 업데이트 되어 있는 듀얼 포트 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 updated as described above, the values read out indicate the length of the pattern including each input byte value. . In the present case, the value of the pattern length to be pattern matched is read out four times in the same length.

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

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

도 7은 본 발명에 따른 PCRE 탐지 모듈의 구조를 보여 준다.7 shows the structure of a 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 is composed of a plurality of PCRE detection submodules 310. The PCRE detection submodule 310 is composed of 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 fixed pattern matching results detected by the high speed packet processing module 200 and, in the case of a rule including a related fixed pattern, when the number of fixed patterns is multiple. After detecting the multi-patterns, the PCRE rule request signal is generated, and the PCRE rule included in the corresponding rule is written to the programmable PCRE match module 330 by the PCRE rule.

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

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

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

도 8은 본 발명에 따른 다이나믹 해시(Hash) 및 매치 모듈의 구조를 보이고 있다.8 shows a structure of a dynamic hash and 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 its own parameters that can distinguish the types of data (eg, files) that may appear repeatedly in the input data, and repeatedly to the same file. By increasing the overall performance of the system by reducing the procedure for calculating the hash value for.

다이나믹 해시와 매치 모듈(400)은 파일 콘텐츠 해싱 모듈(File Content Hashing Module)(410), 해시 매치 모듈(420), 메타데이터 추출 모듈(Metadata Extraction Module)(430), 메타데이터 매치 모듈(440), 메타데이터 엔트리 테이블(450)을 포함하여 구성된다.The dynamic hash and match module 400 may include a file content hashing module 410, a hash match module 420, a metadata extraction module 430, and 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 starting point of the file delivered through session information consisting of input packets, collects packets belonging to the related file, and restores the file without the interworking function with the CPU in the device of the present invention. . A hash result is generated by running a hash function (eg MD5 hash) to check whether there is a harmful pattern included in the restored file.

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

특히 해시 매치 모듈(420)의 해시 매치 기능은 메타데이터 추출 모듈(Metadata Extraction Module)(430)에서 제공되는 해시 매치 제어신호에 의해서 시작된다. 해시 매치 제어신호가 포지티브(Positive)일 경우에는 해시 읽기(Hash Read) 신호가 기존 해시 값 테이블(421)을 트리거(trigger)하고 읽게 되는 해시 읽기 값(Hash Read Value)과 비교 된다. 이렇게 비교된 결과 값은 해시 매칭 결과의 일부로서 탐지 결과 처리 모듈(500)에 전달되게 된다.In particular, the hash match function of the hash match module 420 is initiated by a 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 and reads an existing hash value table 421. The result value thus compared is transmitted to the detection result processing module 500 as part of the hash matching result.

메타데이터 추출 모듈(430)은 파일 콘텐츠 해싱 모듈(410)에서 제공되는 파일 파일 시작 지시 신호를 기준으로 하여 입력되는 인입 패킷들로부터 각 파일에 대한 파일 메타데이터를 추출하게 된다.The metadata extraction module 430 extracts file metadata for each file from incoming packets input based on the file file start indication signal provided from 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 itself from the metadata entry table 450 when metadata values defined according to a specific file type are provided from the metadata extraction module 430. Read and compare existing metadata values. If the metadata value stored in the metadata entry table 450 acts as a whitelist, that is, if the hash matching result of the hash match module 420 is negative (file identified as a hash value) Is not harmful), the hash match control signal is sent negative to the hash match module 420, and the hash match module 420 sends a session reset signal to the file hashing module 410. It is possible to maintain high hashing-based matching performance of the device by not starting the file recombination process.

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

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

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

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

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

도 9를 참조하여 각 엔진의 단계별로 설명하기로 한다.With reference to Figure 9 will be described step by step of each engine.

룰 변환 단계(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 converting step S100 includes a snow 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)에서 각각 할당되어 있는 하드웨어 보드상의 메모리에 저장되게 된다.Snort rule and Yarra rule editing step (S110) is a fixed pattern storage stage (S120) and PCRE pattern storage step (S120) by converting the snort and Yarra rules into the form of the rule to be applied in the present invention ) Is stored in the memory on each allocated hardware board.

고정 패턴 저장 단계(S120)는 스노트 및 야라 룰에서 변환되어 나온 고정 패턴들이 탐지 엔지(1000)에 있는 고속 패킷 처리 모듈(200)에서 적용될 수 있도록 탐지 엔진(1000)이 동작하는 FPGA의 내부 듀얼 포트 RAM 블럭 메모리에 저장된다.The fixed pattern storing step (S120) is an internal dual of the FPGA in which the detection engine 1000 operates so that fixed patterns converted from the snow and Yarra rules can be applied by the high speed packet processing module 200 in the detection engine 1000. It is stored in port RAM block memory.

PCRE 패턴 저장 단계(S130)는 스노트 및 야라 룰에서 변환된 결과값 중의 PCRE 패턴을 FPGA 보드 상에 있는 메모리에 저장하게 된다. 이 때 저장되는 데이터의 형태는 탐지 엔진(1000)의 PCRE 탐지 모듈(300)에서 준비되어 있는 DFA세부 엔진을 프로그램 할 수 있는 형태로 되어 있다. 즉 각 패킷에 대한 고속 패킷 처리 모듈(200)의 처리 결과가 PCRE 패턴 매칭을 해야 하는 경우 룰 변환 엔진(Rule Compilation Engine)에서 해당 패턴의 고유번호를 바탕으로 정확한 PCRE 패턴값을 PCRE 탐지 모듈(300)으로 전달하여 DFA를 프로그램한 후 바로 PCRE 패턴 동작을 실행할 수 있게 한다.In the PCRE pattern storage step S130, the PCRE pattern of the result values converted from the snow and Yarra rules is stored in a memory on the FPGA board. At this time, the data is stored in a form capable of programming the DFA detail engine prepared in the PCRE detection module 300 of the detection engine 1000. That is, when the processing result of the high speed packet processing module 200 for each packet is to perform PCRE pattern matching, the rule conversion engine (Rule Compilation Engine) based on the unique number of the pattern of the PCRE detection module 300 ) To execute the PCRE pattern operation immediately after programming 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)로 이루어진다.Pattern matching step (S200) is a network packet receiving step (S210), packet parsing (Sparsing) step (S220), fixed pattern matching step (S230), PCRE pattern matching request step (S240), alc PCRE pattern matching step (S250) Is made of.

네트워크 패킷 수신 단계(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), an input packet is received, stored in the packet FIFO 600, and simultaneously delivered to the high speed packet processing module 200 for packet parsing (S220), and the L3 / L4 header value and pay Payload is distinguished. The contents corresponding to the payload among the extracted results are compared in real time with a fixed pattern stored in the FPGA in a fixed pattern matching step (S230). Fixed Pattern Matching When a result of detection is found, the rule number assigned to each failure pattern is identified. When the identified rule number is identified, the PCRE pattern matching request step (S240) determines whether there is a PCRE pattern applied to the corresponding rule.

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

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

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

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

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

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

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

이상에서 설명한 본 발명은 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 있어 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환 변형 및 변경이 가능하므로 전술한 실시예 및 첨부된 도면에 한정되는 것은 아니다.The present invention described above is limited to the above-described embodiments and the accompanying drawings as various substitutional modifications and changes are possible within a range without departing from the technical spirit of the present invention for those skilled in the art. It doesn't happen.

Claims (5)

스노트 룰과 야라 룰을 탐지 룰 변환기에서 변환하여 고정 패턴과 PCRE 패턴을 하드웨어 보드상의 메모리에 저장하는 룰 변환 단계;
상기 변환된 룰을 바탕으로 네트워크로부터 입력되는 패킷을 수신하여 패킷 FIFO과 고속 패킷 처리 모듈에서 패킷 파싱을 하여 각각 고정 패턴과 PCRE 패턴 매칭을 수행하는 패턴 매칭 단계;
상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 파일을 재구성하여 FPGA 내부에 있는 메모리에 저장하고, 추가적으로 입력되는 패킷을 바탕으로 저장된 해시값들과 매칭하여 탐지 결과 처리 모듈에서 완화 제어 신호를 발생하는 해시 매칭 단계; 및
상기 패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭과 패킷 포워딩을 연속적으로 발생하는 패킷 포워딩 단계;를 포함하되,
상기 패턴 매칭 단계는,
입력 패킷이 수신되어 패킷 FIFO에 저장되고 동시에 고속 패킷 처리 모듈(200)에 전달되어 패킷 파싱을 하게 되고 헤더값과 페이로드를 구별하는 네트워크 패킷 수신 단계;
추출된 결과중 페이로드에 해당되는 내용은 FPGA안에 저장되어 있는 고정 패턴과 실시간으로 비교하는 고정 패턴 매칭 단계;
고정 패턴 매칭 탐지의 결과가 나올 경우 각 고정 패턴에 할당되어 있는 룰 번호를 식별하여 룰 번호를 확인하면 해당 룰에 적용되는 PCRE패턴이 있는지를 확인하는 PCRE 패턴 매칭 요구 단계; 및
PCRE 패턴 매칭이 필요한 룰일 경우 관련 PCRE 패턴이 PCRE 패턴 매칭에 적용될 수 있도록 PCRE 패턴 저장으로부터 읽어와서 관련 DFA를 프로그램하여 PCRE 패턴 매칭이 진행될 수 있게 하는 PCRE 패턴 매칭 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
A rule conversion step of converting the snort rule and the yarra rule in the detection rule converter to store the fixed pattern and the PCRE pattern in a memory on a hardware board;
A pattern matching step of receiving a packet input from a network based on the converted rule, parsing the packet in a packet FIFO and a fast packet processing module, and performing fixed pattern and 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 inside the FPGA, and matches the stored hash values based on the additionally input packet to match the mitigation control signal in the detection result processing module. A hash matching step occurring; And
And a packet forwarding step of sequentially generating packet drop and packet forwarding by determining whether to relax the packet by reading the packet from the packet FIFO.
The pattern matching step,
A network packet receiving step of receiving an input packet, storing the packet in a packet FIFO and simultaneously transferring the packet to a high speed packet processing module 200 for packet parsing and distinguishing between a header value and a payload;
The content corresponding to the payload of the extracted result is a fixed pattern matching step of comparing in real time with a fixed pattern stored in the FPGA;
A PCRE pattern matching request step of identifying whether there is a PCRE pattern applied to the corresponding rule when identifying the rule number assigned to each fixed pattern when a result of the fixed pattern matching detection is generated; And
A PCRE pattern matching step of allowing the PCRE pattern matching to proceed by reading the relevant PCRE pattern from the PCRE pattern storage and programming the related DFA so that the PCRE pattern matching can be applied to the PCRE pattern matching. Based fast snort rule and Yarra rule matching method.
제1항에 있어서,
상기 룰 변환 단계는,
상기 스노트와 야라 룰을 탐지 룰 변환기에서 변환하는 스노트 룰 및 야라 룰 편집 단계;
상기 스노트 룰과 야라 룰에서 변환된 고정 패턴들이 고속 패킷 처리 모듈에서 적용될 수 있도록 탐지 엔진이 동작하는 FPGA의 내부 듀얼 포트 RAM 블럭 메모리에 저장하는 고정 패턴 저장 단계; 및
상기 스노트 및 야라 룰에서 변환된 결과값 중의 PCRE 패턴을 FPGA 보드 상에 있는 메모리에 저장하는 PCRE 패턴 저장 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method of claim 1,
The rule conversion step,
A snort rule and yarra rule editing step of converting the snort and yarra rules into a detection rule converter;
A fixed pattern storage step of storing fixed patterns converted from the snow rules and the Yarra rules in an internal dual port RAM block memory of an FPGA in which a detection engine operates so that the fixed patterns converted from the snort rules and the Yarra rules can be applied; And
And a PCRE pattern storage step of storing the PCRE pattern in the result value converted from the snort and Yarra rules in a memory on an FPGA board.
삭제delete 제1항에 있어서,
상기 해시 매칭 단계는,
상기 패킷 파싱으로부터 패킷의 헤더값과 패이로드를 수신하여 해당 세션을 바탕으로 파일을 재구성하는 파일 재집회 단계;
상기 재구성된 파일에 대한 MD5 해싱(hashing) 결과값을 FPGA내부에 있는 메모리에 저장하는 파일 기반 해시 연산 및 업데이터 단계;
추가적으로 입력되는 패킷을 바탕으로 재구성되는 파일들의 해시(Hash) 값을 계산한 후 저장된 해시값들과 비교하는 해시값 매칭 단계;
PCRE룰 매칭을 할 것인지 아닌지를 판단하는 PCRE 패턴 매칭 요구 단계; 및
상기 패턴 매칭 단계와 해시 매칭 단계에서 탐지결과들을 바탕으로 완화 제어 신호를 발생하여 패킷 포워딩 엔진으로 전달하는 탐지 결과 처리 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method of claim 1,
The hash matching step,
A file reassociation step of receiving a packet header value and a payload from the packet parsing and reconstructing a file based on the corresponding session;
A file based hash operation and updater for storing an MD5 hashing result of the reconstructed file in a memory inside the FPGA;
A hash value matching step of calculating hash values of files reconstructed based on an additionally input packet and comparing the hash values with stored hash values;
A PCRE pattern matching request step of determining whether or not 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 result to a packet forwarding engine.
제1항에 있어서,
상기 패킷 포워딩 단계는,
네트워크로부터 입력되는 패킷을 수신하여 버퍼링하는 패킷 버퍼링 단계; 및
패킷 FIFO으로부터 패킷을 읽어 내어 패킷을 완화할지에 대한 판단을 하여 패킷 드롭(packet drop)과 패킷 포워딩 기능이 연속적으로 발생되도록 하는 완화 정책 응용 단계;를 포함하는 것을 특징으로 하는 FPGA 기반 고속 스노트 룰과 야라 룰 매칭 방법.
The method of claim 1,
The packet forwarding step,
A packet buffering step of receiving and buffering a packet input from a network; And
FPGA-based fast snort rule, comprising: a mitigation policy application step that reads the packet from the packet FIFO to determine whether to relax the packet to cause the packet drop and packet forwarding function to occur continuously And Yarra rule matching method.
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 KR20190028597A (en) 2019-03-19
KR102014741B1 true 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)

Families Citing this family (3)

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

Citations (2)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101448549B1 (en) * 2014-06-20 2014-10-13 (주)소만사 Hardward Engine for High-capacity Packet Processing of Network Data Loss Prevention Appliance

Patent Citations (2)

* 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

Also Published As

Publication number Publication date
KR20190028597A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
US10735379B2 (en) Hybrid hardware-software distributed threat analysis
US7596809B2 (en) System security approaches using multiple processing units
US10608992B2 (en) Hybrid hardware-software distributed threat analysis
US10027691B2 (en) Apparatus and method for performing real-time network antivirus function
US20070245417A1 (en) Malicious Attack Detection System and An Associated Method of Use
US8073855B2 (en) Communication control device and communication control system
EP2214115B1 (en) Efficient application identification with network devices
US7706378B2 (en) Method and apparatus for processing network packets
US8417677B2 (en) Communication management system, communication management method and communication control device
US7873998B1 (en) Rapidly propagating threat detection
US8869268B1 (en) Method and apparatus for disrupting the command and control infrastructure of hostile programs
US7865474B2 (en) Data processing system
US9294487B2 (en) Method and apparatus for providing network security
GB2432933A (en) Network security apparatus which extracts a data stream from network traffic and performs an initial operation on the data before scanning for viruses.
CN107979581B (en) Detection method and device for zombie characteristics
KR102014741B1 (en) Matching method of high speed snort rule and yara rule based on fpga
US8572759B2 (en) Communication management system and communication management method
US20130246352A1 (en) System, method, and computer program product for generating a file signature based on file characteristics
WO2007104988A1 (en) A method and apparatus for providing network security
US9306908B2 (en) Anti-malware system, method of processing packet in the same, and computing device
KR102014736B1 (en) Matching device of high speed snort rule and yara rule based on fpga
US8463727B2 (en) Communication management system and communication management method
US20050289245A1 (en) Restricting virus access to a network
KR102046612B1 (en) The system for defending dns amplification attacks in software-defined networks and the method thereof
Deng et al. Understanding {Malware’s} Network Behaviors using Fantasm

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