Documentation ¶
Index ¶
- Constants
- Variables
- func AddPlugin(plugin Plugin) bool
- func AddResult(result Result) bool
- func AddTask(task *Task) bool
- func AddVulnerability(vul Vulnerability) bool
- func AddWebapp(app Webapp) bool
- func DeletePlugin(id int) bool
- func DeleteResult(id int) bool
- func DeleteTask(id int) bool
- func DeleteVulnerability(id int) bool
- func DeleteWebapp(id int) bool
- func DownTask(id int) bool
- func EditPlugin(id int, plugin Plugin) bool
- func EditVulnerability(id int, vul Vulnerability) bool
- func EditWebapp(id int, app Webapp) bool
- func ErrorTask(id int) bool
- func ExistPluginByID(id int) bool
- func ExistPluginByVulId(vul_id string) bool
- func ExistResultByID(id int) bool
- func ExistTaskByID(id int) bool
- func ExistVulnerabilityByID(id int) bool
- func ExistVulnerabilityByNameZh(name_zh string) bool
- func ExistWebappById(id int) bool
- func ExistWebappByName(name string) bool
- func GenPluginVulId() (string, error)
- func GetPluginsTotal(field *PluginSearchField) (total int64)
- func GetResultTotal(field *ResultSearchField) (total int64)
- func GetTaskTotal(field *TaskSearchField) (total int64)
- func GetVulnerabilitiesTotal(field *VulnerabilitySearchField) (total int64)
- func GetWebappsTotal(field *WebappSearchField) (total int64)
- func ResetPassword(id int, newpassword string)
- func Setup()
- type Auth
- type Plugin
- type PluginSearchField
- type Result
- type ResultSearchField
- type Task
- type TaskSearchField
- type Vulnerability
- type VulnerabilitySearchField
- type Webapp
- type WebappSearchField
Constants ¶
View Source
const TaskStatusDown = "down"
View Source
const TaskStatusError = "error"
View Source
const TaskStatusRunning = "running"
Variables ¶
View Source
var GlobalDB *gorm.DB
Functions ¶
func AddVulnerability ¶
func AddVulnerability(vul Vulnerability) bool
func DeletePlugin ¶
func DeleteResult ¶
func DeleteTask ¶
func DeleteVulnerability ¶
func DeleteWebapp ¶
func EditPlugin ¶
func EditVulnerability ¶
func EditVulnerability(id int, vul Vulnerability) bool
func EditWebapp ¶
func ExistPluginByID ¶
func ExistPluginByVulId ¶
func ExistResultByID ¶
func ExistTaskByID ¶
func ExistVulnerabilityByID ¶
func ExistWebappById ¶
func ExistWebappByName ¶
func GenPluginVulId ¶
func GetPluginsTotal ¶
func GetPluginsTotal(field *PluginSearchField) (total int64)
func GetResultTotal ¶
func GetResultTotal(field *ResultSearchField) (total int64)
func GetTaskTotal ¶
func GetTaskTotal(field *TaskSearchField) (total int64)
func GetVulnerabilitiesTotal ¶
func GetVulnerabilitiesTotal(field *VulnerabilitySearchField) (total int64)
func GetWebappsTotal ¶
func GetWebappsTotal(field *WebappSearchField) (total int64)
Types ¶
type Auth ¶
type Plugin ¶
type Plugin struct { Id int `gorm:"primary_key" json:"id"` VulId string `gorm:"column:vul_id" json:"vul_id"` Affects string `gorm:"column:affects" json:"affects" binding:"required"` JsonPoc datatypes.JSON `gorm:"column:json_poc" json:"json_poc"` Enable bool `gorm:"column:enable" json:"enable"` Desc int `gorm:"column:description" json:"description"` Vulnerability *Vulnerability `gorm:"foreignkey:Desc"` }
func GetPlugins ¶
func GetPlugins(page int, pageSize int, field *PluginSearchField) (plugins []Plugin)
type PluginSearchField ¶
type Result ¶
type Result struct { //gorm.Model Id int `gorm:"primary_key" json:"id"` Vul bool `gorm:"column:vul" json:"vul"` Detail datatypes.JSON `gorm:"column:detail" json:"detail"` PluginId string `gorm:"plugin_id" json:"plugin_id"` PluginName string `gorm:"plugin_name" json:"plugin_name"` TaskId int `gorm:"task_id" json:"task_id"` }
type ResultSearchField ¶
type Task ¶
type Task struct { //gorm.Model Id int `gorm:"primary_key" json:"id"` Remarks string `gorm:"column:remarks" json:"remarks"` Target string `gorm:"type:longtext" json:"target"` Operator string `gorm:"type:string" json:"operator"` Status string `gorm:"type:string" json:"status"` Results []Result `gorm:"foreignKey:TaskId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"results"` }
type TaskSearchField ¶
type TaskSearchField struct {
Search string
}
type Vulnerability ¶
type Vulnerability struct { gorm.Model Id int `gorm:"primary_key" json:"id"` NameZh string `gorm:"column:name_zh" json:"name_zh" binding:"required"` Cve string `gorm:"column:cve" json:"cve"` Cnnvd string `gorm:"column:cnnvd" json:"cnnvd"` Severity string `gorm:"column:severity" json:"severity"` Category string `gorm:"column:category" json:"category"` Description string `gorm:"type:longtext" json:"description"` Suggestion string `gorm:"type:longtext" json:"suggestion"` Language string `gorm:"column:language" json:"language"` Webapp int `gorm:"column:webapp" json:"webapp"` ForeignWebapp *Webapp `gorm:"foreignKey:Webapp"` }
func GetVulnerabilities ¶
func GetVulnerabilities(page int, pageSize int, field *VulnerabilitySearchField) (vuls []Vulnerability)
func GetVulnerability ¶
func GetVulnerability(id int) (vul Vulnerability)
type Webapp ¶
type Webapp struct { Id int `gorm:"primary_key" json:"id"` Name string `gorm:"column:name" json:"name" binding:"required"` Provider string `gorm:"column:provider" json:"provider"` Remarks string `gorm:"column:remarks" json:"remarks"` }
func GetWebapps ¶
func GetWebapps(page int, pageSize int, field *WebappSearchField) (apps []Webapp)
type WebappSearchField ¶
type WebappSearchField struct {
Search string
}
Click to show internal directories.
Click to hide internal directories.