Documentation ¶
Index ¶
- Constants
- func CreateTable(db *gorm.DB, name string) (err error)
- func FormatKeyword(year int, month string) string
- func LatestCNNVD(str1, str2 string) (string, error)
- func SaveCNNVDPerYear(dirPath string, cnnvdID string, data interface{}) error
- type CNNVD
- type CNNVDDetail
- type HazardLevel
- type Product
- type Record
- type ReqHazardLevel
- type ReqProduct
- type ReqVendor
- type ReqVulDetail
- type ReqVulList
- func (r *ReqVulList) Fetch() (*[]Record, error)
- func (r *ReqVulList) GetLatestCNNVD(pageSize int) (string, error)
- func (r *ReqVulList) Name() string
- func (r *ReqVulList) Save(data *[]Record, dir string) error
- func (r *ReqVulList) StoreByFile(db *gorm.DB, dir string) error
- func (r *ReqVulList) StoreByRequest(db *gorm.DB) error
- type ReqVulType
- type ResCode
- type ResHazardLevel
- type ResProduct
- type ResVendor
- type ResVulDetail
- type ResVulList
- type ResVulType
- type TableHazardLevel
- type TableProduct
- type TableVendor
- type TableVulDetail
- type TableVulList
- type TableVulType
- type Vendor
- type VulDetail
- type VulList
- type VulType
Constants ¶
View Source
const ( Domain = "www.cnnvd.org.cn" APIVulDetail = "web/cnnvdVul/getCnnnvdDetailOnDatasource" APIVulList = "web/homePage/cnnvdVulList" APIVendor = "web/homePage/getVendorSelectList" APIVulType = "web/homePage/vulTypeList" APIProduct = "web/homePage/getProductSelectList" APIHazardLevel = "web/dictionaries/type/hazardLevel" PageSize = 100 Retry = 5 FirstYear = 1988 DatabaseSource = "root:1600850141yangli@tcp(localhost:3306)/cnnvd?charset=utf8mb4&parseTime=true&loc=Asia%2FShanghai" ProductName = "cnnvd/api/product.go" VendorName = "cnnvd/api/vendor.go" VulDetailName = "cnnvd/api/vul_detail.go" VulListName = "cnnvd/api/vul_list.go" VulTypeName = "cnnvd/api/vul_type.go" HazardLevelName = "cnnvd/api/hazard_level.go" ProductTable = "product" VendorTable = "vendor" VulListTable = "vul_list" VulDetailTable = "vul_detail" VulTypeTable = "vul_type" HazardLevelTable = "hazard_level" VendorFile = "vendor.json" ProductFile = "product.json" VulTypeFile = "vul_type.json" VulListFile = "vul_list" VulDetailFile = "vul_detail" HazardLevelFile = "hazard_level.json" )
Variables ¶
This section is empty.
Functions ¶
func FormatKeyword ¶
func LatestCNNVD ¶
func SaveCNNVDPerYear ¶
SaveCNNVDPerYear 存储每年的漏洞
Types ¶
type CNNVDDetail ¶
type CNNVDDetail struct { Id string `json:"id,omitempty"` VulName string `json:"vulName,omitempty"` CnnvdCode string `json:"cnnvdCode,omitempty"` CveCode string `json:"cveCode,omitempty"` PublishTime string `json:"publishTime,omitempty"` IsOfficial int `json:"isOfficial,omitempty"` Vendor string `json:"vendor,omitempty"` HazardLevel int `json:"hazardLevel,omitempty"` VulType string `json:"vulType,omitempty"` VulTypeName string `json:"vulTypeName,omitempty"` VulDesc string `json:"vulDesc"` AffectedProduct string `json:"affectedProduct,omitempty"` AffectedVendor string `json:"affectedVendor,omitempty"` ProductDesc string `json:"productDesc,omitempty"` AffectedSystem string `json:"affectedSystem,omitempty"` ReferUrl string `json:"referUrl,omitempty"` PatchId string `json:"patchId,omitempty"` Patch string `json:"patch,omitempty"` Deleted string `json:"deleted,omitempty"` Version string `json:"version,omitempty"` CreateUid string `json:"createUid,omitempty"` CreateUname string `json:"createUname,omitempty"` CreateTime string `json:"createTime,omitempty"` UpdateUid string `json:"updateUid,omitempty"` UpdateUname string `json:"updateUname,omitempty"` UpdateTime string `json:"updateTime,omitempty"` CnnvdFiledShow string `json:"cnnvdFiledShow,omitempty"` CveVulVO string `json:"cveVulVO,omitempty"` CveFiledShow string `json:"cveFiledShow,omitempty"` IbmVulVO string `json:"ibmVulVO,omitempty"` IbmFiledShow string `json:"ibmFiledShow,omitempty"` IcsCertVulVO string `json:"icsCertVulVO,omitempty"` IcsCertFiledShow string `json:"icsCertFiledShow,omitempty"` MicrosoftVulVO string `json:"microsoftVulVO,omitempty"` MicrosoftFiledShow string `json:"microsoftFiledShow,omitempty"` HuaweiVulVO string `json:"huaweiVulVO,omitempty"` HuaweiFiledShow string `json:"huaweiFiledShow,omitempty"` NvdVulVO string `json:"nvdVulVO,omitempty"` NvdFiledShow string `json:"nvdFiledShow,omitempty"` Varchar1 string `json:"varchar1,omitempty"` }
CNNVDDetail CNNVD详情
type HazardLevel ¶
type HazardLevel struct { DictLabel string `json:"dictLabel,omitempty" gorm:"uniqueIndex size:256"` DictValue string `json:"dictValue,omitempty"` }
HazardLevel 产品列表
type Product ¶
type Product struct { Label string `json:"label,omitempty" gorm:"uniqueIndex size:256"` Value string `json:"value,omitempty"` }
Product 产品列表
type Record ¶
type Record struct { Id string `json:"id,omitempty"` VulName string `json:"vulName,omitempty"` CnnvdCode string `json:"cnnvdCode,omitempty"` CveCode string `json:"cveCode,omitempty"` HazardLevel int64 `json:"hazardLevel,omitempty"` CreateTime string `json:"createTime,omitempty"` PublishTime string `json:"publishTime,omitempty"` UpdateTime string `json:"updateTime,omitempty"` TypeName string `json:"typeName,omitempty"` VulType string `json:"vulType,omitempty"` }
Record 漏洞列表记录
type ReqHazardLevel ¶
type ReqHazardLevel struct { }
ReqHazardLevel 威胁等级请求参数
func (*ReqHazardLevel) Fetch ¶
func (r *ReqHazardLevel) Fetch() (*[]HazardLevel, error)
func (*ReqHazardLevel) Name ¶
func (r *ReqHazardLevel) Name() string
func (*ReqHazardLevel) Save ¶
func (r *ReqHazardLevel) Save(data *[]HazardLevel, dir string) error
func (*ReqHazardLevel) StoreByFile ¶
func (r *ReqHazardLevel) StoreByFile(db *gorm.DB, dir string) error
func (*ReqHazardLevel) StoreByRequest ¶
func (r *ReqHazardLevel) StoreByRequest(db *gorm.DB) error
type ReqProduct ¶
type ReqProduct struct {
ProductKeyword string `json:"productKeyword"` // 产品关键词
}
ReqProduct 产品选择列表请求参数
func (*ReqProduct) Fetch ¶
func (r *ReqProduct) Fetch() (*[]Product, error)
func (*ReqProduct) Name ¶
func (r *ReqProduct) Name() string
func (*ReqProduct) StoreByFile ¶
func (r *ReqProduct) StoreByFile(db *gorm.DB, dir string) error
func (*ReqProduct) StoreByRequest ¶
func (r *ReqProduct) StoreByRequest(db *gorm.DB) error
type ReqVendor ¶
type ReqVendor struct {
VendorKeyword string `json:"vendorKeyword"` // 供应商关键词
}
ReqVendor 供应商选择列表请求参数
type ReqVulDetail ¶
type ReqVulDetail struct { Id string `json:"id"` // 漏洞id VulType string `json:"vulType"` // 漏洞类型 CnnvdCode string `json:"cnnvdCode"` // cnnvd编号 }
ReqVulDetail cnnvd漏洞详情请求参数
func (*ReqVulDetail) Fetch ¶
func (r *ReqVulDetail) Fetch() (*VulDetail, error)
func (*ReqVulDetail) Name ¶
func (r *ReqVulDetail) Name() string
func (*ReqVulDetail) StoreByFile ¶
func (r *ReqVulDetail) StoreByFile(db *gorm.DB, dir string) error
func (*ReqVulDetail) StoreByRequest ¶
func (r *ReqVulDetail) StoreByRequest(db *gorm.DB) error
type ReqVulList ¶
type ReqVulList struct { PageIndex int `json:"pageIndex"` // 分页索引 PageSize int `json:"pageSize"` // 分页大小 Keyword string `json:"keyword"` // 关键字 HazardLevel string `json:"hazardLevel"` // 漏洞等级 VulType string `json:"vulType"` // 漏洞类型 Vendor string `json:"vendor"` // 供应商 Product string `json:"product"` // 产品 DateType string `json:"dateType"` // 数据类型 }
ReqVulList cnnvd漏洞列表请求参数
func NewReqVulList ¶
func NewReqVulList(keyword string) *ReqVulList
func (*ReqVulList) Fetch ¶
func (r *ReqVulList) Fetch() (*[]Record, error)
func (*ReqVulList) GetLatestCNNVD ¶
func (r *ReqVulList) GetLatestCNNVD(pageSize int) (string, error)
GetLatestCNNVD 获取最新的漏洞编号
func (*ReqVulList) Name ¶
func (r *ReqVulList) Name() string
func (*ReqVulList) StoreByFile ¶
func (r *ReqVulList) StoreByFile(db *gorm.DB, dir string) error
func (*ReqVulList) StoreByRequest ¶
func (r *ReqVulList) StoreByRequest(db *gorm.DB) error
type ReqVulType ¶
type ReqVulType struct { }
ReqVulType 漏洞类型列表请求参数
func (*ReqVulType) Fetch ¶
func (r *ReqVulType) Fetch() (*[]VulType, error)
func (*ReqVulType) Name ¶
func (r *ReqVulType) Name() string
func (*ReqVulType) StoreByFile ¶
func (r *ReqVulType) StoreByFile(db *gorm.DB, dir string) error
func (*ReqVulType) StoreByRequest ¶
func (r *ReqVulType) StoreByRequest(db *gorm.DB) error
type ResCode ¶
type ResCode struct { Code int `json:"code,omitempty"` // 代码 Success bool `json:"success,omitempty"` // 是否成功 Message string `json:"message,omitempty"` // 消息 Time string `json:"time,omitempty"` // 时间 }
ResCode 响应码
type ResHazardLevel ¶
type ResHazardLevel struct { ResCode // 响应码 Data []HazardLevel `json:"data,omitempty"` // 威胁等级列表 }
ResHazardLevel 威胁等级响应参数
type ResProduct ¶
ResProduct 产品选择列表响应参数
type ResVulDetail ¶
ResVulDetail cnnvd漏洞详情响应参数
type ResVulList ¶
ResVulList 供应商选择列表响应参数
type ResVulType ¶
ResVulType 漏洞类型列表响应参数
type TableHazardLevel ¶
type TableHazardLevel struct { gorm.Model HazardLevel }
func (*TableHazardLevel) TableName ¶
func (t *TableHazardLevel) TableName() string
type TableProduct ¶
func (*TableProduct) TableName ¶
func (t *TableProduct) TableName() string
type TableVendor ¶
func (*TableVendor) TableName ¶
func (v *TableVendor) TableName() string
type TableVulDetail ¶
func (*TableVulDetail) TableName ¶
func (t *TableVulDetail) TableName() string
TableName 为Record绑定表名
type TableVulList ¶
func (*TableVulList) TableName ¶
func (l *TableVulList) TableName() string
type TableVulType ¶
type TableVulType struct { gorm.Model Id string `json:"id,omitempty"` Pid string `json:"pid,omitempty"` Label string `json:"label,omitempty"` }
func (*TableVulType) TableName ¶
func (t *TableVulType) TableName() string
type Vendor ¶
type Vendor struct { Label string `json:"label,omitempty" gorm:"uniqueIndex size:256"` Value string `json:"value,omitempty"` }
Vendor 供应商选择列表
type VulDetail ¶
type VulDetail struct { CNNVDDetail `json:"cnnvdDetail,omitempty"` // CNNVD详情 ReceviceVulDetail string `json:"receviceVulDetail,omitempty"` // 接收到的漏洞详情 }
VulDetail 漏洞详情数据
Click to show internal directories.
Click to hide internal directories.