nister

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2020 License: MIT Imports: 8 Imported by: 0

README

Nister

Build Status Go Report Card

Nister is a lightweight Go package that returns the most recent, modified CVE Per Product or Programing Language from National Vulnerability Database and HIGH, MEDIUM, LOW severities.

Installation

go get github.com/Youssef-kaiboussi/nister
CLI Example

nister_cli

package main

import (
    "fmt"
    "os"

    "github.com/Youssef-kaiboussi/nister"
)

func main() {
    product := os.Args
    data := nister.RecentCVES(product[1])
    for _, v := range data[0] {
        fmt.Println("ID: ", v.CVE.MetaData.ID)
    }
}

Contributing

Pull requests, bug fixes, and new features are welcome!

  1. Fork the repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -a -m 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request on GitHub

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecentCVES

func RecentCVES(clientProduct string) map[int][]Item

RecentCVES function call retievers today's published and modified CVE by passing an array of products

Types

type Data

type Data struct {
	DataType     string `json:"CVE_data_type"`
	DataFormat   string `json:"CVE_data_format"`
	DataVersion  string `json:"CVE_data_version"`
	NumberOfCVEs string `json:"CVE_data_numberOfCVEs"`
	Timestamp    string `json:"CVE_data_timestamp"`
	CVEItems     []Item `json:"CVE_Items"`
}

Data ...

func ParseCVEReport

func ParseCVEReport(url string) Data

ParseCVEReport ...

type Item

type Item struct {
	Type string
	CVE  struct {
		Type     string `json:"data_type"`
		Formart  string `json:"data_format"`
		Version  string `json:"data_version"`
		MetaData struct {
			ID       string `json:"id"`
			ASSIGNER string `json:"ASSIGNER"`
		} `json:"CVE_data_meta"`
		Affects struct {
			Vendor struct {
				VendorData []struct {
					VendorName string `json:"vendor_name"`
					Product    struct {
						ProductData []struct {
							ProductName string `json:"product_name"`
							Version     struct {
								VersionData []struct {
									VersionValue string `json:"version_value"`
								} `json:"version_data"`
							} `json:"version"`
						} `json:"product_data"`
					} `json:"product"`
				} `json:"vendor_data"`
			} `json:"vendor"`
		} `json:"affects"`
		References struct {
			ReferenceData []struct {
				URL       string `json:"url"`
				Name      string `json:"name"`
				Refsource string `json:"refsource"`
			} `json:"reference_data"`
		} `json:"references"`
		Description struct {
			DescriptionData []struct {
				Lang  string `json:"lang"`
				Value string `json:"value"`
			} `json:"description_data"`
		} `json:"description"`
	} `json:"cve"`
	Impact struct {
		BaseMetricV2 struct {
			Severity                string  `json:"severity"`
			ExploitabilityScore     float64 `json:"exploitabilityScore"`
			ImpactScore             float64 `json:"impactScore"`
			ObtainAllPrivilege      bool    `json:"obtainAllPrivilege"`
			ObtainUserPrivilege     bool    `json:"obtainUserPrivilege"`
			ObtainOtherPrivilege    bool    `json:"obtainOtherPrivilege"`
			UserInteractionRequired bool    `json:"userInteractionRequired"`
		} `json:"baseMetricV2"`
	} `json:"impact"`
	PublishedDate    string `json:"publishedDate"`
	LastModifiedDate string `json:"lastModifiedDate"`
}

Item ...

func HighCVE

func HighCVE() []Item

HighCVE checks today CVE with HIGH Severity

func LowCVE

func LowCVE() []Item

LowCVE checks today's CVE with LOW Severity

func MediumCVE

func MediumCVE() []Item

MediumCVE checks today CVE with Medium Severity

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL