Giter Club home page Giter Club logo

cpe_matcher_public's Introduction

CPE Matcher

Workflow and Architecture

Dataset

The CPE matcher is built using the training data that are provided in the dataset directory. This dataset is splitted between training data and test data with 0.75:0.25 proportion.

Matcher Creation

  • From the training data, the CPE libraries of each CVE (Column "CPE_Library" of CVE_CPE_cleaned.csv) is used as the feature, while the actual library names are used as the labels (Column "labels" of CVE_Labels_cleaned.csv).
  • Then, we create a hashmap (dictionary) between the feature and the labels
  • Given a feature (list of CPE libraries) from the test data, we check whether the feature exist as a key in the hashmap.
  • If the key exist, we output the labels from the hashmap
  • If the key does not exist, we use sentence similarity to find the key that is the most similar to the input feature.

Illustration / Example

As an example of the above matcher creation, consider the following training and test data:

Training data:
CPE Library = ['debian debian_linux', 'mozilla firefox_esr', 'oracle solaris', 'mozilla firefox', 'mozilla thunderbird']
Actual Labels = ['thunderbird', 'firefox']

CPE Library = ['mozilla network_security_services']
Actual Labels = ['nss-util', 'nss', 'nspr']

CPE Library = ['mozilla network_security_services']
Actual Labels = ['nss-util', 'nss']

CPE Library = ['canonical ubuntu_linux', 'linux linux_kernel']
Actual Labels = ['kernel-rt']

Created Hashmap/Dictionary:

Key : Labels
['mozilla network_security_services'] : ['nss-util' = 2, 'nss' = 2, 'nspr' = 1],
['debian debian_linux', 'mozilla firefox_esr', 'oracle solaris', 'mozilla firefox', 'mozilla thunderbird'] : ['thunderbird' = 1, 'firefox' = 1],
['canonical ubuntu_linux', 'linux linux_kernel'] : ['kernel-rt' = 1]

Given the following test input feature:

['mozilla network_security_services']

The following libraries are predicted :

k = 1
['nss-util']

k = 2
['nss-util', 'nss']

k = 3
['nss-util', 'nss', 'nspr']

Result

| k | precision@k | recall@k | F1@k |
|---|-------------|----------|------|
| 1 | 0.88        | 0.18     | 0.30 |
| 2 | 0.73        | 0.24     | 0.36 |
| 3 | 0.68        | 0.27     | 0.38 |

The above result is obtained without using the sentence similarity approach. Therefore, if a feature does not have an exact match in the hashmap, no label will be predicted.

cpe_matcher_public's People

Contributors

stefanusagus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.