KR101963153B1 - A DB access control system based on banned-word by using the parser, for enhancing security of personal information - Google Patents

A DB access control system based on banned-word by using the parser, for enhancing security of personal information Download PDF

Info

Publication number
KR101963153B1
KR101963153B1 KR1020170088520A KR20170088520A KR101963153B1 KR 101963153 B1 KR101963153 B1 KR 101963153B1 KR 1020170088520 A KR1020170088520 A KR 1020170088520A KR 20170088520 A KR20170088520 A KR 20170088520A KR 101963153 B1 KR101963153 B1 KR 101963153B1
Authority
KR
South Korea
Prior art keywords
query
column
name
server
parser
Prior art date
Application number
KR1020170088520A
Other languages
Korean (ko)
Other versions
KR20190007559A (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 KR1020170088520A priority Critical patent/KR101963153B1/en
Publication of KR20190007559A publication Critical patent/KR20190007559A/en
Application granted granted Critical
Publication of KR101963153B1 publication Critical patent/KR101963153B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • H04L63/101Access control lists [ACL]

Abstract

DB 접근 요청에 대하여, 파서를 이용하여 요청되는 쿼리를 분석하고, 분석된 쿼리의 의도를 정확하게 추출하여 해당 DB 접근 요청의 허용 여부를 결정하는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 관한 것으로서, 상기 사용자 단말로부터 전달되는 패킷으로부터 쿼리문을 추출하고, 상기 사용자 단말과 상기 DB서버 사이에서 입력되는 명령문 또는 서버의 결과를 중계하는 중계모듈; 및, 상기 중계모듈로부터 쿼리문을 수신하여 컬럼 이름을 추출하는 컬럼추출부; 컬럼 이름으로 구성된 인가리스트를 저장하고, 추출된 컬럼 이름이 상기 인가리스트에 존재하는지 여부에 따라 해당 쿼리문의 인가 여부를 판단하는 이상판단부를 포함하고, 상기 이상판단부가 해당 쿼리문의 인가 여부의 결정에 따라 상기 쿼리문의 전송 또는 차단의 명령을 상기 중계모듈로 전송하는 구성을 마련한다.
상기와 같은 DB서버 접근 통제 시스템에 의하여, DB의 데이터 요청을 쿼리 단위에서 분석함으로써 해당 데이터 요청의 의도를 정확하게 분석할 수 있고, 그 분석 결과를 기반으로 데이터를 통제함으로써 보안을 강화시킬 수 있다.
The present invention relates to a DB-based DB access control system using a parser for analyzing a query requested using a parser and accurately extracting the intent of the analyzed query, A relay module for extracting a query statement from a packet transmitted from the user terminal and relaying a result of a statement or a server input between the user terminal and the DB server; A column extracting unit for receiving a query message from the relay module and extracting a column name; And an abnormality determination unit for storing an authorization list composed of a column name and determining whether or not the extracted query is an inquiry query according to whether or not the extracted column name is present in the authorization list. And transmits an instruction to transmit or block the query query to the relay module.
According to the DB server access control system as described above, the intention of the data request can be accurately analyzed by analyzing the data request of the DB in a query unit, and security can be enhanced by controlling data based on the analysis result.

Description

개인정보 보안 강화를 위해 파서를 이용한 금칙어 기반 DB 접근통제 시스템 { A DB access control system based on banned-word by using the parser, for enhancing security of personal information }A DB access control system based on a parser using a parser for enhancing personal information security [

본 발명은 게이트웨이 방식의 DB(데이터베이스) 접근 통제 기술을 이용하여, 기관에서 관리하는 주요 DB의 보안을 강화하기 위한 것으로서, 기관의 주요 DB의 데이터에 원격 접근은 게이트웨이 방식의 DB 접근통제 시스템의 인증을 통하여 허용되는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 관한 것이다.The present invention is intended to enhance the security of the main DB managed by the institution using the DB (database) access control technology of the gateway system. The remote access to the data of the main DB of the institution is performed by the authentication Based DB access control system using a parser.

특히, 본 발명은 DB 접근 요청에 대하여, 파서를 이용하여 요청되는 쿼리를 분석하고, 분석된 쿼리의 의도를 정확하게 추출하여 해당 DB 접근 요청의 허용 여부를 결정하는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 관한 것이다.Particularly, the present invention analyzes a query requested by a parser for a DB access request, accurately extracts the intention of the analyzed query, and determines whether or not to allow the corresponding DB access request. ≪ / RTI >

일반적으로, DB 접근통제 시스템의 명령어 통제 기술은 접근통제 게이트웨이(Gateway) 서버를 경유하는 패킷을 분석하여 사용자가 입력한 명령어를 추출하고, 해당 사용자에게 적용된 보안에 위협이 될 수 있는 금지 명령어 리스트와 비교하여, 리스트에 있을 경우 해당 명령어를 서버에 전송하지 않고 파기한다. 이를 통해, 서버에 대한 보안을 강화하는 기술이다[특허문헌 1].In general, the command control technology of the DB access control system analyzes a packet passing through an access control gateway (gateway) server, extracts a command inputted by the user, and displays a list of prohibited commands which may be a threat to security applied to the user If it is in the list, the command is discarded without being transmitted to the server. Through this, security for the server is strengthened [Patent Document 1].

도 1에서 보는 바와 같이, 종래기술에 따르면, DB 접근통제 시스템은 사용자가 입력한 쿼리(DB 데이터 요청을 위한 쿼리)를 게이트웨이(Gateway)에서 누적한다. 그리고 사용자가 쿼리를 실행하면, DB 접근통제 시스템은 인가 여부를 판단하기 위하여, 사용자에게 적용된 금지 명령어 리스트와, 누적된 명령어 문자열을 비교한다. 그리고 입력한 명령어 문자열 중에서 일부가 금지 명령어 리스트에 포함되어 있을 경우, 해당 명령어(또는 문자열)를 차단한다. 즉, 사용자가 DB접근통제 시스템을 경유하여 DB서버에 원격 접속하여 쿼리를 입력하고 쿼리 실행를 실행할 때 그 인가 여부를 판단한다. 이를 위하여, 누적된 쿼리를 적용된 금지 문자열 정책과 비교를 통하여 금지 여부를 판단한다.As shown in FIG. 1, according to the related art, a DB access control system accumulates a query (a query for requesting DB data) input by a user in a gateway. When the user executes the query, the DB access control system compares the accumulated command string with the prohibited command list applied to the user to determine whether or not the DB access control system is authorized. If some of the entered command strings are included in the prohibited command list, the command (or string) is blocked. That is, the user connects remotely to the DB server via the DB access control system, inputs the query, and determines whether or not the query is executed. For this purpose, it is judged whether or not to prohibit through comparison with the prohibited string policy applied to the accumulated query.

또한, 사용자가 입력한 명령어에 대한 인가 여부에 대한 정확도를 높이기 위하여, 보안에 위협이 될 수 있는 금지 명령어를 정규표현식(Regular expression) 형태로 등록한다. 그래서 사용자가 입력한 명령어 문자가 일정 규칙으로 포함되는 경우를 탐지하여, 보다 정확한 탐지를 할 수 있도록 지원한다. 즉, DB서버로부터 클라이언트가 전달받는 값을 해석해서 위와 같이 문자열 비교 혹은 정규표현식 비교를 통해서 문자열 리스트에 포함되어 있을 경우 차단하는 방식을 취하고 있다.In addition, in order to increase the accuracy of whether or not the command inputted by the user is accurate, a prohibition command which may pose security is registered in the form of a regular expression. Thus, it is possible to detect a case where a command character inputted by a user is included in a predetermined rule, and to support more accurate detection. That is, the client receives the value from the DB server and interprets the value, and if it is included in the string list through string comparison or regular expression comparison, it is blocked.

하지만, 사용자가 DB서버에 사용하는 쿼리는 하나의 언어이며, 동일한 결과의 값을 얻기 위한 다양한 표현 방식이 존재할 수 있다. 따라서, DB를 요청하는 쿼리문의 특성에 따라 해당 언어(또는 쿼리문)를 근본적으로 분석하지 않고, 단순히 문자열 혹은 문자열에 대한 정규 표현식에 의한 금지 데이터를 탐지하고자 하는 것은 심각한 보안 이슈가 될 수 있다. 즉, 종래기술은 언어의 형식으로 표현된 쿼리에 대한 식별 및 인가 여부를 정확하게 처리할 수 없다. 그리고 종래기술의 문제점을 이용하면, 사용자가 우회할 수 있는 방법을 마련할 수 있다.However, the query used by the user in the DB server is one language, and there may be various ways of expressing the same result. Therefore, it is a serious security issue to simply detect prohibited data by regular expressions for a character string or a string, without fundamentally analyzing the language (or query statement) according to the characteristics of the query query requesting the DB. That is, the prior art can not accurately handle identification and authorization of a query expressed in the form of a language. And, using the problems of the prior art, a method by which the user can bypass can be provided.

따라서 기존의 방식을 벗어나, 데이터를 요청하는 쿼리를 구조적으로 분석하고, 특히, 해당 쿼리가 정확하게 어떤 데이터에 접근하려고 하는지를 파악하여, 해당 명령어 또는 쿼리의 인가 여부를 판단할 수 있는 기술이 필요하다.Therefore, there is a need for a technique capable of analyzing a query requesting data from a conventional method, particularly, determining which data the query is trying to access accurately, and determining whether the command or query is authorized.

한국등록특허 제10-1143847호(2012.05.10.공고)Korean Registered Patent No. 10-1143847 (Announcement of May 10, 2012)

본 발명의 목적은 상술한 바와 같은 문제점을 해결하기 위한 것으로, 게이트웨이 방식의 DB(데이터베이스) 접근 통제 기술을 이용하되, DB의 데이터 요청을 쿼리 단위에서 분석하여 통제하는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템을 제공하는 것이다.The object of the present invention is to solve the above-mentioned problems, and it is an object of the present invention to provide a DB-based DB access control technique using a gateway, Control system.

특히, 본 발명의 목적은 DB 접근 요청에 대하여, 파서를 이용하여 요청되는 데이터 요청의 쿼리를 분석하고, 분석된 쿼리가 접근하려는 테이블 및 컬럼(또는 필드)를 검출하여, 해당 데이터 요청의 허용 여부를 결정하는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템을 제공하는 것이다.In particular, it is an object of the present invention to analyze a query of a data request requested using a parser for a DB access request, to detect a table and a column (or a field) to be accessed by the analyzed query, Based DB access control system using a parser.

상기 목적을 달성하기 위해 본 발명은 사용자 단말과 DB서버가 네트워크로 연결되고, 상기 사용자 단말과 상기 DB서버 사이의 네트워크 상에 게이트웨이로 설치되는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 관한 것으로서, 상기 사용자 단말로부터 전달되는 패킷으로부터 쿼리문을 추출하고, 상기 사용자 단말과 상기 DB서버 사이에서 입력되는 명령문 또는 서버의 결과를 중계하는 중계모듈; 및, 상기 중계모듈로부터 쿼리문을 수신하여 컬럼 이름을 추출하는 컬럼추출부; 컬럼 이름으로 구성된 인가리스트를 저장하고, 추출된 컬럼 이름이 상기 인가리스트에 존재하는지 여부에 따라 해당 쿼리문의 인가 여부를 판단하는 이상판단부를 포함하고, 상기 이상판단부가 해당 쿼리문의 인가 여부의 결정에 따라 상기 쿼리문의 전송 또는 차단의 명령을 상기 중계모듈로 전송하는 것을 특징으로 한다.In order to achieve the above object, the present invention relates to a DB-based DB access control system using a parser and installed as a gateway on a network between a user terminal and a DB server and a network between the user terminal and the DB server, A relay module for extracting a query statement from a packet transmitted from the user terminal and relaying a result of a statement or a server input between the user terminal and the DB server; A column extracting unit for receiving a query message from the relay module and extracting a column name; And an abnormality determination unit for storing an authorization list composed of a column name and determining whether or not the extracted query is an inquiry query according to whether or not the extracted column name is present in the authorization list. And transmits a command to transmit or block the query query to the relay module.

또, 본 발명은 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서, 상기 컬럼 이름은 테이블 이름을 포함하는 절대 이름인 것을 특징으로 한다.Further, the present invention is characterized in that, in a DB-based DB access control system using a parser, the column name is an absolute name including a table name.

또, 본 발명은 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서, 상기 컬럼추출부는 상기 쿼리문에서 SELECT 절의 참조항목들을 컬럼 이름으로 수집하고, 참조항목에 테이블 이름이 없는 경우에는 FROM 절의 참조 테이블을 테이블 이름으로 설정하는 것을 특징으로 한다.In the DB access control system using a parser, the column extracting unit collects the reference items of the SELECT clause as column names in the query statement, and when there is no table name in the reference item, the reference table of the FROM clause And a table name.

또, 본 발명은 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서, 상기 컬럼추출부는 상기 쿼리문에서 SELECT 절의 참조항목들을 컬럼 이름을 수집하되, 컬럼 이름이 테이블 이름을 포함하고 상기 컬럼의 테이블 이름이 FROM 절의 참조 테이블의 별칭(alias)이면, 별칭의 원래 테이블 이름을 상기 컬럼의 테이블 이름으로 설정하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system and method for controlling access to a DB based DB using a parser, wherein the column extracting unit collects column names of reference items of a SELECT clause in the query statement, If the reference table in the FROM clause is an alias, the original table name of the alias is set as the table name of the column.

또, 본 발명은 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서, 상기 컬럼추출부는 쿼리문 파서를 이용하여, 쿼리문에서 토큰을 추출하고 토큰들의 트리 구조를 생성하게 하고, 트리 구조를 테이블과 컬럼 구조의 트리 구조의 트리로 치환한 후, 컬럼 이름을 추출하고, 상기 쿼리문 파서는 쿼리문을 단어 단위로 분리하여 토큰을 분리하는 어휘분석기와, 구문을 분석하여 각 토큰들의 구조적인 관계를 설정하는 구문분석기로 구성되고, 상기 어휘분석기는 쿼리문에서 토큰을 분리하여 목록화하고, 상기 구문분석기는 목록화된 토큰들을 트리 형태의 구조로 생성하고, 생성된 트리 형태의 구조를 테이블과 컬럼 구조의 트리로 치환하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a system and method for controlling a DB access control system using a parser, the method comprising: extracting a token from a query statement and generating a tree structure of tokens using a query statement parser; The query statement parser includes a lexical analyzer for separating the tokens by dividing the query statement into words, and a lexical analyzer for analyzing the syntax to determine a structural relationship between the tokens The parser separates the tokens into a list of tokens in a query statement, and the parser generates the list of the tokens in a tree structure. The structure of the tree structure is divided into a table and a column structure Of the tree.

또, 본 발명은 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서, 상기 이상판단부는 상기 인가리스트를 불가 목록으로 구비하고, 추출된 컬럼 이름 중에서 적어도 1개가 상기 불가 목록에 존재하면, 해당 쿼리문을 이상으로 판단하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided a DB-based DB access control system using a parser, wherein the abnormality determination unit includes the authorization list as an invisible list, and if at least one of the extracted column names exists in the invisible list, Or more.

또, 본 발명은 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서, 상기 DB서버가 다수의 데이터베이스를 구비한 경우 상기 테이블 이름은 데이터베이스 이름을 포함하는 것을 특징으로 한다.In addition, the present invention is characterized in that, in a DB control system based on a bimonthly language using a parser, when the DB server includes a plurality of databases, the table name includes a database name.

상술한 바와 같이, 본 발명에 따른 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 의하면, DB의 데이터 요청을 쿼리 단위에서 분석함으로써 해당 데이터 요청의 의도를 정확하게 분석할 수 있고, 그 분석 결과를 기반으로 데이터를 통제함으로써 보안을 강화시킬 수 있는 효과가 얻어진다.As described above, according to the bimonthly-based DB access control system using the parser according to the present invention, the intent of the data request can be accurately analyzed by analyzing the data request of the DB in a query unit, So that the security can be enhanced.

또한, 본 발명에 따른 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 의하면, DB의 데이터 요청을 위한 쿼리가 어떤 테이블의 어떤 컬럼(또는 필드)에 최종적으로 접근하고자 하는지를 분석함으로써, 해당 데이터의 요청을 보다 정확하게 분석할 수 있고, 이를 통해 보안을 보다 강화할 수 있는 효과가 얻어진다.In addition, according to the DB-based DB access control system using the parser according to the present invention, by analyzing which column of a table (or field) a query for requesting data of a DB ultimately accesses, So that the security can be further strengthened.

도 1은 종래기술에 따른 DB접근통제 시스템의 구동을 설명하는 도면.
도 2는 본 발명을 실시하기 위한 전체 시스템에 대한 구성도.
도 3은 본 발명의 일실시예에 따른 쿼리문의 예시도.
도 4는 본 발명의 일실시예에 따른 보안 강화를 위해 파서를 이용한 금칙어 기반 DB 접근통제 시스템의 구성에 대한 블록도.
도 5는 본 발명의 일실시예에 따른 쿼리문 파서의 구성에 대한 블록도.
도 6은 본 발명의 일실시예에 따른 쿼리문의 어휘 분석도.
도 7은 본 발명의 일실시예에 따른 쿼리문의 컬럼의 트리 구조도.
도 8은 본 발명의 일실시예에 따른 DB 접근통제 시스템의 쿼리 인가 방법을 설명하는 흐름도.
도 9는 본 발명의 일실시예에 따른 쿼리 파싱을 이용한 쿼리인가 과정을 설명하는 흐름도.
1 is a view for explaining the operation of a DB access control system according to the prior art;
2 is a block diagram of an overall system for implementing the present invention;
3 is an illustration of a query statement according to an embodiment of the present invention.
FIG. 4 is a block diagram of a configuration of a bicyclist-based DB access control system using a parser for enhancing security according to an embodiment of the present invention; FIG.
5 is a block diagram of a configuration of a query statement parser according to an embodiment of the present invention;
6 is a lexical analysis diagram of a query query according to an embodiment of the present invention.
7 is a tree structure diagram of a query statement column according to an embodiment of the present invention;
FIG. 8 is a flowchart illustrating a query authorization method of a DB access control system according to an embodiment of the present invention; FIG.
9 is a flowchart illustrating a query validation process using query parsing according to an embodiment of the present invention.

이하, 본 발명의 실시를 위한 구체적인 내용을 도면에 따라서 설명한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the drawings.

또한, 본 발명을 설명하는데 있어서 동일 부분은 동일 부호를 붙이고, 그 반복 설명은 생략한다.In the description of the present invention, the same parts are denoted by the same reference numerals, and repetitive description thereof will be omitted.

먼저, 본 발명을 실시하기 위한 전체 시스템의 구성의 예들에 대하여 도 2를 참조하여 설명한다.First, examples of the configuration of the entire system for implementing the present invention will be described with reference to FIG.

도 2에서 보는 바와 같이, 본 발명을 실시하기 위한 전체 시스템은 사용자 단말(10), DB서버(40), 및, 사용자 단말(10)과 DB서버(40) 사이에서 게이트웨이 역할을 하는 접근통제 시스템(30)으로 구성된다. 또한, 사용자 단말(10)과 DB서버(40)는 네트워크(미도시)를 통해 연결된다.2, the overall system for implementing the present invention includes a user terminal 10, a DB server 40, and an access control system (DB) 40 serving as a gateway between the user terminal 10 and the DB server 40 (30). Also, the user terminal 10 and the DB server 40 are connected through a network (not shown).

사용자 단말(10)은 사용자가 사용하는 컴퓨팅 단말로서, PC, 노트북, 스마트폰, 태플릿PC 등이다. 또한, 사용자 단말(10)은 데이터베이스(DB) 접속 프로토콜을 통해 DB서버(40)에 접속하고, DB서버(40)에 설치된 DB접속 프로토콜을 통해 작업을 수행한다.The user terminal 10 is a computing terminal used by a user, such as a PC, a notebook, a smart phone, or a tablet PC. Also, the user terminal 10 accesses the DB server 40 through a database (DB) connection protocol and performs an operation through a DB connection protocol installed in the DB server 40. [

이때, 사용자 단말(10)은 쿼리문을 포함하는 명령어를 DB서버(40)에 전송하고, 그 결과로서, DB서버(40)로부터 데이터(또는 데이터셋)를 수신한다. 이때, 쿼리문은 텍스트 형태 또는 문자열(string) 형태로 송수신된다.At this time, the user terminal 10 transmits a command including the query statement to the DB server 40, and as a result, receives data (or a data set) from the DB server 40. [ At this time, the query statement is transmitted or received in the form of a text or a string.

다음으로, DB서버(40)는 사용자 단말(10)로부터 네트워크(미도시)를 통해 DB명령문(쿼리문을 포함하는 명령문)을 수신하여, 해당 명령문의 명령(또는 쿼리문)을 수행하고 그 결과(또는 데이터셋)를 사용자 단말(10)에 전송한다.Next, the DB server 40 receives a DB statement (a statement including a query statement) through a network (not shown) from the user terminal 10, executes a command (or a query statement) of the corresponding statement, (Or a data set) to the user terminal 10.

구체적으로, DB서버(40)는 데이터를 관리하기 위한 통상의 DBMS(database management system)를 구비하고, 데이터의 저장, 삭제, 검색 등의 작업들을 쿼리(또는 쿼리문)를 통해 수행한다. 특히, DB서버(40)는 상용화된 데이터베이스를 구비하고, 데이터를 처리하기 위한 일반적인 쿼리 기능을 이용하여, 데이터 쿼리 서비스를 수행한다. 즉, 쿼리는 DB테이블과, 해당 DB테이블에 대한 참조항목(필드, 컬럼 등)들에 의해 정의되거나 설정된다.Specifically, the DB server 40 includes a normal DBMS (database management system) for managing data, and performs operations such as data storage, deletion, and search through queries (or query statements). In particular, the DB server 40 has a commercially available database and performs a data query service using a general query function for processing data. That is, a query is defined or set by a DB table and reference items (fields, columns, etc.) for the corresponding DB table.

다음으로, 접근통제 시스템(30)은 사용자 단말(10)과 DB서버(40) 사이의 네트워크(미도시) 상에 설치되는 게이트웨이로서, 사용자 단말(10)과 DB서버(40) 사이를 중계하거나 차단한다.Next, the access control system 30 is a gateway installed on a network (not shown) between the user terminal 10 and the DB server 40 to relay between the user terminal 10 and the DB server 40 .

즉, 접근통제 시스템(30)은 사용자 단말(10)로부터 수신되는 명령문을 수신하여 DB서버(40)에 전달하고, DB서버(40)로부터 결과를 수신하여 사용자 단말(10)로 전달한다. 이때, 명령문에는 데이터베이스의 데이터를 참조, 삭제, 갱신 등 작업을 수행하는 쿼리문을 포함한다.That is, the access control system 30 receives a command received from the user terminal 10, transfers the received command to the DB server 40, receives the result from the DB server 40, and transfers the received result to the user terminal 10. At this time, the statement includes a query statement for performing operations such as referencing, deleting, and updating data in the database.

이때, 접근통제 시스템(30)은 사용자 단말(10)로부터 수신되는 명령문 또는 쿼리문을 분석하여, 해당 명령문 내의 쿼리문의 차단 여부를 결정한다. 즉, 차단 여부의 결정에 따라, 해당 명령문 또는 쿼리문을 DB서버(40)에 전송하거나, 차단한다.At this time, the access control system 30 analyzes a statement or a query sent from the user terminal 10 to determine whether to block the query in the corresponding statement. In other words, the DB server 40 transmits or blocks the corresponding statement or query statement in accordance with the decision of blocking or not.

즉, 접근통제 시스템(30)은 쿼리의 실행 여부 판단 시 사용자가 입력한 쿼리에 대한 분석을 수행한다. 이를 위하여 접근통제 시스템(30)은 서버와의 정의된 통신 및 분석을 통한 쿼리 확인 작업을 통해, 최종 테이블의 어떤 컬럼에 접근을 하려고 하는지를 추출한다. 사용자가 의도한 최종 쿼리 분석 작업을 통해 악의적 사용자의 쿼리 변형을 통한 쿼리 우회 실행을 차단할 수 있다.That is, the access control system 30 analyzes the query inputted by the user when determining whether or not the query is executed. For this purpose, the access control system 30 extracts which column of the final table is to be accessed through a query check operation through communication and analysis defined with the server. The final query analysis task that the user intended can block the execution of query bypassing by malicious user's query transformation.

다음으로, 본 발명의 일실시예에 따라 분석 대상이 되는 쿼리문에 대하여 도 3을 참조하여 설명한다.Next, a query statement to be analyzed according to an embodiment of the present invention will be described with reference to FIG.

쿼리 또는 쿼리문은 데이터베이스에 저장된 데이터의 검색(참조), 갱신, 삭제 시 발생하는 질문 또는 요청을 기술하는 데이터 조작언어를 의미하며, 데이터베이스에서 쿼리는 일종의 명령어와 같은 역할을 수행한다. 관계 데이터베이스의 구조적 질의 언어(Structured Query Language : 이하 SQL)의 형식으로 표현되지만, 경우에 따라 SQL 이외의 형식으로 표현될 수도 있다.A query or query statement is a data manipulation language that describes a query or request that occurs when retrieving (referencing), updating, or deleting data stored in a database. In a database, a query acts as a kind of command. It is expressed in the form of structured query language (SQL) of the relational database, but may be expressed in a form other than SQL in some cases.

도 3에서 보는 바와 같이, SQL 쿼리(또는 쿼리문)은 SELECT 절, FROM 절, WHERE 절(조건 절), GROUP BY 절(그룹 절), ORDER BY 절(순서 절) 등으로 구성된다. SELECT 절(select list)은 참조(갱신, 삭제 등)하고자 하는 데이터 테이블의 필드/컬럼을 정의하는 절이다. SELECT 절(table reference)은 데이터를 가져올 테이블을 정의하는 절이다. 또한, SELECT 절(table reference)은 적어도 2개의 테이블을 조인하는 경우 테이블 간의 조인을 정의하기도 한다. 또한, 조건 절(where clause)은 조건을 정의하는 절이다. 그리고 그룹 절(group by) 이나 순서 절(order by clause)는 집계나 표시 형태를 정의하는 절이다.As shown in FIG. 3, the SQL query (or query statement) consists of a SELECT clause, a FROM clause, a WHERE clause (condition clause), a GROUP BY clause (group clause), and an ORDER BY clause (clause clause). A SELECT clause is a clause that defines the fields / columns of a data table that you want to reference (update, delete, etc.). A SELECT clause is a clause that defines the table from which data is to be retrieved. The SELECT clause also defines joins between tables when joining at least two tables. Also, a where clause is a clause that defines a condition. And a group by or order by clause is a clause that defines an aggregate or display form.

다음으로, 문자열로만 대비하여 쿼리를 분석하면 비슷한 결과를 가져오는 쿼리이나 다른 쿼리로 인지할 수 있는 경우는 다음과 같다.Next, if you analyze the query against string only, you might see a query or other query that yields similar results:

먼저, 공백 또는 줄바꿈에 의해 달라지는 경우이다.First, it depends on space or line breaks.

[1번 쿼리] SELECT * FROM EMPLOYEE;[Query # 1] SELECT * FROM EMPLOYEE;

[2번 쿼리] SELECT * FROM EMPLOYEE; [Query # 2] SELECT * FROM EMPLOYEE;

다음으로, 대문자와 소문자에 의해 달라지는 경우이다.Next, it depends on the uppercase and lowercase letters.

[1번 쿼리] SELECT * FROM EMPLOYEE; [Query # 1] SELECT * FROM EMPLOYEE;

[2번 쿼리] SELECT * FROM EMPLOYEE; [Query # 2] SELECT * FROM EMPLOYEE;

다음으로, 주석(Comment)에 의해 달라지는 경우이다.Next, it is changed by a comment.

[1번 쿼리] SELECT * FROM EMPLOYEE; [Query # 1] SELECT * FROM EMPLOYEE;

[2번 쿼리] SELECT /* 주석문 */ * FROM EMPLOYEE; [Query # 2] SELECT / * Comment * / * FROM EMPLOYEE;

다음으로, 테이블이 속하는 소유자(Owner 또는 데이터베이스 이름)를 명시하여 달라지는 경우이다.Next, it depends on specifying the owner (owner or database name) to which the table belongs.

[1번 쿼리] SELECT * FROM EMPLOYEE; [Query # 1] SELECT * FROM EMPLOYEE;

[2번 쿼리] SELECT * FROM HR.EMPLOYEE; [Query # 2] SELECT * FROM HR.EMPLOYEE;

다음으로, 옵티마이저 힌트사용에 의해 달라지는 경우이다.Next, it depends on the use of the optimizer hint.

[1번 쿼리] SELECT * FROM EMPLOYEE;[Query # 1] SELECT * FROM EMPLOYEE;

[2번 쿼리] SELECT /*+ INDEX(A JUMINBUNHO_PK) */ * FROM EMPLOYEE A;[Query # 2] SELECT / * + INDEX (A JUMINBUNHO_PK) * / * FROM EMPLOYEE A;

1번의 경우에는 대개의 경우 DB서버로부터 일정량의 데이터만 가지고 오지만 2번의 쿼리는 한꺼번에 전체 데이터를 다 가져와서 표현한다. 즉, “JUMINBUNHO_PK”라는 힌트가 의미하는 바는 “데이터를 처리할 때 JUMINBUNHO_PK라는 인덱스를 사용하기를 권장한다”라고 옵티마이져에게 힌트를 주는 것이다. 이때 힌트를 사용하는 부분이 금지명령어가 포함되어 있는 인덱스명이 존재 가능하며, 이런 경우 관련 쿼리에 대해서 오탐을 할 수 있는 여지가 있다.In the first case, usually only a certain amount of data is fetched from the DB server, but the two queries take all the data at once and express it. In other words, the hint "JUMINBUNHO_PK" means "I recommend using JUMINBUNHO_PK index when processing data," which is a hint to the optimizer. In this case, there can be an index name including a prohibited instruction in the part where the hint is used. In this case, there is a possibility that a related query may be falsified.

참고로, 옵티마이저는 SQL문에 따라 DB서버에서 데이터를 가져올 때, 내부적으로 데이터를 보다 효과적으로(빠르게) 처리하기 위한 기능을 수행한다. 예를 들어, 다음과 같이 2개의 DB테이블을 참조하여 데이터를 가져오는 경우를 설명한다.For reference, the optimizer performs functions to process data more efficiently (faster) internally when fetching data from the DB server according to the SQL statement. For example, the case where data is fetched by referring to two DB tables will be described as follows.

[쿼리문 예제][Query statement example]

SELECT B.DNAME, A.EMPBUNHO, A.ENAME, A.SELSELECT B.DNAME, A.EMPBUNHO, A.ENAME, A.SEL

FROM EMPLOYEE A, DEPARTMENT BFROM EMPLOYEEE, DEPARTMENT B

WHERE A.DEPTNO = B.DEPTNOWHERE A.DEPTNO = B.DEPTNO

위의 예에서, DBMS는 자료를 가지고 와서 처리하는 방식으로서, (1) 부서 테이블의 데이터를 메모리에 올린 후 사원 데이터에 접근하거나, (2) 부서 테이블의 데이터를 메모리에 올린 후 사원의 인덱스(사원번호)에 접근한 후 사원 테이블에 접근하거나, (3) 사원 테이블의 데이터를 메모리에 올린 후 부서 테이블에 접근하거나, (4) 사원 테이블의 데이터를 메모리에 올린 후 부서의 인덱스(부서번호)에 접근한 후 부서 테이블에 접근할 수 있다.In the above example, the DBMS comes with data to process (1) access the employee data after putting the data of the department table into memory, (2) put the data of the department table into memory, (3) access to the department table after putting the data of the employee table in the memory, (4) uploading the data of the employee table to the memory, and thereafter the index (department number) of the department, And then access the department table.

이와 같이, DBMS에서 자료를 가지고 와서 처리하는 방식과 접근하는 방식까지 경우의 수로 처리를 하면 아주 다양한 경우에 수가 존재를 하며, DBMS의 옵티마이져가 위의 여러 가지 케이스 중에 하나의 케이스를 선택해서 처리한다. 실제로 SQL을 만들어서 사용할 때는 더 많은 개수의 테이블을 연결하는데, DBMS의 옵티마이져는 그 많은 경우 수 중에 가장 빠른 방식을 선택한다. 이때, 사용자가 힌트(또는 옵티마이저 힌트)를 통해서 어떤 테이블에 먼저 접근을 할 것이지 그리고 어떤 방식으로 테이블에 접근할 것인지를 DBMS에 권장할 수가 있다.In this way, if the number of cases is up to the number of cases, the DBMS optimizer can select one of the above cases and process it do. In fact, when you create and use SQL, you connect a larger number of tables, and the DBMS optimizer chooses the fastest method in many cases. At this time, the user can recommend to the DBMS how to access the table first through the hint (or optimizer hint) and how to access the table.

다음으로, 조건절 비교값에 의해 달라지는 경우이다.Next, it depends on the conditional comparison value.

SELECT * FROM EMPLOYEE WHERE LOGIN_ID = 'tommy'; SELECT * FROM EMPLOYEE WHERE LOGIN_ID = 'tommy';

SELECT * FROM EMPLOYEE WHERE LOGIN_ID = 'karajan'; SELECT * FROM EMPLOYEE WHERE LOGIN_ID = 'karajan';

SELECT * FROM EMPLOYEE WHERE LOGIN_ID = 'javaking'; SELECT * FROM EMPLOYEE WHERE LOGIN_ID = 'javaking';

다음으로, 문자열로만 대비하여 쿼리를 분석하면 탐지가 불가능하여 보안에 심각한 문제가 되는 구체적인 경우를 보다 구체적으로 설명한다.Next, we explain concrete cases in which a query is analyzed against a string only and detection becomes impossible, which is a serious security problem.

먼저, 서로 다른 테이블이나 동일한 컬럼명을 갖는 경우이다. 즉, 사용자가 DB에 접근하여 쿼리 입력할 때, 쿼리 내에 컬럼명에 대한 패턴만을 사용하는 경우이다. 이 경우, 다른 테이블의 다른 데이터임에도 컬럼명이 동일하기 때문에, 정확한 판단을 할 수 없다.First, they have different tables or the same column names. In other words, when a user accesses a DB and enters a query, it uses only the pattern for the column name in the query. In this case, since the column names are the same even though they are different data in other tables, accurate judgment can not be made.

예를 들어, 다음 2개의 쿼리는 모두 "LoginID"의 컬럼(컬럼명)을 참조하나, 각각 "Customer"와 "Employee" 의 서로 다른 테이블을 참조한다.For example, the following two queries all reference the column (column name) of "LoginID", but they refer to different tables for "Customer" and "Employee", respectively.

[1번 쿼리] select LoginID from Customer[Query # 1] select LoginID from Customer

[2번 쿼리] select LoginID from Employee[Query # 2] select LoginID from Employee

다음으로, 다른 테이블 동일한 컬럼명으로 시작하는 컬럼에 대해 통제가 불가능하다. 즉, 사용자가 DB에 접근하여 쿼리 입력 시, 컬럼명에 대한 패턴만 사용할 경우이다. 이 경우, 단지 시작되는 문자열이 동일할 경우에는, 판단이 불가능하다.Next, you can not control columns that start with the same column name in another table. That is, when the user accesses the DB and inputs a query, it uses only the pattern for the column name. In this case, judging is impossible if only the starting string is the same.

즉, 대개의 경우 테이블과 컬럼의 이름을 정할 때 유추하기 쉬운 범주를 만들어 이를 확장시켜 각 이름을 정한다. 그래서 "사용자"와 관련된 컬럼의 이름을 “사용자번호”, “사용자명”, “사용자생성일” 등과 같이 설정할 수 있다. 이 경우, "시작되는 문자열"이 모두 “사용자”이기 때문에 “사용자”로 시작되는 문자열을 가지고 금지 문자열을 만들어 사용할 수 없다.In other words, when you name tables and columns in most cases, you create categories that are easy to guess, and expand them to name each one. Thus, the names of columns related to "user" can be set as "user number", "user name", "user creation date", and the like. In this case, you can not create a forbidden string with a string that starts with "user" because all "starting strings" are "users".

다음으로, “*” 등 특수문자 또는 와일드 문자를 사용하는 경우이다. 특히, “*”를 사용하여 전체 데이터에 접근하려는 경우이다. 이 경우, 컬럼 부분에 “*” 실행 시 해당 테이블 전체에 대한 접근할 수 있다. 그러나 종래기술에 의하면, 이를 통제할 수 있는 방안이 없다.Next, use special characters such as "*" or a wild character. In particular, you might want to use "*" to access the entire data. In this case, you can access the entire table when you execute "*" on the column part. However, according to the prior art, there is no way to control this.

예를 들어, 다음과 같은 쿼리는 Customer 테이블의 모든 컬럼(또는 필드)을 참조하는 쿼리이다. 따라서 테이블 Customer 내에서 금지된 컬럼(컬럼명)이 있더라도, 문자열 패턴 매칭에 의해 해당 컬럼 참조 행위를 검출할 수 없다.For example, the following query is a query that references all the columns (or fields) in the Customer table. Therefore, even if a column (column name) is prohibited in the table Customer, the corresponding column reference behavior can not be detected by string pattern matching.

[1번 쿼리] select * from Customer[Query # 1] select * from Customer

마지막으로, 쿼리 내에 별칭(alias)을 이용하여 데이터를 접근하려는 경우이다. 이 경우에도, 컬럼명이 아닌 별칭을 통한 접근하기 때문에, 이를 통제할 수 있는 방안이 없다.Finally, you want to access data using aliases in queries. In this case, too, there is no way to control it because it is accessed through an alias, not a column name.

예를들어, “주민번호”만 금지문자열로 통제하는 경우를 설명한다. 이때, "주민번호생성일", "주민번호폐기일" 등과 같은 컬럼이 존재할 수 있으므로, 이러한 파생 컬럼을 제외하고 "주민번호"만 통제하기 위하여 “주민번호 ”혹은 “주민번호, ”과 같이 금지 문자열로 설정할 수 있다.For example, the case where only "resident registration number" is controlled by a prohibited string is explained. At this time, there may exist columns such as "date of creation of resident registration number" and "date of revocation of resident registration number". Therefore, it is prohibited to use "resident registration number" or "resident registration number" It can be set to a string.

그러나 이러한 경우, 다음과 같이 쿼리를 만들어 이를 회피할 수 있다.In this case, however, you can avoid this by creating a query like this:

[예시 쿼리][Example Query]

SELECT “해킹” FROM (SELECT 주민번호||사용자 AS “해킹” FROM 사용자)SELECT "hack" FROM (SELECT resident number || user AS "hack" FROM user)

상기와 같이, "주민번호"의 문자열 뒤에 문자를 붙이고 함수 등과 연동하여, 앞선 금지문자열 통제를 우회할 수 있다.As described above, it is possible to attach a character after the string of "resident number " and to bypass the preceding prohibited string control in conjunction with the function or the like.

상기한 대표적인 4가지 경우는 모두 보안에 매우 심각한 취약점이다. 즉, 패턴방식의 문자열 필터링을 하는 게이트웨이(Gateway) 방식의 DB 접근통제 시스템은 상기와 같은 보안 문제를 가진다. 따라서 악의적인 사용자는 이러한 보안 취약점을 공격할 수 있으므로, 패턴 방식의 문자열 필터링 방식은 보안 사고의 위험을 내재하는 문제점이 있다.All four of the above cases are very serious security vulnerabilities. That is, a gateway-based DB access control system that performs pattern-based string filtering has the above-described security problem. Therefore, since a malicious user can attack such a security vulnerability, a pattern-based string filtering method poses a risk of security incidents.

다음으로, 본 발명의 일실시예에 따른 보안 강화를 위해 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 대하여 도 4를 참조하여 설명한다.Next, a bicyclist-based DB access control system using a parser for enhancing security according to an embodiment of the present invention will be described with reference to FIG.

본 발명에 대한 실시 방법은 사용자 단말(10), DB접근통제 시스템(30)과 관리대상 DB서버(40)와의 데이터 통신이 이루어지는 통신 환경에서 이루어진다. 실시 예에서는 사용자가 DB접근통제 시스템(30)을 경유하여 권한이 부여된 관리대상 DB서버에 원격 접속하여 작업을 수행하는 환경을 실시 예로서 설명한다.The embodiment of the present invention is performed in a communication environment in which data communication is performed between the user terminal 10, the DB access control system 30, and the management DB server 40. [ In an embodiment, an environment in which a user performs remote access to an authorized management DB server via a DB access control system 30 and performs an operation will be described as an embodiment.

사용자는 DB서버에 작업을 위하여, 쿼리를 입력하면, DB접근통제 시스템(30)은 전달받은 쿼리를 DB서버(40)에 전송하고, 서버의 응답을 다시 사용자에게 전달한다. 이때 접근통제 시스템은 쿼리를 실행 시, 내부 메모리에 누적한다. DB접근통제 시스템은 해당 쿼리 입력을 DB서버에 전송을 보류하고, 메모리에 누적된 쿼리를 분석하여 할당된 권한 정책에 의거 실행 가능한지 판단하고 DB서버에 전송 여부를 판단한다.When a user enters a query for a DB server operation, the DB access control system 30 transmits the received query to the DB server 40 and transmits the response of the server to the user again. At this time, the access control system accumulates in the internal memory when the query is executed. The DB access control system suspends transmission of the query input to the DB server, analyzes the accumulated query in the memory, determines whether it is executable according to the assigned rights policy, and determines whether or not the query is transmitted to the DB server.

즉, 본 발명에 따른 DB접근통제 시스템(30)은, 사용자 단말(10)이 게이트웨이(Gateway)를 경유하여 DB서버(40)에 접속하고 작업을 위한 쿼리 실행 이벤트를 발생할 때, DB서버(40)에 쿼리 실행 이벤트를 전송하는 것을 보류하고, 게이트웨이 모듈에서 서버와의 통신을 통해 사용자가 의도한 최종 테이블의 컬럼 등을 추출한다. DB접근통제 시스템(30)은 추출된 테이블의 컬럼을 기반으로, 사용자가 실행을 요청한 데이터에 대한 인가 여부를 정확하게 판단할 수 있다.That is, when the user terminal 10 accesses the DB server 40 via a gateway and generates a query execution event for a job, the DB access control system 30 according to the present invention is configured such that the DB server 40 ), And the gateway module extracts the column of the final table that the user intends through communication with the server. The DB access control system 30 can accurately determine whether the data requested by the user is authorized based on the extracted table column.

한편, DB접근통제 시스템(30)은 모든 DBMS(Data Base Management System)에서 표준화된 쿼리 방식의 원격접속 프로토콜을 이용하여 원격으로 접속하는 경우에 모두 적용할 수 있다. 즉, DB접근통제 시스템(30)은 DB서버(40)에 원격 접근 시 입력한 쿼리에 대하여 정확한 데이터 통제를 수행할 수 있다.On the other hand, the DB access control system 30 can be applied to all DBMSs (Data Base Management System) when remote access is made using a standardized query-based remote access protocol. That is, the DB access control system 30 can perform accurate data control on the query inputted when remotely accessing the DB server 40.

또한, 본 발명은 사용자가 입력한 쿼리의 확인을 위하여, DB접근통제 시스템(30)이 실제 접속된 DB서버(40)에 쿼리를 전송하는 것을 보류하고, 입력한 쿼리가 어떤 테이블의 어떤 컬럼 값을 의미하는지를 분석한다. 또한, DB접근통제 시스템(30)은 이러한 분석을 통해, DB서버(40)에서 사용하는 모든 테이블명과 해당 테이블의 컬럼명, 그리고 DB의 전체 테이블명과 해당 테이블의 컬럼 그리고 테이블과 컬럼의 별칭을 수집한다.In order to confirm the query inputted by the user, the DB access control system 30 suspends transmission of the query to the DB server 40 to which the DB server 40 is actually connected, . In addition, the DB access control system 30 collects all the table names used in the DB server 40, the column names of the corresponding tables, the entire table names of the DB, the columns of the corresponding tables, and the aliases of the tables and columns do.

도 4에서 보는 바와 같이, 본 발명에 따른 서버 접근 통제 시스템(30)은 입력응답 전송부(31), 중계모듈(33), 장비응답 전송부(34), 컬럼추출부(35), 이상판단부(36)로 구성된다. 또한, 추가적으로, 쿼리문 파서(37)와, 인가리스트DB(38)를 더 포함하여 구성될 수 있다.4, the server access control system 30 according to the present invention includes an input response transmitting unit 31, a relaying module 33, an equipment response transmitting unit 34, a column extracting unit 35, (36). In addition, it may further comprise a query statement parser 37 and an authorization list DB 38.

사용자 또는 사용자 단말(10)은 서버접근 통제시스템(30)을 경유하여 특정 DB서버(40)에 접근하고 작업을 수행하는 상황을 가정한다.It is assumed that the user or the user terminal 10 accesses the specific DB server 40 via the server access control system 30 and performs a task.

먼저, 입력응답 전송부(31)는 사용자 또는 사용자 단말(10)로부터 입력을 수신하여 중계모듈(33)로 전달하거나 중계모듈(33)로부터 수신한 응답을 사용자 또는 사용자 단말(10)로 전송한다.The input response transmitting unit 31 receives the input from the user or the user terminal 10 and transfers the received input to the relay module 33 or the response received from the relay module 33 to the user or the user terminal 10 .

중계모듈(33)은 입력응답 전송부(31)와 장비전송부(34) 사이를 연결하여, 패킷 또는 데이터를 중계하는 모듈이다. 중계모듈(33)은 패킷으로부터 쿼리문을 추출하는 쿼리문 추출부(33a)와, 패킷 또는 데이터를 중계하는 패킷중계부(33b)로 구성된다.The relay module 33 is a module for relaying packets or data by connecting the input response transmitter 31 and the equipment transmitter 34. The relay module 33 includes a query extracting unit 33a for extracting a query statement from the packet and a packet relay unit 33b for relaying the packet or data.

특히, 쿼리문 추출부(33a)는 사용자 단말(10)로부터 수신한 패킷을 분석하여 쿼리문을 추출한다. 사용자 단말(10)은 원격으로 DB서버(40)에 접속하기 위해 TCP/IP 프로토콜의 세션을 형성한다. 사용자는 TCP/IP 프로토콜의 세션 상에서, 데이터베이스(DB) 접속 프로토콜을 통해 DB서버(40)에 접속한다. 하나의 세션 동안에 사용자는 적어도 하나의 쿼리문을 입력하여 자신이 원하는 작업을 수행한다.In particular, the query statement extracting unit 33a analyzes the packet received from the user terminal 10 and extracts the query statement. The user terminal 10 forms a TCP / IP protocol session to access the DB server 40 remotely. The user accesses the DB server 40 through a database (DB) connection protocol on a session of the TCP / IP protocol. During one session, the user enters at least one query statement to perform the desired task.

만약 쿼리문 추출부(33a)가 패킷으로부터 쿼리문을 추출하면, 쿼리문에 대한 정보를 컬럼추출부(35)로 전송한다. 그리고 이상판단부(36)로부터 이상이 탐지되지 않는 경우, 패킷을 패킷중계부(33b)를 통해 중계하도록 한다.If the query statement extractor 33a extracts the query statement from the packet, it transmits the information about the query statement to the column extractor 35. [ If no abnormality is detected by the abnormality determination unit 36, the packet is relayed through the packet relay unit 33b.

패킷중계부(33b)는 입력응답 전송부(31)와 장비전송부(34) 사이에서, 패킷 또는 데이터를 중계한다. 이때, 이상판단부(36)의 결과에 따라 입력응답 전송부(31)에서 전송되는 쿼리문(또는 명령문)을 장비응답 전송부(34)를 통해 DB서버(40)로 전송하거나 차단한다.The packet relaying unit 33b relays the packet or data between the input response transmitting unit 31 and the equipment transmitting unit 34. [ At this time, according to the result of the abnormality determination unit 36, the query sentence (or statement) transmitted from the input response transmission unit 31 is transmitted to the DB server 40 through the equipment response transmission unit 34 or blocked.

다음으로, 컬럼추출부(35)는 추출된 쿼리문에서 접근하려는 컬럼 정보(또는 데이터베이스, 테이블 정보)를 추출한다.Next, the column extracting unit 35 extracts column information (or database, table information) to be accessed in the extracted query statement.

이때, 컬럼 정보는 컬럼(또는 컬럼명, 컬럼 이름) 및, 컬럼에 속하는 테이블(또는 테이블명, 테이블 이름)을 포함한다. 바람직하게는, 테이블 정보(또는 테이블 이름)는 데이터베이스 이름을 포함할 수 있다. 즉, 다수의 데이터베이스를 이용하는 경우, 테이블 이름은 데이터베이스 이름과 테이블 이름으로 구성될 수 있다. 이를 테이블의 절대이름이라 부르기로 한다. 즉, 테이블의 절대이름은 데이터베이스 이름과 테이블 이름으로 구성되고, <데이터베이스 이름>.<테이블 이름>으로 표현될 수 있다.At this time, the column information includes a column (or a column name, a column name) and a table (or a table name, a table name) belonging to a column. Preferably, the table information (or table name) may include a database name. That is, when using a plurality of databases, the table name can be composed of a database name and a table name. We call this the absolute name of the table. That is, the absolute name of the table consists of the database name and the table name, and can be expressed as <database name>. <Table name>.

또한, 컬럼(또는 컬럼명)의 절대 이름은 테이블 명과 컬럼 명을 합친 이름을 나타낸 것으로 한다. 예를 들어, 컬럼의 절대 이름은 <테이블 이름>.<컬럼 이름>으로 표현될 수 있다.In addition, the absolute name of a column (or a column name) indicates a name combined with a table name and a column name. For example, the absolute name of a column can be expressed as <table name>. <Column name>.

한편, 컬럼추출부(35)는 쿼리문 파서(37)를 이용하여 쿼리문을 파싱하고, 파싱한 결과로부터 테이블 이름, 특히, 테이블의 절대 이름을 추출한다.On the other hand, the column extracting unit 35 parses the query statement using the query statement parser 37 and extracts the table name, in particular the absolute name of the table, from the parsing result.

쿼리문 파서(37)는 추출된 쿼리문, 또는 SQL 쿼리의 구문을 분석하여, 컬럼 리스트(select list), 테이블 참조(table reference), 조인 절(join clause), 조건 절(where clause), 그룹 절(group by clause), 순서 절(order by clause) 등을 집합 형태로 추출하는 것이다.The query statement parser 37 analyzes the extracted query statement or the syntax of the SQL query to determine whether the query includes a select list, a table reference, a join clause, a where clause, Group by clause, order by clause, and so on.

또한, SELECT 절의 참조항목에서 컬럼명을 추출한다. 또한, 조인 절, 조건 절, 그룹 절, 순서 절 등에서 참조하는 컬럼명들을 모두 추출한다. 특히, 참조항목이 계산식인 경우에 계산식 내에 포함된 컬럼명을 추출한다. 또한, 조건 절 등 다른 절에서 참조하는 조건이나 수식 등에서 사용되는 컬럼명들도 추출한다.Also, extract the column name from the reference item in the SELECT clause. Also, all the column names referenced in the join clause, condition clause, group clause, order clause, and the like are extracted. In particular, when the reference item is a calculation formula, the column name included in the calculation formula is extracted. It also extracts the column names used in conditions or expressions referenced in other clauses, such as condition clauses.

특히, 컬럼명은 절대이름, 또는, 컬럼명과 소속된 테이블명으로 추출한다. 절대이름이란 참조 데이터베이스의 이름, 참조 테이블의 이름, 컬럼명으로 구성된 이름을 말한다. 따라서 컬럼의 절대이름은 다음과 같이 표현될 수 있다.In particular, the column name is extracted with the absolute name or the column name and the table name to which it belongs. An absolute name is a name consisting of the name of the reference database, the name of the reference table, and the name of the column. Thus, the absolute name of a column can be expressed as:

컬럼의 절대이름 = <데이터베이스의 이름>.<테이블의 이름>.<컬럼명>Absolute name of column = <name of database>. <Name of table>. <Column name>

또는 데이터베이스를 굳이 식별하지 않으면 다음과 같이 표현될 수도 있다.Or, if you do not really know the database, you might say:

컬럼의 절대이름 = <테이블의 이름>.<컬럼명>Absolute name of column = <name of table>. <Column name>

절대이름과 대비하여, 컬럼명을 컬럼의 상대이름이라고도 부르기로 한다.In contrast to the absolute name, the column name is also called the relative name of the column.

이때, 쿼리문 파서(37)는 테이블의 이름을 FROM 절 등을 통해 추출한다.At this time, the query statement parser 37 extracts the name of the table through a FROM clause or the like.

즉, 컬럼추출부(35)는 상기 쿼리문에서 SELECT 절의 참조항목들을 컬럼 이름으로 수집하고, 참조항목에 테이블 이름이 없는 경우에는 FROM 절의 참조 테이블을 테이블 이름으로 설정한다.That is, the column extracting unit 35 collects the reference items of the SELECT clause in the query statement as a column name, and sets the reference table of the FROM clause as the table name if the reference item does not have a table name.

예를 들어, 다음과 같은 쿼리를 가정한다.For example, assume the following query:

[쿼리 1] select Login_ID from Customer[Query 1] select Login_ID from Customer

[쿼리 2] select t1.Login_ID from Customer t1[Query 2] select t1.Login_ID from Customer t1

위의 경우 모두 컬럼명 "Login_ID"는 Cutomer 테이블에 속하는 컬럼을 나타낸다. 즉, 쿼리 1은 참조하는 테이블이 Customer 만 있기 때문에, SELECT 절의 Login_ID가 테이블 Customer의 필드(또는 컬럼)를 참조하는 것임을 알 수 있다. 즉, 컬럼명 "Login_ID"의 절대이름은 "Cutomer.Login_ID"이다.In all of the above cases, the column name "Login_ID" indicates a column belonging to the cutomer table. That is, since Query 1 has only the table to which the reference is made, it can be seen that the Login_ID of the SELECT clause refers to the field (or column) of the table Customer. That is, the absolute name of the column name "Login_ID" is "Cutomer.Login_ID".

또한, 쿼리 2에서는, 테이블 Customer가 t1으로 별칭(alias)되고 있다. 따라서 SELECT 절의 t1.Login_ID의 절대이름은 "t1"을 "Cutomer"로 치환한 이름으로서, "Cutomer.Login_ID"이다.Also, in the query 2, the table Customer is aliased to t1. Therefore, the absolute name of t1.Login_ID in the SELECT clause is "Cutomer.Login_ID", which is the name that replaced "t1" with "Cutomer".

바람직하게는, 테이블 절에서 테이블명의 앨리어스(alias)를 제거하고, 테이블명의 앨리어스(alias)로 명명된 구문을 모두 원래의 테이블명으로 변경한다. 예를 들어, 앞서의 예에서, Cutomer가 t1으로 앨리어스(alias)되어 명명되어 있다면 원테이블명(Cutomer)으로 변경한다.Preferably, the alias of the table name is removed from the table section, and all the aliases of the table name are changed to the original table name. For example, in the previous example, if the cutomer is aliased to t1, change it to the original table name (Cutomer).

또한, 바람직하게는, 다수의 데이터베이스를 이용하는 경우, 테이블 참조절에서의 각 테이블명에 대한 테이블의 절대이름을 구한다. 테이블의 절대이름은 데이터베이스 이름과 테이블 이름으로 구성되고, <데이터베이스 이름>.<테이블 이름>으로 표현된다.Preferably, when a plurality of databases are used, an absolute name of a table for each table name in the table true adjustment is obtained. The absolute name of the table consists of the database name and the table name, and is expressed as <database name>. <Table name>.

도 5에서 보는 바와 같이, 쿼리문 파서(37)는 쿼리문을 단어 단위로 분리하여 토큰을 분리하는 어휘분석기(37a)와, 구문을 분석하여 각 토큰들의 구조적인 관계를 설정하는 구문분석기(37b)로 구성된다.5, the query statement parser 37 includes a lexical analyzer 37a for separating the query statements into words and separating the tokens, a parser 37b for analyzing the syntax and setting the structural relationship between the tokens ).

먼저, 어휘분석기(37a)는 쿼리문, 즉, SQL 텍스트를 읽어, 토큰을 분리하여(또는 추출하여) 목록화한다. 이때, 토큰은 문장 자체로부터 문장을 이루고 있는 단어 단위로 분할한 것을 말하다.First, the lexical analyzer 37a reads out the query statement, that is, the SQL text, and separates (or extracts) the token. In this case, the token is a word segmented from the sentence itself.

어휘분석기(37a)는 도 6과 같은 방식으로 토큰을 만든다. 도 6은 쿼리가 만들어질 수 있는 기본 단위(토큰)에 대하여 정의된 것을 나타낸다. 즉, 토큰을 분리하기 위한 구조로서, 도 6a는 "select" 의 토큰 구조(또는 구문구조)를 나타낸 것이고, 도 6b는 "subquery"의 토큰 구조를 나타낸 것이고, 도 6c는 "query_block"의 토큰 구조를 나타낸 것이다.The lexical analyzer 37a generates the token in the same manner as in Fig. Figure 6 shows what is defined for a base unit (token) that a query can be made. 6A shows a token structure (or syntax structure) of "select ", FIG. 6B shows a token structure of" subquery ", FIG. 6C shows a structure of a token structure of "query_block" .

다음으로, 구문분석기(37b)는 앞서 목록화한 토큰들을 입력받아, 토큰들을 트리 형태의 데이터로 생성한다. Next, the parser 37b receives the tokens listed above, and generates tokens as data in a tree form.

이때, 구문분석기(37b)는 토큰들을 입력받으면, 트리 형태로 생성하기 전에, 토큰(또는 토큰 목록)에서 문법적 에러가 있는지를 확인한다. 즉, 토큰들이 사전에 정해진 패턴에 맞지 않으면 문법적으로 에러가 난다고 처리가 된다At this time, when the tokens are inputted, the parser 37b checks whether there is a grammatical error in the token (or the token list) before generating the tree form. That is, if the tokens do not match the predetermined pattern, they are treated as having an error in the grammar

SQL구문의 유형에 따른 SELECT, INSERT, UPDATE, DELETE, CREATE 유형으로 나누고 앞에서 받은 전달받은 트리 형태의 데이터를 정식 구분 트리로 변환한다. 구체적으로, SQL구문의 유형을 기준으로 분리를 하고, 하향식 파싱을 통해서 트리 구조로 만든다. 그리고 해당 트리를 단순한 테이블과 컬럼 구조의 트리로 치환한다.It is divided into SELECT, INSERT, UPDATE, DELETE, and CREATE types according to the type of SQL statement and converts the received data of the received tree type into a formal classification tree. Specifically, it segregates based on the type of SQL statement and makes it into a tree structure through top-down parsing. Then replace the tree with a simple table and column tree structure.

다음으로, 이상판단부(36)는 추출된 컬럼 이름을 인가리스트와 대비하여, 해당 리스트에 존재하는지 여부에 따라 해당 쿼리문의 전송 여부를 판단한다. 바람직하게는, 인가리스트의 허용되지 않은 목록(불가 목록)에 컬럼 이름이 존재하면, 해당 쿼리문의 전송을 차단한다.Next, the abnormality determination unit 36 compares the extracted column name with the authorization list, and determines whether or not the query query is transmitted according to whether or not the extracted column name exists in the corresponding list. Preferably, if a column name exists in an unallowed list (invalid list) of the authorization list, transmission of the query is blocked.

인가리스트는 허용하는 컬럼들의 이름을 기록한 허용 목록(또는 화이트 리스트) 또는, 불가하는 컬럼들의 이름을 기록한 불가 목록(또는 블랙리스트)로 구성된다.The authorization list consists of a whitelist (or whitelist) that lists the names of the allowed columns or an invisible list (or blacklist) that lists the names of the inaccessible columns.

인가리스트가 불가 목록인 경우, 이상판단부(36)는 추출된 컬럼 이름들 중 어느 하나라도 상기 인가 리스트의 불가 목록에 존재하면, 해당 쿼리문의 전송을 이상으로 판단하여 차단한다. 반대로, 인가리스트가 허용 목록인 경우, 추출된 컬럼 이름들 모두가 허용 목록에 존재하는 경우에만, 해당 쿼리문을 정상으로 판단하여 전송하고 그 외에는 이상으로 판단하여 차단한다. 바람직하게는, 인가리스트는 불가 목록으로 구성한다.If the authorization list is an unavailable list, the abnormality determination unit 36 determines that transmission of the query query is abnormal and blocks the transmission if any of the extracted column names is present in the unavailable list of the authorization list. On the contrary, when the authorization list is a permissible list, only when all the extracted column names are present in the permissible list, the query is determined to be normal and transmitted. Otherwise, the query is judged to be abnormal and blocked. Preferably, the authorization list is constructed as an unavailable list.

또한, 인가리스트는 컬럼 이름으로 구성하되, 컬럼 이름은 컬럼의 절대 이름으로 기록된다. 또는 컬럼 이름과 함께 소속되는 테이블 이름이 함께 기록된다. 그리고 컬럼이름과 해당 테이블 이름이 모두 같은 경우에 해당 컬럼 이름이 해당 인가리스트에 존재하는 것으로 판단한다.In addition, the authorization list consists of column names, where the column name is written as the absolute name of the column. Or the name of the table to which the column name belongs together. If the column name and the corresponding table name are the same, it is determined that the column name exists in the authorization list.

또한, 다수의 데이터베이스를 갖는 경우, 인가리스트에 데이터베이스 이름도 포함된다. 그리고 이 경우, 컬럼 이름, 테이블 이름, 데이터베이스 이름이 모두 같아야 해당 리스트에 존재한다고 판단한다.Also, in the case of having a plurality of databases, the database name is also included in the authorization list. In this case, it is determined that the column name, the table name, and the database name are all the same in the corresponding list.

이상판단부(36)는 해당 쿼리문의 이상 여부를 판단하여 해당 쿼리문 또는 명령문의 전송 또는 차단을 중계모듈(33)에 전송한다. 중계모듈(33)은 이상판단부(36)의 전송 또는 차단 여부에 따라 해당 쿼리문 또는 명령문을 전송 또는 차단한다.The abnormality determination unit 36 determines whether the query is abnormal or not, and transmits the query statement or the statement to the relay module 33. The relay module 33 transmits or blocks the corresponding query statement or the statement according to whether the abnormality determination unit 36 transmits or blocks the request.

다음으로, 본 발명의 일실시예에 따른 DB 접근통제 시스템(30)에 의하여 DB의 접근통제를 하는 방법을 도 8 및 도 9을 참조하여 설명한다.Next, a method of access control of the DB by the DB access control system 30 according to an embodiment of the present invention will be described with reference to FIGS. 8 and 9. FIG.

도 8에서 보는 바와 같이, DB 접근통제 시스템(30) 또는 중계모듈(33)은 사용자 단말(10)과 관리대상 DB서버(40)와의 사이에서 통신 데이터를 중계하는 환경에서 작업을 수행한다. 실시 예에서는 사용자 또는 사용자 단말(10)이 DB 접근통제 시스템(30)을 경유하여 권한이 부여된 관리대상 DB서버(40)에 DB접속 프로토콜을 이용하여 원격 접속하여 작업을 수행하는 환경을 실시 예로서 설명한다. As shown in FIG. 8, the DB access control system 30 or the relay module 33 performs an operation in an environment for relaying communication data between the user terminal 10 and the management DB server 40. In an embodiment, an environment in which a user or a user terminal 10 remotely accesses an authorized management DB server 40 via a DB access control system 30 by using a DB connection protocol, .

사용자 또는 사용자 단말(10)은 DB서버(40)에 작업을 위하여, 명령문을 입력한다. 이때, 중계모듈(33)은 전달받은 명령문을 DB서버(40)에 전송하고, DB서버(40)의 응답을 다시 사용자 단말(10)에게 전달한다. 이때 쿼리문 추출부(33a)는 명령문에서 쿼리문을 추출한다.The user or user terminal 10 inputs a statement to the DB server 40 for work. At this time, the relay module 33 transmits the received command to the DB server 40, and transmits the response of the DB server 40 to the user terminal 10 again. At this time, the query statement extractor 33a extracts the query statement from the statement.

사용자의 쿼리 실행 시 DB접근통제 시스템(30)은 문자열 비교로 인가 여부를 판단하는 것이 아니라 해당 쿼리를 분석해서 최종 테이블에 어떤 컬럼의 데이터에 접근하려고 하는지를 추출한다. 예를 들어 아래의 쿼리에서 A 테이블에 BUNHO는 주민번호이고 B 테이블의 BUNHO는 단순한 번호를 가정한다. 이때, 기존의 문자열 비교 방식을 통해서는 A 테이블의 BUNHO에 해당하는 주민번호만을 통제하는 것이 불가능하다.When the user executes a query, the DB access control system 30 analyzes the query and extracts what column data is to be accessed in the final table, rather than determining whether the comparison is based on string comparison. For example, in the following query, BUNHO is a resident number in table A, and BUNHO in table B assumes a simple number. At this time, it is impossible to control only the resident number corresponding to the BUNHO of the A table through the existing string comparison method.

[쿼리문][Query statement]

“SELECT A.NAME, A.BUNHO, B.BUNHO FROM JUMIN A, HIST B WHERE A.KEY = B.KEY ” "SELECT A.NAME, A.BUNHO, B.BUNHO FROM JUMINA, HIST B WHERE A.KEY = B.KEY"

도 8에서 보는 바와 같이, DB접근통제 시스템(30)은 사용자 단말(10)로부터 패킷 또는 명령문을 수신한다(S10).As shown in FIG. 8, the DB access control system 30 receives a packet or a command from the user terminal 10 (S10).

다음으로, DB접근통제 시스템(30)은 패킷 또는 명령문으로부터 쿼리를 추출한다(S20). 이때, 시스템(30)은 DB접속 프로토콜을 분석하여 패킷 또는 명령문에서 쿼리문을 추출한다.Next, the DB access control system 30 extracts the query from the packet or the statement (S20). At this time, the system 30 analyzes the DB connection protocol and extracts a query statement from a packet or a statement.

다음으로, 파서(또는 쿼리 파서)를 이용하여 쿼리문을 분석하여(S30), 컬럼의 절대이름을 추출한다(S40). 컬럼명의 절대이름은 최종적으로 접근하고자 하는 테이블과 해당 테이블의 컬럼 이름을 의미한다. 또한, 다수의 데이터베이스(owner)가 있는 경우에는 데이터베이스 이름도 포함한다.Next, the query statement is analyzed using a parser (or a query parser) (S30), and an absolute name of the column is extracted (S40). The absolute name of the column name implies the table and column name of the table to be finally accessed. It also includes the database name if there are multiple databases (owners).

다음으로, 해당 쿼리문이 위협적인 쿼리인지(또는 이상 여부)를 판단한다(S50). 즉, 추출된 컬럼의 절대이름이 인가 리스트에 존재하는지 여부를 판단하여 해당 쿼리문의 위협 여부 또는 이상 여부를 판단한다.Next, it is determined whether the query is a threat query (or abnormal) (S50). That is, whether or not the absolute name of the extracted column exists in the authorization list is judged, and it is judged whether there is a threat or abnormality in the query query.

구체적으로, 해당 쿼리문의 컬럼명이 인가리스트 또는 불가 목록에 존재하면, 해당 쿼리문을 위협적인 쿼리로 판단한다. 이때, 컬럼명은 절대 이름을 사용한다. 또는 컬럼명과, 컬럼이 속하는 테이블명이 동일한지 여부를 비교한다.Specifically, if the column name of the query statement exists in the authorization list or the invalid list, the query is judged to be a threat query. At this time, the column name uses the absolute name. Or whether or not the column name and the table name to which the column belongs are the same.

다음으로, 위협적인 쿼리문으로 판단되면, 쿼리문을 취소 요청하여(S60), 해당 쿼리문의 중계를 차단한다(S80). 즉, 해당 쿼리문이 DB서버(40)로 전송되는 것을 차단한다. 또한, 위협적인 쿼리로 판단되지 않으면, 해당 쿼리문을 그대로 전송할 것으로 요청하여(S70), 해당 쿼리문을 중계한다(S80).Next, if it is determined that the query is a threat, the query is canceled (S60), and the relay of the query is interrupted (S80). That is, the query is prevented from being transmitted to the DB server 40. If it is determined that the query is not a threat query, it is requested that the corresponding query statement be transmitted (S70), and the corresponding query statement is relayed (S80).

도 9은 사용자가 실행을 원하는 데이터를 추출하기 위한 도식이며, 해당 파서를 통하여 최종 테이블에 어떤 컬럼의 데이터에 접근를 추출할 수 있다.FIG. 9 is a diagram for extracting data that a user desires to execute. The parser can extract access to data of a certain column in the final table.

사용자에게 쿼리 실행 시 현재까지 메모리에 누적된 쿼리를 확인하다. DB 접근통제 시스템의 파서는 쿼리를 분석하여 최종 테이블에 어떤 컬럼의 데이터를 서버에 전송하여 확인한다.When the query is executed, the user confirms the accumulated query in the memory so far. The parser of the DB access control system analyzes the query and confirms by sending the data of a certain column to the server in the final table.

분석된 데이터를 바탕으로 사용자가 접근 가능한 테이블의 컬럼 여부를 판단하여 수행되는 쿼리에서의 맨 마지막 표현 데이터와 달리 실제 접근하는 최종 테이블에 어떤 컬럼의 데이터를 파악하여 통제할 수 있다.Based on the analyzed data, it is possible to determine and control the data of a certain column in the final table accessed in real time, unlike the last expression data in the query performed by determining whether or not the column is accessible to the user.

즉, 도 9와 같이, 금지되거나 허용될 테이블명, 컬럼명, 별칭명 등을 수집한다. 그리고 사용자의 쿼리문을 분석하여, 분석된 쿼리와 수집된 테이블명(또는 컬럼명, 별칭명)을 비교한다. 즉, 사용자의 쿼리문의 테이블명, 컬럼명, 별칭명 등이 수집된 목록(또는 금지 리스트, 허용 리스트 등)에 있는지 여부를 판단하고, 그 결과에 따라 해당 쿼리문의 실행 또는 차단 여부를 결정한다.That is, as shown in FIG. 9, the table name, the column name, the alias name, etc. to be prohibited or allowed are collected. Then, the user's query statement is analyzed, and the analyzed query is compared with the collected table name (or column name, alias name). That is, it is determined whether or not the table name, column name, alias name, etc. of the query query of the user is in a collected list (or a forbidden list, an allowable list, etc.).

이상, 본 발명자에 의해서 이루어진 발명을 상기 실시 예에 따라 구체적으로 설명하였지만, 본 발명은 상기 실시 예에 한정되는 것은 아니고, 그 요지를 이탈하지 않는 범위에서 여러 가지로 변경 가능한 것은 물론이다.Although the present invention has been described in detail with reference to the above embodiments, it is needless to say that the present invention is not limited to the above-described embodiments, and various modifications may be made without departing from the spirit of the present invention.

10 : 사용자 단말 30 : DB접근통제 시스템
31 : 입력응답 전송부 33 : 중계모듈
33a: 쿼리문 추출부 33b : 패킷중계부
34 : 장비응답 전송부 35 : 컬럼추출부
36 : 이상판단부 37 : 쿼리문 파서
38 : 인가리스트DB 40 : DB서버
10: User terminal 30: DB access control system
31: input response transmission unit 33: relay module
33a: Query statement extracting unit 33b: Packet relaying unit
34: Equipment response transmitting unit 35: Column extracting unit
36: abnormal judgment part 37: query statement parser
38: authorization list DB 40: DB server

Claims (7)

사용자 단말과 DB서버가 네트워크로 연결되고, 상기 사용자 단말과 상기 DB서버 사이의 네트워크 상에 게이트웨이로 설치되는, 파서를 이용한 금칙어 기반 DB 접근통제 시스템에 있어서,
상기 사용자 단말로부터 전달되는 패킷으로부터 쿼리문을 추출하고, 상기 사용자 단말과 상기 DB서버 사이에서 입력되는 명령문 또는 서버의 결과를 중계하는 중계모듈; 및,
상기 중계모듈로부터 쿼리문을 수신하여 컬럼 이름을 추출하는 컬럼추출부;
컬럼 이름으로 구성된 인가리스트를 저장하고, 추출된 컬럼 이름이 상기 인가리스트에 존재하는지 여부에 따라 해당 쿼리문의 인가 여부를 판단하는 이상판단부를 포함하고,
상기 이상판단부가 해당 쿼리문의 인가 여부의 결정에 따라 상기 쿼리문의 전송 또는 차단의 명령을 상기 중계모듈로 전송하고,
상기 컬럼 이름은 테이블 이름을 포함하는 절대 이름이고,
상기 컬럼추출부는 상기 쿼리문에서 SELECT 절의 참조항목들을 컬럼 이름으로 수집하고, 참조항목에 테이블 이름이 없는 경우에는 FROM 절의 참조 테이블을 테이블 이름으로 설정하는 것을 특징으로 하는 파서를 이용한 금칙어 기반 DB 접근통제 시스템.
A DB-based DB access control system using a parser, wherein a user terminal and a DB server are connected via a network and installed as a gateway on a network between the user terminal and the DB server,
A relay module for extracting a query statement from a packet transmitted from the user terminal and relaying a result of a statement or a server input between the user terminal and the DB server; And
A column extractor for receiving a query message from the relay module and extracting a column name;
And an abnormality determination unit for storing an authorization list composed of column names and determining whether or not the query query is based on whether the extracted column name is present in the authorization list,
Transmits to the relay module an instruction to transmit or block the query according to the determination whether the query is an inquiry query,
The column name is an absolute name including the table name,
Wherein the column extractor collects the reference items of the SELECT clause as column names in the query statement and sets the reference table of the FROM clause as the table name when the reference item does not have a table name. system.
삭제delete 삭제delete 제1항에 있어서,
상기 컬럼추출부는 상기 쿼리문에서 SELECT 절의 참조항목들을 컬럼 이름을 수집하되, 컬럼 이름이 테이블 이름을 포함하고 상기 컬럼의 테이블 이름이 FROM 절의 참조 테이블의 별칭(alias)이면, 별칭의 원래 테이블 이름을 상기 컬럼의 테이블 이름으로 설정하는 것을 특징으로 하는 파서를 이용한 금칙어 기반 DB 접근통제 시스템.
The method according to claim 1,
If the column name includes a table name and the table name of the column is an alias of a reference table in the FROM clause, the column extractor collects the original table name of the alias, And the table name of the column is set as the table name of the column.
제1항에 있어서,
상기 컬럼추출부는 쿼리문 파서를 이용하여, 쿼리문에서 토큰을 추출하고 토큰들의 트리 구조를 생성하게 하고, 트리 구조를 테이블과 컬럼 구조의 트리 구조의 트리로 치환한 후, 컬럼 이름을 추출하고,
상기 쿼리문 파서는 쿼리문을 단어 단위로 분리하여 토큰을 분리하는 어휘분석기와, 구문을 분석하여 각 토큰들의 구조적인 관계를 설정하는 구문분석기로 구성되고, 상기 어휘분석기는 쿼리문에서 토큰을 분리하여 목록화하고, 상기 구문분석기는 목록화된 토큰들을 트리 형태의 구조로 생성하고, 생성된 트리 형태의 구조를 테이블과 컬럼 구조의 트리로 치환하는 것을 특징으로 하는 파서를 이용한 금칙어 기반 DB 접근통제 시스템.
The method according to claim 1,
The column extracting unit extracts a token from a query statement, generates a tree structure of tokens, replaces the tree structure with a tree of a tree structure of a table and a column structure, extracts a column name,
Wherein the query statement parser comprises a lexical analyzer for separating the query statements into words and separating the tokens, and a parser for analyzing the syntax and setting a structural relationship between the tokens, wherein the lexical analyzer separates the token from the query statement Wherein the parser generates the cataloged tokens in a tree structure and replaces the generated tree structure with a tree of a table and a column structure. system.
제1항에 있어서,
상기 이상판단부는 상기 인가리스트를 불가 목록으로 구비하고, 추출된 컬럼 이름 중에서 적어도 1개가 상기 불가 목록에 존재하면, 해당 쿼리문을 이상으로 판단하는 것을 특징으로 하는 파서를 이용한 금칙어 기반 DB 접근통제 시스템.
The method according to claim 1,
Wherein the abnormality determination unit includes the authorization list as an invisible list and determines that the query statement is abnormal if at least one of the extracted column names exists in the unavailable list. .
제1항에 있어서,
상기 DB서버가 다수의 데이터베이스를 구비한 경우 상기 테이블 이름은 데이터베이스 이름을 포함하는 것을 특징으로 하는 파서를 이용한 금칙어 기반 DB 접근통제 시스템.
The method according to claim 1,
And if the DB server has a plurality of databases, the table name includes a database name.
KR1020170088520A 2017-07-12 2017-07-12 A DB access control system based on banned-word by using the parser, for enhancing security of personal information KR101963153B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020170088520A KR101963153B1 (en) 2017-07-12 2017-07-12 A DB access control system based on banned-word by using the parser, for enhancing security of personal information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020170088520A KR101963153B1 (en) 2017-07-12 2017-07-12 A DB access control system based on banned-word by using the parser, for enhancing security of personal information

Publications (2)

Publication Number Publication Date
KR20190007559A KR20190007559A (en) 2019-01-23
KR101963153B1 true KR101963153B1 (en) 2019-03-29

Family

ID=65280172

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170088520A KR101963153B1 (en) 2017-07-12 2017-07-12 A DB access control system based on banned-word by using the parser, for enhancing security of personal information

Country Status (1)

Country Link
KR (1) KR101963153B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102221018B1 (en) 2019-12-02 2021-02-26 주식회사 신시웨이 Relay system and method for deling with fault of secure session for DB connection
KR20210068832A (en) 2019-12-02 2021-06-10 주식회사 신시웨이 Access control system and method using SQL tool based on web

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110188262B (en) * 2019-07-23 2019-10-29 武汉斗鱼网络科技有限公司 A kind of abnormal object determines method, apparatus, equipment and medium
CN110427775B (en) * 2019-07-25 2021-07-27 北京明略软件系统有限公司 Data query authority control method and device
KR102405977B1 (en) * 2020-08-11 2022-06-03 이청종 System and method for preventing network hacking

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101134091B1 (en) * 2011-01-12 2012-04-13 주식회사 피앤피시큐어 Database secure system preventing the access to the database by detour
KR101414580B1 (en) 2013-01-24 2014-07-16 한남대학교 산학협력단 A Secured Linux Operationg System Using Multi-level Security

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101143847B1 (en) 2005-04-14 2012-05-10 (주) 모두스원 Network security apparatus and method thereof
KR20120068612A (en) * 2010-12-17 2012-06-27 한국전자통신연구원 Dns query traffic monitoring and processing method and apparatus
KR20170048765A (en) * 2015-10-27 2017-05-10 삼성에스디에스 주식회사 Method and apparatus for providing compliance information using prohibited words

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101134091B1 (en) * 2011-01-12 2012-04-13 주식회사 피앤피시큐어 Database secure system preventing the access to the database by detour
KR101414580B1 (en) 2013-01-24 2014-07-16 한남대학교 산학협력단 A Secured Linux Operationg System Using Multi-level Security

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102221018B1 (en) 2019-12-02 2021-02-26 주식회사 신시웨이 Relay system and method for deling with fault of secure session for DB connection
KR20210068832A (en) 2019-12-02 2021-06-10 주식회사 신시웨이 Access control system and method using SQL tool based on web

Also Published As

Publication number Publication date
KR20190007559A (en) 2019-01-23

Similar Documents

Publication Publication Date Title
KR101963153B1 (en) A DB access control system based on banned-word by using the parser, for enhancing security of personal information
US8010522B2 (en) System, method and program product for detecting SQL queries injected into data fields of requests made to applications
US20060212438A1 (en) SQL injection protection by variable normalization
US8930403B2 (en) Fine-grained relational database access-control policy enforcement using reverse queries
KR101422859B1 (en) Permission-based document server
US9626452B2 (en) Fine-grained database access-control policy enforcement using reverse queries
US8051484B2 (en) Method and security system for indentifying and blocking web attacks by enforcing read-only parameters
US9886481B2 (en) Query optimization on VPD protected columns
CN107657174B (en) Database intrusion detection method based on protocol fingerprint
CN103338208A (en) Method and system for SQL injection and defense
CN107832618B (en) SQL injection detection system and method based on fine-grained authority control
CN101551836B (en) Code audit method and device
JP2019503021A (en) System environment and user behavior analysis based self-defense security device and its operation method
RU2659482C1 (en) Protection of web applications with intelligent network screen with automatic application modeling
KR101104300B1 (en) System of access management comprising exclusive tool for accessing of personal information database and method thereof
KR101244945B1 (en) Webshell detecting apparatus using meta pattern
KR20050121778A (en) Method and system for audit and control database system
KR101134091B1 (en) Database secure system preventing the access to the database by detour
JP5009105B2 (en) Information processing apparatus, input information control method, and program
KR100921712B1 (en) Method and system for protecting harmful web site
KR101285729B1 (en) System and method for securing databse
Asha et al. Preventing sql injection attacks
KR101005090B1 (en) Fire wall system and method for web application program based on static analysis
Mishra et al. A REVIEW ON SQL INJECTION, DETECTION AND PREVENTIONS TECHNIQUES
US20230144928A1 (en) Method for providing a client computer device with access to a database management system

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