KR102276885B1 - Apparatus and method for diagnosing docker image vulnerability - Google Patents

Apparatus and method for diagnosing docker image vulnerability Download PDF

Info

Publication number
KR102276885B1
KR102276885B1 KR1020190152085A KR20190152085A KR102276885B1 KR 102276885 B1 KR102276885 B1 KR 102276885B1 KR 1020190152085 A KR1020190152085 A KR 1020190152085A KR 20190152085 A KR20190152085 A KR 20190152085A KR 102276885 B1 KR102276885 B1 KR 102276885B1
Authority
KR
South Korea
Prior art keywords
vulnerability
image
docker
score
docker image
Prior art date
Application number
KR1020190152085A
Other languages
Korean (ko)
Other versions
KR20210063677A (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 KR1020190152085A priority Critical patent/KR102276885B1/en
Publication of KR20210063677A publication Critical patent/KR20210063677A/en
Application granted granted Critical
Publication of KR102276885B1 publication Critical patent/KR102276885B1/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/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • G06F21/577Assessing vulnerabilities and evaluating computer system security
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명은 도커 시스템 기반 클라이언트와 원격 저장소에서의 도커 이미지 취약성을 진단하는 장치에 관한 것으로, 취약점 탐지 모듈과 취약성 진단 모듈을 포함한다. 원격 저장소와 클라이언트는 도커 이미지에 업로드/다운로드시 도커 이미지 취약점 탐지 모듈을 통하여 도커 이미지에 존재하는 패키지의 취약점을 탐지하여 출력하며, 이를 취약성 진단 모듈로 전달한다. 이미지 취약점 탐지 결과를 전달받은 취약성 진단 모듈은 이미지 취약점 탐지 결과로부터 심각도를 파싱 및 카운팅하며, 정의된 심각도별 점수에 따라 이미지 취약점 점수를 계산한다. 계산된 이미지 취약점 점수와 이미지 취약점 임계 점수와 비교하여 초과일 경우, 이미지에 대해 업로드/다운로드를 불가하게 함으로써 클라이언트와 원격 저장소 사이의 안전한 도커 시스템을 수립한다.The present invention relates to an apparatus for diagnosing Docker image vulnerabilities in a Docker system-based client and remote storage, and includes a vulnerability detection module and a vulnerability diagnosis module. When uploading/downloading a Docker image to/from the remote repository and the client, the vulnerability of the package existing in the Docker image is detected and output through the Docker image vulnerability detection module, and this is delivered to the vulnerability diagnosis module. The vulnerability diagnosis module receiving the image vulnerability detection result parses and counts the severity from the image vulnerability detection result, and calculates the image vulnerability score according to the defined score for each severity. If it exceeds the calculated image vulnerability score and image vulnerability threshold score, it establishes a secure Docker system between the client and remote storage by disallowing upload/download of images.

Description

도커 이미지 취약성 진단 장치 및 방법{APPARATUS AND METHOD FOR DIAGNOSING DOCKER IMAGE VULNERABILITY}DOCKER IMAGE VULNERABILITY DIAGNOSTIC APPARATUS AND METHOD FOR DIAGNOSING DOCKER IMAGE VULNERABILITY

도커 시스템을 위한 보안 진단 장치에 관한 것으로, 보다 상세하게는 도커 이미지에 대한 취약점 검사를 통해 취약성을 진단하는 장치 및 방법에 대한 발명이 개시된다.The present invention relates to a security diagnosis apparatus for a Docker system, and more particularly, to an apparatus and method for diagnosing vulnerabilities through a vulnerability inspection on a Docker image.

도커(Docker)는 가장 널리 사용되는 컨테이너 기반 기술 중 하나로써, 이미지 형식으로 애플리케이션(예, Apach, MySQL)을 배포한다. 각 도커 이미지에는 대상 응용 프로그램 소프트웨어, 지원 라이브러리 및 구성 파일이 포함되어 있으며, 도커 컨테이너는 등가 런타임 환경과 여러 응용 프로그램 인스턴스를 패키징하고 배포하는 쉬운 방법을 제공하여 널리 사용되고 있다.Docker is one of the most widely used container-based technologies to deploy applications (eg, Apache, MySQL) in the form of images. Each Docker image contains the target application software, support libraries, and configuration files, and Docker containers are popular because they provide an equivalent runtime environment and an easy way to package and deploy multiple application instances.

도커 이미지의 생성 및 공유를 중심으로 하는 커뮤니티가 등장하고 있으며, 2014년 소개된 도커 허브(Docker Hub)가 응용 프로그램 이미지를 공유하기 위한 대표적인 클라우드 레지스트리 서버이다. 이미지는 저장소(Repository)를 사용하여 배포되므로 버전이 지정된 이미지 개발 및 유지 관리가 가능하다. 또한, 저장소는 다른 저장소에서 분기가 가능하다. A community centered on the creation and sharing of Docker images is emerging, and Docker Hub, introduced in 2014, is a representative cloud registry server for sharing application images. Since images are distributed using a repository, versioned image development and maintenance is possible. Repositories can also branch from other repositories.

대표적인 도커 저장소인 도커 허브에서는 옵션으로 이미지 서명/검증을 수행하고 있으나 악의적인 사용자에 의한 악의적인 이미지 배포는 방지하지 못한다. 사용자가 악의적인 도커 이미지를 로컬 도커 이미지 저장소에 다운로드 받아 컨테이너로 구동할 시, 개인 정보 누출 등의 사고가 유발될 수 있다.Although the Docker Hub, which is a representative Docker repository, optionally performs image signing/verification, it cannot prevent malicious image distribution by malicious users. When a user downloads a malicious Docker image to the local Docker image repository and runs it as a container, accidents such as personal information leakage may be caused.

도커 이미지가 쉽게 배포되며 다운로드 가능하다는 특징을 활용하는 도커 이미지의 취약점들이 계속해서 알려지고 있다. 최근에는 도커 이미지를 이용해 암호 화폐 채굴 프로그램을 배포하는 사례가 확인되었다. 이 공격의 경우, 공격 대상의 OS에 상관없이 도커를 사용 중이면 모두 공격이 가능함을 보여주었다. 이러한 문제는 사용자가 다운로드 받은 이미지에 대한 별도의 보안성 검증을 하지 않는 점에서 비롯되므로, 도커 이미지의 취약성 진단에 대한 필요성이 대두되고 있다.Vulnerabilities in Docker images that take advantage of the easy distribution and downloadability of Docker images continue to be known. Recently, a case of distributing cryptocurrency mining programs using Docker images has been confirmed. In the case of this attack, it has been shown that any attack is possible if Docker is being used, regardless of the OS of the target. Since this problem originates from the point that the user does not separately verify the security of the downloaded image, the need for diagnosing the vulnerability of the Docker image is emerging.

본 발명은 클라이언트가 저장소를 통해 다운로드 받은 도커 이미지에 대하여 취약성을 진단하는 방법을 제공하는 것을 목적으로 한다.An object of the present invention is to provide a method for diagnosing vulnerabilities in a Docker image downloaded through a storage by a client.

본 발명의 일 양상에 따르는 도커 이미지 취약성 진단 장치는 취약점 탐지 모듈과, 취약성 진단 모듈을 포함한다. A Docker image vulnerability diagnosis apparatus according to an aspect of the present invention includes a vulnerability detection module and a vulnerability diagnosis module.

취약점 탐지 모듈은 설정된 주기로 CVE(Common Vulnerabilities and Exposures) 취약점 데이터베이스들로부터 취약점 메타데이터를 수집하여 저장하고, 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하고, 취약성 진단 모듈은 취약점 탐지 데이터를 파싱하여 심각도 정보를 획득하고 심각도 정보를 이용하여 도커 이미지의 취약점 점수를 계산한다.Vulnerability detection module collects and stores vulnerability metadata from CVE (Common Vulnerabilities and Exposures) vulnerability databases at set intervals, and uses the image metadata collected from Docker images to analyze vulnerabilities and stored vulnerability metadata to generate vulnerability detection data. generated and output, the vulnerability diagnosis module parses the vulnerability detection data to obtain severity information, and calculates the vulnerability score of the Docker image using the severity information.

본 발명의 또 다른 양상에 따르면, 취약점 탐지 모듈은 사용자로부터 입력된 취약점 화이트리스트에 포함된 취약점은 승인된 취약점으로 분류하여 취약점 탐지 데이터를 생성하여 출력할 수 있다. 이때, 취약성 진단 모듈은 승인된 취약점은 제외하고 도커 이미지의 취약점 점수를 계산할 수 있다.According to another aspect of the present invention, the vulnerability detection module may classify vulnerabilities included in the vulnerability whitelist input by the user as approved vulnerabilities, generate and output vulnerability detection data. In this case, the vulnerability diagnosis module may calculate the vulnerability score of the Docker image excluding the approved vulnerabilities.

또한, 도커 이미지가 원격 저장소(repository)로부터 다운로드한 이미지인 경우, 다양한 양상의 도커 이미지 취약성 진단 장치의 취약성 진단 모듈은 계산된 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 저장 또는 폐기를 결정할 수 있다.In addition, if the Docker image is an image downloaded from a remote repository, the vulnerability diagnosis module of the various aspects of the Docker image vulnerability diagnosis device compares the calculated vulnerability score with the vulnerability threshold score to determine storage or disposal of the Docker image. have.

또한, 도커 이미지가 사용자에 의해 빌드되어 로드된 이미지인 경우, 다양한 양상의 도커 이미지 취약성 진단 장치의 취약성 진단 모듈은 계산된 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 원격 저장소로의 업로드 또는 폐기를 결정할 수 있다.In addition, when the Docker image is an image built and loaded by the user, the vulnerability diagnosis module of the various aspects of the Docker image vulnerability diagnosis device compares the calculated vulnerability score with the vulnerability threshold score to upload or discard the Docker image to a remote storage. can be decided

본 발명의 일 실시 예에 따르면, 도커 이미지 취약성 진단 장치에서 실행되는 프로그램 명령어로 적어도 일부가 구현되는 도커 이미지 취약성 진단 방법은 설정된 주기로 CVE 취약점 데이터베이스들로부터 취약점 메타데이터를 수집하여 저장하는 단계와, 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하는 단계와, 취약점 탐지 데이터를 파싱하여 심각도 정보를 획득하는 단계와, 심각도 정보를 이용하여 도커 이미지의 취약점 점수를 계산하는 단계를 포함한다.According to an embodiment of the present invention, a Docker image vulnerability diagnosis method at least partially implemented as a program command executed in a Docker image vulnerability diagnosis apparatus includes the steps of: collecting and storing vulnerability metadata from CVE vulnerability databases at a set cycle; The steps of generating and outputting vulnerability detection data using the image metadata collected from the Docker image to be analyzed and the stored vulnerability metadata, parsing the vulnerability detection data to obtain severity information, and using the severity information in Docker and calculating a vulnerability score of the image.

또 다른 실시 예에 따르면, 취약점 탐지 데이터를 생성하여 출력하는 단계에서 생성되어 출력되는 취약점 탐지 데이터는 사용자로부터 입력된 취약점 화이트리스트에 포함된 취약점은 승인된 취약점으로 분류되어 생성되고, 취약점 점수를 계산하는 단계는 승인된 취약점은 제외하고 도커 이미지의 취약점 점수를 계산할 수 있다.According to another embodiment, in the vulnerability detection data generated and output in the step of generating and outputting the vulnerability detection data, the vulnerabilities included in the vulnerability whitelist input by the user are classified as approved vulnerabilities, and the vulnerability score is calculated. The step can calculate the vulnerability score of the Docker image excluding the approved vulnerabilities.

또 다른 실시 예에 따르면, 도커 이미지 취약성 진단 방법은 계산된 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 저장 또는 폐기를 결정하는 단계를 더 포함할 수 있고, 이때 도커 이미지는 원격 저장소(repository)로부터 다운로드한 이미지이거나, 사용자에 의해 빌드되어 로드된 이미지일 수 있다.According to another embodiment, the Docker image vulnerability diagnosis method may further include determining storage or disposal of the Docker image by comparing the calculated vulnerability score with a vulnerability threshold score, wherein the Docker image is stored in a remote repository. It may be an image downloaded from , or an image built and loaded by the user.

본 발명에 의하면 도커 이미지 취약성 진단을 기반으로 하여 악위적인 도커 이미지를 관리함으로써 클라이언트와 저장소간에 이미지 업로드/다운로드에 있어 신뢰할 수 있는 환경을 구축할 수 있는 효과를 달성할 수 있다.According to the present invention, it is possible to achieve the effect of establishing a reliable environment for image upload/download between the client and the storage by managing the malicious Docker image based on the Docker image vulnerability diagnosis.

도 1은 도커 시스템에서 도커 이미지가 업로드/다운로드 및 수정되는 과정을 개념적으로 도시한 것이다.
도 2은 일 양상에 따른 도커 이미지 취약성 진단 장치의 구성을 도시한 블록도이다.
도 3는 도커 이미지 취약성 진단 장치를 이용하여 클라이언트가 저장소에 이미지를 업로드하는 예시적 절차를 도시한 것이다.
도 4는 도커 이미지 취약성 진단 장치를 이용하여 클라이언트가 저장소로부터 이미지를 다운로드하는 예시적 절차를 도시한 것이다.
도 5는 취약성 진단 모듈이 취약점 탐지 데이터를 파싱하는 코드의 예시이다.
도 6은 취약성 진단 모듈이 심각도 정보를 이용하여 취약점 점수를 계산하는 코드의 예시이다.
도 7은 도커 이미지 취약성 진단 방법을 실행하는 예시 스크립트이다.
1 is a conceptual diagram illustrating a process of uploading/downloading and modifying a Docker image in a Docker system.
2 is a block diagram illustrating a configuration of an apparatus for diagnosing Docker image vulnerabilities according to an aspect.
3 illustrates an exemplary procedure for a client to upload an image to a repository using the Docker image vulnerability diagnosis device.
4 illustrates an exemplary procedure for a client to download an image from a repository using the Docker image vulnerability diagnosis device.
5 is an example of a code for parsing vulnerability detection data by the vulnerability diagnosis module.
6 is an example of a code in which the vulnerability diagnosis module calculates a vulnerability score using severity information.
7 is an example script for executing a Docker image vulnerability diagnosis method.

전술한, 그리고 추가적인 양상들은 첨부된 도면을 참조하여 설명하는 실시 예들을 통해 구체화된다. 각 실시 예들의 구성 요소들은 다른 언급이나 상호간에 모순이 없는 한 실시 예 내에서 다양한 조합이 가능한 것으로 이해된다. 블록도의 각 블록은 어느 경우에 있어서 물리적인 부품을 표현할 수 있으나 또 다른 경우에 있어서 하나의 물리적인 부품의 기능의 일부 혹은 복수의 물리적인 부품에 걸친 기능의 논리적인 표현일 수 있다. 때로는 블록 혹은 그 일부의 실체는 프로그램 명령어들의 집합(set)일 수 있다. 이러한 블록들은 전부 혹은 일부가 하드웨어, 소프트웨어 혹은 이들의 결합에 의해 구현될 수 있다.The foregoing and additional aspects are embodied through the embodiments described with reference to the accompanying drawings. It is understood that various combinations of elements in each embodiment are possible within the embodiments as long as there is no contradiction between them or other mentions. Each block in the block diagram may in some cases represent a physical component, but in other cases may be a part of the function of one physical component or a logical representation of a function across a plurality of physical components. Sometimes a block or part of an entity may be a set of program instructions. All or a part of these blocks may be implemented by hardware, software, or a combination thereof.

도커는 리눅스 컨테이너를 기반으로 하는 오픈소스 프로젝트이며, 도커의 등장으로 인해 컨테이너에 대한 연구가 확장되었다. 컨테이너는 기존의 가상 머신과 달리 호스트 운영체제에서 할당 받은 격리된 컨트롤 그룹(control groups, cgroups)과 네임스페이스(namespaces)를 기반으로 동작한다.Docker is an open source project based on Linux containers, and with the advent of Docker, research on containers has been expanded. Unlike existing virtual machines, containers operate based on isolated control groups (cgroups) and namespaces assigned by the host operating system.

네임스페이스(namespaces)는 파일 시스템, 프로세스, 네트워크, IPC, Hostname 등 사용자에 대한 격리된 공간을 제공해주는 리눅스 커널의 기능이며, 컨트롤 그룹(cgroups)은 리눅스 시스템 자원(예: 메모리, CPU, I/O, 네트워크 등)에 대한 제어를 제공하고 자원에 대한 그룹을 생성해 소유권을 지정할 수 있는 리눅스 커널의 기능이다.Namespaces are a feature of the Linux kernel that provides an isolated space for users such as file system, process, network, IPC, and hostname, and control groups (cgroups) are Linux system resources (e.g., memory, CPU, I/ It is a feature of the Linux kernel that provides control over resources (O, network, etc.)

도커는 이미지의 형태로 컨테이너 실행에 필요한 파일과 설정값 등을 포함시킨다. 도커 이미지의 경우, 도커 시스템을 사용하는 사용자들은 누구나 업로드/다운로드가 가능하다.Docker includes files and settings necessary for container execution in the form of images. In the case of Docker images, anyone using the Docker system can upload/download them.

도 1은 도커 시스템에서 도커 이미지가 업로드/다운로드 및 수정되는 과정을 개념적으로 도시한 것이다. 도커에서는 이미지를 기반으로 하는 컨테이너 환경이 구성된다. 해당 이미지를 원격 저장소(30)에 업로드하여 공유하게 된다. 원격 저장소(30)는 공개 또는 비공개로 구성하는 것이 가능하다. 저장소를 지정하지 않으면, 디폴트로 도커 허브(Docker hub)로 지정되며 파라미터 설정을 통해 저장소를 사설 저장소로 설정하여 업로드가 가능하다.1 is a conceptual diagram illustrating a process of uploading/downloading and modifying a Docker image in a Docker system. Docker creates a container environment based on images. The image is uploaded to the remote storage 30 and shared. The remote storage 30 can be configured as public or private. If you do not specify a repository, it is designated as a Docker hub by default, and uploading is possible by setting the repository as a private repository through parameter settings.

도 1에 도시된 도커 이미지 업로드/다운로드 및 수정되는 과정에 나타난 바와 같이 클라이언트는 특정 이미지를 업로드/다운로드하기 위해 명령을 수행할 때 도커 엔진을 통해 이미지를 업로드/다운로드 할 수 있다. As shown in the process of uploading/downloading and modifying a Docker image shown in FIG. 1, the client may upload/download an image through the Docker engine when performing a command to upload/download a specific image.

하지만, 도 1에서 확인할 수 있듯이, 클라이언트는 원격 저장소(30)에서 로컬 환경으로 도커 이미지를 다운로드하거나 로컬에서 빌드한 도커 이미지를 원격 저장소로 업로드할 경우, 도커 이미지 보안을 위한 별도의 인증 과정을 거치지 않는다.However, as can be seen in FIG. 1, when the client downloads a Docker image from the remote storage 30 to the local environment or uploads a locally built Docker image to the remote storage, a separate authentication process for securing the Docker image is not performed. does not

도 2은 일 양상에 따른 도커 이미지 취약성 진단 장치의 구성을 도시한 블록도이다. 본 발명의 일 양상에 따르는 도커 이미지 취약성 진단 장치(10)는 취약점 탐지 모듈(100)과, 취약성 진단 모듈(110)을 포함하여 도커 이미지에 존재하는 취약점을 탐지하고 도커 이미지의 취약성을 진단한다.2 is a block diagram illustrating a configuration of an apparatus for diagnosing Docker image vulnerabilities according to an aspect. The Docker image vulnerability diagnosis apparatus 10 according to an aspect of the present invention includes a vulnerability detection module 100 and a vulnerability diagnosis module 110 to detect vulnerabilities in a Docker image and diagnose vulnerabilities in the Docker image.

취약점 탐지 모듈(100)은 퍼스널 컴퓨터, 서버 등의 컴퓨팅 장치에서 실행되는 프로그램 명령어로 구현될 수 있으며, 설정된 주기로 CVE(Common Vulnerabilities and Exposures) 취약점 데이터베이스(20)들로부터 취약점 메타데이터를 수집하여 저장하고, 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력한다.The vulnerability detection module 100 may be implemented as a program command executed in a computing device such as a personal computer, a server, etc., and collects and stores vulnerability metadata from the Common Vulnerabilities and Exposures (CVE) vulnerability databases 20 at a set period, and , using the image metadata collected from the Docker image to analyze vulnerabilities and the stored vulnerability metadata, generates and outputs vulnerability detection data.

취약점 탐지 모듈(100)은 각 도커 이미지의 보안 취약성을 분석하기 위해 도커 이미지로부터 취약성 분석에 필요한 취약점 메타데이터를 외부에 존재하는 취약점 데이터베이스(20)로부터 수집하여 모듈 내 데이터베이스(115)에 저장한다. 취약점 데이터베이스(20)로는 CVE 취약점 데이터 베이스, Ubuntu CVE Tracker, Debian Security Bug Tracker, Red Hat Security Data와 같은 데이터베이스들이 존재하며 이들 데이터베이스로부터 주기적으로 도커 이미지에 대한 취약점 정보를 수집한다. 일 예로, 취약점 탐지 모듈(100)은 코어오에스 클레어(CoreOS Clair) 오픈소스 툴 또는 이를 수정하여 개발한 툴을 사용할 수 있고, 이 경우 취약점 탐지 모듈(100)은 Vulnerability Updater를 통해 취약점 데이터베이스(20)로부터 주기적으로 취약점 메타데이터를 수집하여 취약점 탐지 모듈(100)이 사용하는 데이터베이스(115)에 저장한다. 코어오에스 클레어는 하나의 예시로 앵커(Anchore), 앱아머(Apparmor), 다그다(Dagda) 등의 오픈소스 툴 또는 이들을 수정하여 개발한 툴을 사용할 수 있으며, 상용 툴을 사용할 수도 있다.The vulnerability detection module 100 collects vulnerability metadata necessary for vulnerability analysis from the Docker image from the external vulnerability database 20 in order to analyze the security vulnerability of each Docker image, and stores it in the database 115 within the module. As the vulnerability database 20, databases such as a CVE vulnerability database, Ubuntu CVE Tracker, Debian Security Bug Tracker, and Red Hat Security Data exist, and vulnerability information on Docker images is periodically collected from these databases. As an example, the vulnerability detection module 100 may use a CoreOS Clair open source tool or a tool developed by modifying it, and in this case, the vulnerability detection module 100 may use the vulnerability database 20 through the Vulnerability Updater. It periodically collects vulnerability metadata from the database 115 and stores it in the database 115 used by the vulnerability detection module 100 . As an example of CoreOS Clair, open source tools such as Anchor, Apparmor, and Dagda or tools developed by modifying them can be used, and commercial tools can also be used.

취약점 탐지 모듈(100)이 이미지별 패키지 취약성 분석을 위해 CVE 취약점 데이터 베이스, Ubuntu CVE Tracker, Debian Security Bug Tracker, Red Hat Security Data 등의 취약점 데이터베이스(20)로부터 수집하는 취약점 메타데이터는 <표 2>에 기재된 항목들을 포함한다. The vulnerability metadata that the vulnerability detection module 100 collects from the vulnerability database 20 such as the CVE vulnerability database, Ubuntu CVE Tracker, Debian Security Bug Tracker, and Red Hat Security Data for package vulnerability analysis by image is <Table 2> Includes items listed in

취약점 탐지 모듈(100)이 각 이미지의 보안 취약성을 분석하기 위해 이미지로부터 수집하는 이미지 메타데이터는 <표 1>에 기재된 항목들을 포함한다.The image metadata that the vulnerability detection module 100 collects from the image to analyze the security vulnerability of each image includes the items listed in <Table 1>.

취약점 탐지 모듈(100)은 <표 1> 및 <표 2>의 기재된 항목들을 포함하는 메타데이터를 수집한 경우, 도커 이미지에 대한 취약점 탐지 과정을 수행한다. 취약점 탐지 과정은 오픈소스 등으로 공지되어 있으므로 상세한 설명은 생략한다. The vulnerability detection module 100 performs a vulnerability detection process for a Docker image when metadata including items listed in <Table 1> and <Table 2> is collected. Since the vulnerability detection process is known as an open source, a detailed description will be omitted.

취약점 탐지 모듈(100)은 취약점 탐지 과정을 통해 분석한 이미지의 레이어 ID, 이미지에 존재하는 총 취약점 개수, 승인되지 않은 취약점 개수, CVE 심각도, 패키지 이름, 패키지 버전, CVE 정보 설명을 포함하는 취약점 탐지 데이터를 출력한다.The vulnerability detection module 100 detects vulnerabilities including the layer ID of the image analyzed through the vulnerability detection process, the total number of vulnerabilities in the image, the number of unauthorized vulnerabilities, CVE severity, package name, package version, and CVE information description output data.

취약점 탐지 모듈(100)은 사용자로부터 입력된 취약점 화이트리스트(Whitelist)에 포함된 취약점은 승인된 취약점으로 분류하여 취약점 탐지 데이터를 생성하여 출력할 수 있다. The vulnerability detection module 100 may classify vulnerabilities included in a vulnerability whitelist input from a user as approved vulnerabilities, generate and output vulnerability detection data.

데이터 필드data field 설명Explanation Image IDImage ID 각 고유 이미지에 대해 256비트 길이의 ID256-bit long ID for each unique image Image NameImage Name 특정 이름 정책을 따르는 각 이미지의 식별자An identifier for each image that follows a specific naming policy. Last Update TimeLast Update Time 이미지에 대한 정확한 데이터 및 최종 업데이트 시간Accurate data and last update time for images Layer IDLayer ID 각 레이어의 고유 ID 및 레이어 간의 관계Unique ID of each layer and relationship between layers CommandsCommands 이미지 빌드 관련 명령Image build related commands

데이터 필드data field 설명Explanation TimestampTimestamp 취약점 탐지툴(예, Clair)에 의한 정확한 분석 시간Accurate analysis time by vulnerability detection tool (eg Clair) Vulnerability IDVulnerability ID 취약성을 식별하기 위한 고유한 CVE 식별자Unique CVE identifier to identify vulnerabilities Severity RankingSeverity Ranking 각 취약점의 심각도Severity of each vulnerability Description of CVEDescription of CVE 식별된 각 취약점에 대한 설명Description of each identified vulnerability Associated PackagesAssociated Packages 각 취약점과 관련된 패키지의 이름과 정확한 버전The name and exact version of the package associated with each vulnerability. Layer IDLayer ID 취약점이 존재하는 특정 이미지 layerSpecific image layers where vulnerabilities exist

취약성 진단 모듈(110)은 취약점 탐지 데이터를 파싱하여 심각도 정보를 획득하고 심각도 정보를 이용하여 도커 이미지의 취약점 점수를 계산한다.The vulnerability diagnosis module 110 parses the vulnerability detection data to obtain severity information, and calculates a vulnerability score of the Docker image using the severity information.

또한, 취약성 진단 모듈(110)은 취약점 탐지 모듈(100)로부터 출력된 정보를 기반으로 도커 이미지에 대해 업로드 또는 다운로드 가능 여부를 결정하는 모듈이다. Also, the vulnerability diagnosis module 110 is a module that determines whether a Docker image can be uploaded or downloaded based on information output from the vulnerability detection module 100 .

취약성 진단 모듈(110)은 이미지 취약점 탐지 모듈(100)로부터 출력된 정보 중 도커 이미지에 포함된 패키지 취약점의 심각도를 기반으로 취약점 점수를 계산하며, 계산된 취약점 점수가 취약점 임계 점수 이상일 경우, 해당 도커 이미지는 업로드/다운로드가 불가하며, 취약점 임계 점수 미만일 경우에만 해당 도커 이미지는 업로드/다운로드가 가능하다. 이때, 취약점 임계 점수는 사용자에 의해 설정이 가능하다.The vulnerability diagnosis module 110 calculates a vulnerability score based on the severity of the package vulnerability included in the Docker image among the information output from the image vulnerability detection module 100, and when the calculated vulnerability score is equal to or greater than the vulnerability threshold score, the corresponding Docker Images cannot be uploaded/downloaded, and the Docker image can only be uploaded/downloaded when the vulnerability is below the threshold score. In this case, the vulnerability threshold score can be set by the user.

Figure 112019120944059-pat00001
Figure 112019120944059-pat00001

sv는 도커 이미지 패키지 취약점 심각도를 의미하고, r sv 는 해당 심각도의 취약점 수를 의미하고, w sv 는 심각도의 가중치를 의미하고, α는 화이트리스트에 의한 승인 여부를 의미한다. sv means the Docker image package vulnerability severity, r sv means the number of vulnerabilities of the corresponding severity, w sv means the weight of the severity, and α means whether or not to be approved by the whitelist.

취약성 진단 모듈(110)에 의한 도커 이미지 취약점 점수 계산은 <수학식1>을 따라 계산되며, 해당 패키지의 특정 취약점이 사용자에 의해 설정된 화이트리스트에 포함된 경우, 취약점의 승인 여부를 나타내는 값 α는 0이 된다. 이외에 화이트리스트에 설정되지 않은 이미지에 존재하는 패키지의 취약점의 경우, α는 1이 된다. 취약성 진단 모듈(110)은 <수학식1>을 따라 도커 이미지 취약점 점수를 계산한 후 취약점 임계 점수와 해당 값을 비교한다. 도커 이미지 취약점 점수와 취약점 임계 점수를 비교 결과

Figure 112019120944059-pat00002
와 같이 도커 이미지 취약점 점수가 취약점 임계 점수(θ)를 초과하는 경우, 해당 이미지를 업로드 또는 다운로드할 수 없다. 즉, 다운로드한 이미지의 경우 설치하지 않고 폐기하고, 업로드되어야 할 이미지의 경우 업로드 하지 않고 폐기한다.The Docker image vulnerability score calculation by the vulnerability diagnosis module 110 is calculated according to <Equation 1>, and when a specific vulnerability of the corresponding package is included in the whitelist set by the user, the value α indicating whether the vulnerability is approved is becomes 0. In addition, in the case of vulnerabilities of packages that exist in images that are not set in the whitelist, α is 1. The vulnerability diagnosis module 110 calculates a Docker image vulnerability score according to Equation 1 and compares the vulnerability threshold score with the corresponding value. Comparison result of Docker image vulnerability score and vulnerability threshold score
Figure 112019120944059-pat00002
When the Docker image vulnerability score exceeds the vulnerability threshold score ( θ ), the image cannot be uploaded or downloaded. That is, in the case of a downloaded image, it is discarded without installation, and in the case of an image to be uploaded, it is discarded without uploading it.

본 발명의 일 실시 예에 따르면, 도커 이미지 취약성 진단 장치(10)에서 실행되는 프로그램 명령어로 적어도 일부가 구현되는 도커 이미지 취약성 진단 방법은 설정된 주기로 CVE 취약점 데이터베이스(20)들로부터 취약점 메타데이터를 수집하여 저장하는 단계와, 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하는 단계와, 취약점 탐지 데이터를 파싱하여 심각도 정보를 획득하는 단계와, 심각도 정보를 이용하여 도커 이미지의 취약점 점수를 계산하는 단계를 포함한다.According to an embodiment of the present invention, the Docker image vulnerability diagnosis method, which is at least partially implemented as a program command executed in the Docker image vulnerability diagnosis apparatus 10, collects vulnerability metadata from the CVE vulnerability databases 20 at a set cycle, The steps of saving, generating and outputting vulnerability detection data using the image metadata collected from the Docker image to be analyzed for vulnerabilities and the stored vulnerability metadata, and parsing the vulnerability detection data to obtain severity information; and calculating a vulnerability score of the Docker image by using the severity information.

또 다른 실시 예에 따르면, 취약점 탐지 데이터를 생성하여 출력하는 단계에서 생성되어 출력되는 취약점 탐지 데이터는 사용자로부터 입력된 취약점 화이트리스트에 포함된 취약점은 승인된 취약점으로 분류되어 생성되고, 취약점 점수를 계산하는 단계는 승인된 취약점은 제외하고 도커 이미지의 취약점 점수를 계산할 수 있다.According to another embodiment, in the vulnerability detection data generated and output in the step of generating and outputting the vulnerability detection data, the vulnerabilities included in the vulnerability whitelist input by the user are classified as approved vulnerabilities, and the vulnerability score is calculated. The step can calculate the vulnerability score of the Docker image excluding the approved vulnerabilities.

또 다른 실시 예에 따르면, 도커 이미지 취약성 진단 방법은 계산된 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 저장 또는 폐기를 결정하는 단계를 더 포함할 수 있고, 이때 도커 이미지는 원격 저장소(30, repository)로부터 다운로드한 이미지이거나, 사용자에 의해 빌드되어 로드된 이미지일 수 있다.According to another embodiment, the Docker image vulnerability diagnosis method may further include determining storage or disposal of the Docker image by comparing the calculated vulnerability score with the vulnerability threshold score, wherein the Docker image is stored in the remote storage 30, It may be an image downloaded from the repository) or an image built and loaded by the user.

도 3는 도커 이미지 취약성 진단 장치를 이용하여 클라이언트가 원격 저장소에 이미지를 업로드하는 예시적 절차를 도시한 것이다. 도 3을 참조하여 설명하면, 취약점 탐지 모듈(100)은 취약점 데이터베이스(20)에 취약점 메타데이터 정보를 요청한다(S1000). 요청을 받은 취약점 데이터베이스(20)는 Ubuntu, CentOS 등의 취약점 메타데이터를 취약점 탐지 모듈(100)에 송신하며(S1020), 취약점 탐지 모듈(100)은 수신한 취약점 메타데이터를 취약점 메타데이터 DB에 저장한다(S1040). S1000 내지 S1040 절차는 설정된 주기에 따라 반복하여 수행된다. 클라이언트가 업로드를 위해 도커 엔진을 통해 빌드한 도커 이미지를 취약성 진단을 위해 취약점 탐지 모듈(100)에 로드한다(S1060). 취약점 탐지 모듈(100)은 로드된 도커 이미지로부터 <표 1>에 기재된 이미지 메타데이터를 추출하여 수집한다(S1080). 업로드할 도커 이미지에 대해 <표 1>의 메타데이터를 추출한 정보를 기반으로 취약점 탐지 모듈(100)은 취약점 메타데이터 DB에서 해당 도커 이미지와 관련한 취약점 메타데이터를 추출하여 취약점 탐지 데이터를 생성하여 출력한다(S1100). 취약점 탐지 모듈(100)은 도커 이미지 취약점 탐지 결과인 취약점 탐지 데이터를 도커 이미지 취약점 점수 계산 및 업로드 가능 여부를 결정하기 위해 취약성 진단 모듈(110)로 송신한다(S1120). 취약점 탐지 데이터를 수신한 취약성 진단 모듈(110)은 취약점 탐지 데이터로부터 심각도 관련 정보를 파싱 및 카운팅하고(S1140), <표 3>에 정의된 심각도별 점수를 반영하여 <수학식1>에 따라 도커 이미지 취약점 점수를 계산하여(S1160) 취약점 임계 점수와 비교를 수행한다(S1180). 만약 계산된 취약점 점수

Figure 112019120944059-pat00003
가 취약점 임계 점수를 초과하는 경우, 해당 이미지를 삭제하는 명령을 수행하고 취약성 진단 모듈(110)은 도커 이미지 취약성 진단 결과를 클라이언트에게 송신하여 절차를 종료한다(미도시). 만약 계산된 취약점 점수
Figure 112019120944059-pat00004
가 취약점 임계 점수 미만인 경우, 취약성 진단 모듈(110)은 클라이언트에게 도커 이미지 취약성 진단 결과를 송신하고(S1200), 안전한 이미지라는 결과를 수신한 클라이언트는 이미지 업로드 명령을 docker cli에 전달한다(S1220). docker cli는 해당 명령을 docker engine에 post 통신하며(S1240), 해당 명령을 수신한 docker engine은 원격 저장소(30)에 도커 이미지 업로드 요청을 수행한다(S1260). 요청을 수신한 원격 저장소(30)는 이미지 업로드가 완료되었다는 메시지를 클라이언트에게 송신한다.3 shows an exemplary procedure for a client to upload an image to a remote storage using the Docker image vulnerability diagnosis device. Referring to FIG. 3 , the vulnerability detection module 100 requests vulnerability metadata information from the vulnerability database 20 ( S1000 ). The received vulnerability database 20 transmits vulnerability metadata of Ubuntu, CentOS, etc. to the vulnerability detection module 100 (S1020), and the vulnerability detection module 100 stores the received vulnerability metadata in the vulnerability metadata DB. do (S1040). Procedures S1000 to S1040 are repeatedly performed according to a set period. The Docker image built by the client through the Docker engine for upload is loaded into the vulnerability detection module 100 for vulnerability diagnosis (S1060). The vulnerability detection module 100 extracts and collects image metadata listed in <Table 1> from the loaded Docker image (S1080). Based on the information extracted from the metadata in <Table 1> for the Docker image to be uploaded, the vulnerability detection module 100 extracts the vulnerability metadata related to the Docker image from the vulnerability metadata DB to generate and output vulnerability detection data (S1100). The vulnerability detection module 100 transmits the vulnerability detection data, which is the result of detecting the vulnerability of the Docker image, to the vulnerability diagnosis module 110 to determine whether the Docker image vulnerability score can be calculated and uploaded (S1120). The vulnerability diagnosis module 110 receiving the vulnerability detection data parses and counts severity-related information from the vulnerability detection data (S1140), reflects the score for each severity defined in <Table 3>, and according to <Equation 1>, The image vulnerability score is calculated (S1160) and compared with the vulnerability threshold score (S1180). If the calculated vulnerability score
Figure 112019120944059-pat00003
exceeds the vulnerability threshold score, executes a command to delete the image, and the vulnerability diagnosis module 110 transmits the Docker image vulnerability diagnosis result to the client to end the procedure (not shown). If the calculated vulnerability score
Figure 112019120944059-pat00004
is less than the vulnerability threshold score, the vulnerability diagnosis module 110 transmits a Docker image vulnerability diagnosis result to the client (S1200), and the client, receiving the result of a secure image, transmits an image upload command to the docker cli (S1220). The docker cli posts a corresponding command to the docker engine (S1240), and the docker engine that receives the command performs a docker image upload request to the remote storage 30 (S1260). The remote storage 30 receiving the request sends a message to the client indicating that the image upload is complete.

NotationNotation Definitiondefinition ExampleExample Example ValueExample Value svsv 도커 이미지 취약점 심각도Docker Image Vulnerability Severity unknownunknown -- negligiblenegligible -- lowlow -- mediummedium -- highhigh -- criticalcritical -- rr svsv sv의 수 number of sv rr unknownunknown -- rr negligiblenegligible -- rr lowlow -- rr mediummedium -- rr highhigh -- rr criticalcritical -- ww svsv sv의 가중치weight of sv WW unknownunknown 0.00.0 WW negligiblenegligible 0.50.5 WW lowlow 22 WW mediummedium 5.455.45 WW highhigh 7.957.95 WW criticalcritical 9.59.5 ImgImg scorescore 도커 이미지 취약점의 총 심각도 점수Total Severity Score for Docker Image Vulnerabilities -- imiell/bad-dockerfile:178.65imiell/bad-dockerfile:178.65 parse(rparse(r svsv , result.txt), result.txt) result.txt로부터 r sv 파싱Parsing r sv from result.txt -- -- αα 도커 이미지 취약점 승인 여부 값Docker Image Vulnerability Acceptable Value -- approval value: 0
Unapproval value: 1
approval value: 0
Unapproval value: 1
θθ 도커 이미지 취약점 임계 점수Docker Image Vulnerability Threshold Score -- 150150

도 4는 도커 이미지 취약성 진단 장치를 이용하여 클라이언트가 저장소로부터 이미지를 다운로드하는 예시적 절차를 도시한 것이다. 도 4를 참조하여 설명하면, 취약점 탐지 모듈(100)은 취약점 데이터베이스(20)에 취약점 메타데이터 정보를 요청한다(S2000). 요청을 받은 취약점 데이터베이스(20)는 Ubuntu, CentOS 등의 취약점 메타데이터를 취약점 탐지 모듈(100)에 송신하며(S2020), 취약점 탐지 모듈(100)은 수신한 취약점 메타데이터를 취약점 메타데이터 DB(115)에 저장한다(S2040). S2000 내지 S2040 절차는 설정된 주기에 따라 반복하여 수행된다. 클라이언트는 도커 이미지를 원격 저장소(30)로부터 다운로드하기 위해 도커 이미지 다운로드 명령을 docker cli에 전달한다(S2060). docker cli는 해당 명령을 post 통신을 통해 docker engine에게 송신하며(S2080), 해당 명령을 수신한 docker engine은 원격 저장소에 다운로드 받을 도커 이미지를 요청한다(S2100). 요청을 수신한 원격 저장소(30)는 다운로드 승인을 통해 클라이언트의 docker engine 이미지 저장소에 요청한 이미지를 다운로드한다(S2120). 원격 저장소(30)로부터 다운받은 이미지는 취약성 진단을 위해 docker engine 이미지 저장소로부터 취약점 탐지 모듈(100)에 로드된다(S2140). 취약점 탐지 모듈(100)은 로드된 도커 이미지로부터 <표 1>에 기재된 이미지 메타데이터를 추출하여 수집한다(S2160). 다운로드된 도커 이미지에 대해 <표 1>의 메타데이터를 추출한 정보를 기반으로 취약점 탐지 모듈(100)은 취약점 메타데이터 DB(115)에서 해당 도커 이미지와 관련한 취약점 메타데이터를 추출하여 취약점 탐지 데이터를 생성하여 출력한다(S2180). 취약점 탐지 모듈(100)은 도커 이미지 취약점 탐지 결과인 취약점 탐지 데이터를 도커 이미지 취약점 점수 계산 및 폐기 여부를 결정하기 위해 취약성 진단 모듈(110)로 송신한다(S2200). 취약점 탐지 데이터를 수신한 취약성 진단 모듈(110)은 취약점 탐지 데이터로부터 심각도 관련 정보를 파싱 및 카운팅하고(S2220), <표 3>에 정의된 심각도별 점수를 반영하여 <수학식1>에 따라 도커 이미지 취약점 점수를 계산하여(S2240) 취약점 임계 점수와 비교를 수행한다(S2260). 만약 계산된 취약점 점수

Figure 112019120944059-pat00005
가 취약점 임계 점수를 초과하는 경우, 해당 이미지를 삭제하는 명령을 수행하고(S2280) 취약성 진단 모듈(110)은 도커 이미지 취약성 진단 결과를 클라이언트에게 송신하여 절차를 종료한다(S2300). 4 illustrates an exemplary procedure for a client to download an image from a repository using the Docker image vulnerability diagnosis device. Referring to FIG. 4 , the vulnerability detection module 100 requests vulnerability metadata information from the vulnerability database 20 ( S2000 ). The received vulnerability database 20 transmits vulnerability metadata of Ubuntu, CentOS, etc. to the vulnerability detection module 100 (S2020), and the vulnerability detection module 100 transmits the received vulnerability metadata to the vulnerability metadata DB 115 ) is stored in (S2040). Procedures S2000 to S2040 are repeatedly performed according to a set period. The client transmits a docker image download command to the docker cli to download the docker image from the remote storage 30 (S2060). The docker cli sends the corresponding command to the docker engine through post communication (S2080), and the docker engine that receives the command requests the docker image to be downloaded from the remote storage (S2100). The remote storage 30 receiving the request downloads the requested image to the docker engine image storage of the client through download approval (S2120). The image downloaded from the remote storage 30 is loaded into the vulnerability detection module 100 from the docker engine image storage for vulnerability diagnosis (S2140). The vulnerability detection module 100 extracts and collects image metadata listed in <Table 1> from the loaded Docker image (S2160). Based on the information extracted from the metadata in <Table 1> for the downloaded Docker image, the vulnerability detection module 100 extracts the vulnerability metadata related to the Docker image from the vulnerability metadata DB 115 to generate vulnerability detection data. and output (S2180). The vulnerability detection module 100 transmits the vulnerability detection data, which is the result of detecting the vulnerability of the Docker image, to the vulnerability diagnosis module 110 to determine whether to calculate and discard the vulnerability score for the Docker image (S2200). The vulnerability diagnosis module 110 receiving the vulnerability detection data parses and counts severity-related information from the vulnerability detection data (S2220), reflects the score for each severity defined in <Table 3>, and according to <Equation 1>, The image vulnerability score is calculated (S2240) and compared with the vulnerability threshold score (S2260). If the calculated vulnerability score
Figure 112019120944059-pat00005
exceeds the vulnerability threshold score, executes a command to delete the image (S2280), and the vulnerability diagnosis module 110 transmits the Docker image vulnerability diagnosis result to the client to end the procedure (S2300).

도 5는 취약성 진단 모듈이 취약점 탐지 데이터를 파싱하는 코드의 예시이다. 도 5에 도시된 예시 코드는 파이썬으로 구현되어 있으나, 구현 언어에 제한이 있는 것은 아니다. 도 5에 도시된 예시 코드를 간략하게 설명하면, Open 함수는 이미지 취약점 탐지 모듈(100)을 통해 얻은 이미지 취약점 결과 값파일을 여는 함수이다.5 is an example of a code for parsing vulnerability detection data by the vulnerability diagnosis module. The example code shown in FIG. 5 is implemented in Python, but there is no limitation in the implementation language. Briefly describing the example code shown in FIG. 5 , the Open function is a function that opens an image vulnerability result value file obtained through the image vulnerability detection module 100 .

Findall 함수는 취약점 탐지 모듈(100)을 통해 얻은 이미지 취약점 결과인 취약점 탐지 데이터로부터 심각도에 대한 내용을 파싱하는 함수이다. 이를 통해 도커 이미지 취약점 탐지 데이터에 존재하는 심각도 정보(예: unknown, negligible, low, medium, high, critical, defcon)를 파싱한다.The Findall function is a function that parses severity content from vulnerability detection data, which is an image vulnerability result obtained through the vulnerability detection module 100 . Through this, the severity information (eg, unknown, negligible, low, medium, high, critical, defcon) existing in the Docker image vulnerability detection data is parsed.

frequency.get 함수는 Findall 함수를 통해 파싱한 심각도 별 개수를 카운팅하는 함수이다. 이를 통해 이미지 취약점 탐지 데이터가 저장되어 있는 파일로부터 심각도별 개수를 저장한다.The frequency.get function is a function that counts the number of severity levels parsed through the Findall function. Through this, the number of each severity is saved from the file in which image vulnerability detection data is stored.

frequency 함수는 frequency.get 함수를 통해 이미지 취약점 탐지 데이터가 저장되어 있는 파일로부터 얻은 심각도별 개수에 각 심각도별 점수를 계산하는 함수이다. 이를 통해 심각도 별 점수가 계산된다.The frequency function is a function that calculates the score for each severity based on the number of severity levels obtained from the file in which image vulnerability detection data is stored through the frequency.get function. This will calculate a score for each severity level.

도 6은 취약성 진단 모듈이 심각도 정보를 이용하여 취약점 점수를 계산하는 코드의 예시이다. 도 5에 도시된 예시 코드는 파이썬으로 구현되어 있으나, 구현 언어에 제한이 있는 것은 아니다. 도 5에 도시된 예시 코드를 간략하게 설명하면, open 함수는 도 6에서 생성한 이미지 취약점 심각도 별 점수가 저장되어 있는 파일을 여는 함수이다.6 is an example of a code in which the vulnerability diagnosis module calculates a vulnerability score using severity information. The example code shown in FIG. 5 is implemented in Python, but there is no limitation in the implementation language. Briefly describing the example code shown in FIG. 5 , the open function is a function that opens a file in which scores for each image vulnerability severity generated in FIG. 6 are stored.

readlines 함수는 open 함수에서 열은 이미지 취약점 심각도 별 점수가 저장되어 있는 파일을 라인별로 읽어오는 함수이다.The readlines function reads the file in which scores for each image vulnerability severity opened by the open function are stored line by line.

total += float(num)은 이미지 취약점 심각도 별 점수에 대해 덧셈 연산을 수행하는 코드이다.total += float(num) is a code that performs addition operation on scores by image vulnerability severity.

if total > θ는 total += float(num)을 통해 구해진 이미지 취약점 심각도 점수를 이미지 취약점 임계 점수(θ)와 비교하여 임계 점수 초과일 경우, "Delete your docker image"를 출력하고, 임계 점수 미만일 경우, "It's a Safe docker image"를 출력한다.if total > θ compares the image vulnerability severity score obtained through total += float(num) with the image vulnerability threshold score ( θ ). If the threshold score is exceeded, "Delete your docker image" is output. , it prints "It's a Safe docker image".

print total은 total+=float(num)을 통해 구해진 이미지 취약점 심각도 점수에 대해 출력한다.print total outputs the image vulnerability severity score obtained through total+=float(num).

도 7은 도커 이미지 취약성 진단 방법을 실행하는 예시 스크립트이다. 도 7에 도시된 스크립트 코드의 주요 코드를 간략하게 설명한다. 7 is an example script for executing a Docker image vulnerability diagnosis method. The main code of the script code shown in FIG. 7 will be briefly described.

docker-compose run -rm clair-scanner $1> dockerimage.txt는 이미지 취약점 탐지 모듈(100)의 구현 예시인 오픈소스 툴(clair)을 이용하여 클라이언트가 다운로드 받으려는 도커 이미지($1)에 대해 취약점 탐지를 수행하여 결과 값인 취약점 탐지 데이터를 dockerimage.txt로 저장하는 명령이다.docker-compose run -rm clair-scanner $1> dockerimage.txt performs vulnerability detection on the Docker image ($1) that the client wants to download using an open source tool (clair) that is an implementation example of the image vulnerability detection module 100 This command saves the vulnerability detection data, which is the result value, as dockerimage.txt.

sed '/Unapproved/!d' dockerimage.txt>result.txt는 dockerimage.txt로 저장된 취약점 탐지 데이터에 대해 클라이언트로부터 승인되지 않은 취약점만을 파싱하여 result.txt로 저장하는 명령이다.sed '/Unapproved/!d' dockerimage.txt>result.txt is a command to parse only vulnerabilities not approved by the client for vulnerability detection data stored in dockerimage.txt and save it as result.txt.

while IFS= read -r line은 저장된 파일을 라인별로 읽어 오는 코드이다.while IFS= read -r line is the code to read the saved file line by line.

if ["$line" == "Delete your docker image"]; then docker rmi $1은 계산된 취약적 점수가 취약점 임계 점수를 초과하는 경우에 출력되는 "Delete your docker image" 문자열이 파일에 포함되어 있는 경우, docker rmi $1(다운받으려는 도커 이미지) 명령을 통해 해당 이미지를 삭제하는 명령이다.if ["$line" == "Delete your docker image"]; then docker rmi $1 is a file containing the string "Delete your docker image", which is output when the calculated vulnerability score exceeds the vulnerability threshold score, the image is executed through the docker rmi $1 (docker image to download) command. command to delete

도 7은 도커 이미지 취약성 진단 장치의 취약점 탐지 모듈이 Clair로 구현된 예시이며 취약성 진단 하는 방법의 구현이 도 7의 예시와 같이 스크립트로 작성되어야 하는 것은 아니며, 다른 프로그래밍 언어로 작성될 수 있으며 스크립트 또한 하나의 예시에 불과하므로 다른 절차로 스크립트가 구성될 수도 있다. 또한, 취약점 탐지 모듈의 구현이 Clair에 한정된 것이 아니며, 다양한 취약점 탐지 툴을 이용하여 구현될 수 있다. 7 is an example in which the vulnerability detection module of the Docker image vulnerability diagnosis device is implemented with Clair, and the implementation of the vulnerability diagnosis method does not have to be written as a script as in the example of FIG. Since this is only an example, the script may be configured with other procedures. In addition, implementation of the vulnerability detection module is not limited to Clair, and may be implemented using various vulnerability detection tools.

일 실시 예에 따른 도커 이미지 취약성 진단 방법은 <표 3>에 정의된 심각도별 점수에 따라 취약성을 진단하였으며, 사용자의 기준에 따라 <표 3>에 정의된 심각도별 점수는 다르게 정의될 수 있다. 또한, 이미지 취약점 임계 점수인 θ의 경우에도 클라이언트의 기준에 따라 다르게 정의될 수 있다.The Docker image vulnerability diagnosis method according to an embodiment diagnoses the vulnerability according to the score for each severity defined in <Table 3>, and the score for each severity defined in <Table 3> may be defined differently according to the user's criteria. Also, θ , which is the image vulnerability threshold score, may be defined differently according to the criteria of the client.

이상에서 본 발명을 첨부된 도면을 참조하는 실시 예들을 통해 설명하였지만 이에 한정되는 것은 아니며, 이들로부터 당업자라면 자명하게 도출할 수 있는 다양한 변형 예들을 포괄하도록 해석되어야 한다. 특허청구범위는 이러한 변형 예들을 포괄하도록 의도되었다.Although the present invention has been described above with reference to the accompanying drawings, the present invention is not limited thereto, and it should be construed to encompass various modifications that can be apparent from those skilled in the art. The claims are intended to cover such variations.

10: 도커 이미지 취약성 진단 장치
100: 취약점 탐지 모듈
110: 취약성 진단 모듈
115: 취약점 메타데이터 데이터베이스
20: 취약점 데이터베이스
30: 원격 저장소
10: Docker Image Vulnerability Diagnostic Device
100: vulnerability detection module
110: vulnerability diagnosis module
115: Vulnerability Metadata Database
20: Vulnerability Database
30: Remote Storage

Claims (8)

설정된 주기로 CVE(Common Vulnerabilities and Exposures) 취약점 데이터베이스들로부터 취약점 메타데이터를 수집하여 저장하고, 원격 저장소(repository)로부터 다운로드한 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하는 취약점 탐지 모듈; 및
상기 취약점 탐지 데이터로부터 심각도 정보를 획득하고 상기 심각도 정보를 이용하여 상기 도커 이미지의 취약점 점수를 계산하며 상기 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 저장 또는 폐기를 결정하는 이미지 취약성 진단 모듈;
을 포함하는 도커 이미지 취약성 진단 장치.
Vulnerability metadata is collected and stored from CVE (Common Vulnerabilities and Exposures) vulnerability databases at a set interval, and vulnerabilities downloaded from a remote repository are analyzed using image metadata collected from Docker images and stored vulnerability metadata. a vulnerability detection module that generates and outputs vulnerability detection data; and
an image vulnerability diagnosis module for obtaining severity information from the vulnerability detection data, calculating a vulnerability score of the Docker image using the severity information, and determining storage or disposal of the Docker image by comparing the vulnerability score with a vulnerability threshold score;
A Docker image vulnerability diagnosis device comprising a.
설정된 주기로 CVE(Common Vulnerabilities and Exposures) 취약점 데이터베이스들로부터 취약점 메타데이터를 수집하여 저장하고,사용자에 의해 빌드되어 로드된 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하는 취약점 탐지 모듈; 및
상기 취약점 탐지 데이터로부터 심각도 정보를 획득하고 상기 심각도 정보를 이용하여 상기 도커 이미지의 취약점 점수를 계산하며 상기 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 원격 저장소로의 업로드 또는 폐기를 결정하는 이미지 취약성 진단 모듈;
을 포함하는 도커 이미지 취약성 진단 장치.
Vulnerability metadata is collected and stored from Common Vulnerabilities and Exposures (CVE) vulnerability databases at set intervals, and vulnerability using image metadata and stored vulnerability metadata collected from Docker images to analyze vulnerabilities built and loaded by users a vulnerability detection module that generates and outputs detection data; and
Image vulnerability for obtaining severity information from the vulnerability detection data, calculating a vulnerability score of the Docker image using the severity information, and comparing the vulnerability score with a vulnerability threshold score to determine upload or discard of a Docker image to a remote storage diagnostic module;
A Docker image vulnerability diagnosis device comprising a.
청구항 1 또는 청구항 2에 있어서,
상기 취약점 탐지 모듈은 사용자로부터 입력된 취약점 화이트리스트에 포함된 취약점은 승인된 취약점으로 분류하여 상기 취약점 탐지 데이터를 생성하여 출력하고,
상기 취약성 진단 모듈은 상기 승인된 취약점은 제외하고 상기 도커 이미지의 상기 취약점 점수를 계산하는 도커 이미지 취약성 진단 장치.
The method according to claim 1 or 2,
The vulnerability detection module classifies vulnerabilities included in the vulnerability whitelist input from the user as approved vulnerabilities, generates and outputs the vulnerability detection data,
The vulnerability diagnosis module is a Docker image vulnerability diagnosis device for calculating the vulnerability score of the Docker image excluding the approved vulnerabilities.
도커 이미지 취약성 진단 장치에서 실행되는 프로그램 명령어로 적어도 일부가 구현되는 도커 이미지 취약성 진단 방법에 있어서,
설정된 주기로 CVE 취약점 데이터베이스들로부터 취약점 메타데이터를 수집하여 저장하는 단계;
원격 저장소(repository)로부터 다운로드한 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하는 단계;
상기 취약점 탐지 데이터로부터 심각도 정보를 획득하는 단계;
상기 심각도 정보를 이용하여 상기 도커 이미지의 취약점 점수를 계산하는 단계; 및
상기 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 저장 또는 폐기를 결정하는 단계;
를 포함하는 도커 이미지 취약성 진단 방법.
A Docker image vulnerability diagnosis method at least partially implemented as a program command executed in a Docker image vulnerability diagnosis device, the method comprising:
collecting and storing vulnerability metadata from CVE vulnerability databases at a set period;
generating and outputting vulnerability detection data using image metadata collected from a Docker image to analyze vulnerabilities downloaded from a remote repository and stored vulnerability metadata;
obtaining severity information from the vulnerability detection data;
calculating a vulnerability score of the Docker image using the severity information; and
determining storage or disposal of the Docker image by comparing the vulnerability score with a vulnerability threshold score;
A method for diagnosing Docker image vulnerabilities, including
도커 이미지 취약성 진단 장치에서 실행되는 프로그램 명령어로 적어도 일부가 구현되는 도커 이미지 취약성 진단 방법에 있어서,
설정된 주기로 CVE 취약점 데이터베이스들로부터 취약점 메타데이터를 수집하여 저장하는 단계;
사용자에 의해 빌드되어 로드된 취약점을 분석할 도커 이미지로부터 수집된 이미지 메타데이터와 저장된 취약점 메타데이터를 이용하여 취약점 탐지 데이터를 생성하여 출력하는 단계;
상기 취약점 탐지 데이터로부터 심각도 정보를 획득하는 단계;
상기 심각도 정보를 이용하여 상기 도커 이미지의 취약점 점수를 계산하는 단계; 및
상기 취약점 점수를 취약점 임계 점수와 비교하여 도커 이미지의 원격 저장소로의 업로드 또는 폐기를 결정하는 단계;
를 포함하는 도커 이미지 취약성 진단 방법.
A Docker image vulnerability diagnosis method at least partially implemented as a program command executed in a Docker image vulnerability diagnosis device, the method comprising:
collecting and storing vulnerability metadata from CVE vulnerability databases at a set period;
generating and outputting vulnerability detection data using image metadata collected from a Docker image to be built and loaded by a user and analyzed for vulnerabilities and stored vulnerability metadata;
obtaining severity information from the vulnerability detection data;
calculating a vulnerability score of the Docker image using the severity information; and
comparing the vulnerability score with a vulnerability threshold score to determine upload or discard of a Docker image to a remote storage;
A method for diagnosing Docker image vulnerabilities, including
청구항 4 또는 청구항 5에 있어서,
상기 취약점 탐지 데이터를 생성하여 출력하는 단계에서 생성되어 출력되는 상기 취약점 탐지 데이터는 사용자로부터 입력된 취약점 화이트리스트에 포함된 취약점은 승인된 취약점으로 분류되어 생성되고,
상기 취약점 점수를 계산하는 단계는 상기 승인된 취약점은 제외하고 상기 도커 이미지의 상기 취약점 점수를 계산하는 도커 이미지 취약성 진단 방법.
6. The method according to claim 4 or 5,
The vulnerability detection data generated and output in the step of generating and outputting the vulnerability detection data is generated by classifying vulnerabilities included in the vulnerability whitelist input by the user as approved vulnerabilities,
The calculating of the vulnerability score includes calculating the vulnerability score of the Docker image excluding the approved vulnerability.
삭제delete 삭제delete
KR1020190152085A 2019-11-25 2019-11-25 Apparatus and method for diagnosing docker image vulnerability KR102276885B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190152085A KR102276885B1 (en) 2019-11-25 2019-11-25 Apparatus and method for diagnosing docker image vulnerability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190152085A KR102276885B1 (en) 2019-11-25 2019-11-25 Apparatus and method for diagnosing docker image vulnerability

Publications (2)

Publication Number Publication Date
KR20210063677A KR20210063677A (en) 2021-06-02
KR102276885B1 true KR102276885B1 (en) 2021-07-13

Family

ID=76373082

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190152085A KR102276885B1 (en) 2019-11-25 2019-11-25 Apparatus and method for diagnosing docker image vulnerability

Country Status (1)

Country Link
KR (1) KR102276885B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230045279A (en) 2021-09-28 2023-04-04 건국대학교 산학협력단 Docker image authentication apparatus and method using homomoriphic encryption

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419816A (en) * 2021-06-16 2021-09-21 国网安徽省电力有限公司信息通信分公司 Container mirror image dynamic risk detection method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101445634B1 (en) * 2014-01-27 2014-10-06 주식회사 이글루시큐리티 Device and Method for detecting vulnerability attack in any program
KR102048141B1 (en) * 2018-03-07 2019-11-22 주식회사 신한디에스 Preemptive response system for new information security vulnerability, and method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101445634B1 (en) * 2014-01-27 2014-10-06 주식회사 이글루시큐리티 Device and Method for detecting vulnerability attack in any program
KR102048141B1 (en) * 2018-03-07 2019-11-22 주식회사 신한디에스 Preemptive response system for new information security vulnerability, and method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20230045279A (en) 2021-09-28 2023-04-04 건국대학교 산학협력단 Docker image authentication apparatus and method using homomoriphic encryption

Also Published As

Publication number Publication date
KR20210063677A (en) 2021-06-02

Similar Documents

Publication Publication Date Title
US10891378B2 (en) Automated malware signature generation
Garcia et al. Analysis of operating system diversity for intrusion tolerance
US10581879B1 (en) Enhanced malware detection for generated objects
US9424428B2 (en) Method and system for real time classification of events in computer integrity system
Wang et al. Detecting" 0-day" vulnerability: An empirical study of secret security patch in OSS
EP2452287B1 (en) Anti-virus scanning
US10437996B1 (en) Classifying software modules utilizing similarity-based queries
US9342696B2 (en) Attesting use of an interactive component during a boot process
JP5802848B2 (en) Computer-implemented method, non-temporary computer-readable medium and computer system for identifying Trojanized applications (apps) for mobile environments
TWI720932B (en) System and method for detecting data anomalies by analysing morphologies of known and/or unknown cybersecurity threats
US20120272318A1 (en) System and method for dynamic generation of anti-virus databases
US8656494B2 (en) System and method for optimization of antivirus processing of disk files
CN109271780A (en) Method, system and the computer-readable medium of machine learning malware detection model
KR102276885B1 (en) Apparatus and method for diagnosing docker image vulnerability
US20180096146A1 (en) Method and apparatus for identifying malicious software
US20100242094A1 (en) Identification of telemetry data
KR102073068B1 (en) Method for clustering application and apparatus thereof
US11288368B1 (en) Signature generation
KR102396237B1 (en) Apparatus for processing cyber threat information, method for processing cyber threat information, and medium for storing a program processing cyber threat information
CN112257058A (en) Trusted computing verification method and system for operating system
US20220035910A1 (en) Security detection analytics
KR102102932B1 (en) Hacking Defense Contest System That Evaluates Optimization of Vulnerability Patch
Miller Scalable platform for malicious content detection integrating machine learning and manual review
Li et al. LogKernel: A threat hunting approach based on behaviour provenance graph and graph kernel clustering
US20190311117A1 (en) Employing code signing as a tool in cyber-security deception

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant