varsapi

package
v0.0.0-...-3d1ce1f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAffected

func AddAffected(db *sql.DB, vid, sid int64) error

AddAffected adds a new vulnerability/system pair to the affected table

func AddCve

func AddCve(db *sql.DB, vid int64, cve string) error

AddCve adds the given cve to the impact table for vulnid

func AddEmployee

func AddEmployee(db *sql.DB, emp *vars.Employee) error

AddEmployee inserts a new employee into the database.

func AddNote

func AddNote(db *sql.DB, vid, eid int64, note string) error

AddNote inserts a new note into the database.

func AddRef

func AddRef(db *sql.DB, vid int64, ref string) error

AddRef adds the given reference to the ref table for vulnid.

func AddSystem

func AddSystem(db *sql.DB, sys *vars.System) error

AddSystem adds a new system to the database.

func AddTicket

func AddTicket(db *sql.DB, vid int64, ticket string) error

AddTicket adds the given ticket to the ticket table for vulnid

func AddVulnerability

func AddVulnerability(db *sql.DB, vuln *vars.Vulnerability) error

AddVulnerability starts a new VA

func CloseDB

func CloseDB(db *sql.DB)

CloseDB is a way to close connections to the database safely

func CloseVulnerability

func CloseVulnerability(db *sql.DB, vid int64) error

CloseVulnerability sets the 'mitigated' date equal to the date parameter for the given vulnid.

func ConnectDB

func ConnectDB() (*sql.DB, error)

ConnectDB gets the VARS config object and calls the VARS function to set up the database connection.

func CreateEmployee

func CreateEmployee(firstname, lastname, email, username string, level int) *vars.Employee

CreateEmployee creates an employee object with the given parameters.

func CreateSystem

func CreateSystem(name, tp, opsys, loc, desc, state string) *vars.System

CreateSystem creates a system object with the given parameters.

func CreateVulnerability

func CreateVulnerability(name, summary, cvssLink, test, mitigation, exploit string, exploitable bool, cvss, corpscore float32) *vars.Vulnerability

CreateVulnerability creates a vulnerability object with the given parameters.

func DeleteAffected

func DeleteAffected(db *sql.DB, vid, sid int64) error

DeleteAffected deletes the row (vid, sid) from affected.

func DeleteCve

func DeleteCve(db *sql.DB, vid int64, cve string) error

DeleteCve will delete the row (vulnid, cve).

func DeleteEmployee

func DeleteEmployee(db *sql.DB, eid int64) error

DeleteEmployee will change the username of the row with empid to 'removed'.

func DeleteNote

func DeleteNote(db *sql.DB, nid int64) error

DeleteNote deletes the note with the given noteid.

func DeleteRef

func DeleteRef(db *sql.DB, vid int64, ref string) error

DeleteRef will delete the row in the ref table associated with (vid, ref).

func DeleteSystem

func DeleteSystem(db *sql.DB, sid int64) error

DeleteSystem will delete the row in the sys table associated with sid.

func DeleteTicket

func DeleteTicket(db *sql.DB, vid int64, ticket string) error

DeleteTicket will delete the row (vulnid, ticket).

func DeleteVulnerability

func DeleteVulnerability(db *sql.DB, vid int64) error

DeleteVulnerability will delete the vulnerability with the given vulnid from VARS.

func GetClosedVulnerabilities

func GetClosedVulnerabilities() ([]*vars.Vulnerability, error)

GetClosedVulnerabilities builds/returns a slice of pointers to Vulnerabilities that have a non-NULL 'mitigated' date.

func GetConfig

func GetConfig() vars.Config

GetConfig retrieves/returns the Config object that was created in VARS.

func GetCves

func GetCves(vid int64) (*[]string, error)

GetCves returns a pointer to a slice of cves associated with the vulnid.

func GetEmployeeByID

func GetEmployeeByID(eid int64) (*vars.Employee, error)

GetEmployeeByID returns an Employee object with the given empid.

func GetEmployeeByUsername

func GetEmployeeByUsername(username string) (*vars.Employee, error)

GetEmployeeByUsername returns an Employee object with the given username.

func GetEmployees

func GetEmployees() ([]*vars.Employee, error)

GetEmployees returns a slice of pointers to Employee objects.

func GetNoteAuthor

func GetNoteAuthor(noteid int64) (int64, error)

GetNoteAuthor returns the empid of the author of the note.

func GetNotes

func GetNotes(vid int64) ([]*vars.Note, error)

GetNotes retrieves/returns a slice of pointers to all note objects for the given vulnid.

func GetOpenVulnerabilities

func GetOpenVulnerabilities() ([]*vars.Vulnerability, error)

GetOpenVulnerabilities builds/returns a slice of pointers to Vulnerabilities that have a NULL 'mitigated' date.

func GetSystem

func GetSystem(sid int64) (*vars.System, error)

GetSystem retrieves/returns the system with the given id.

func GetSystemByName

func GetSystemByName(name string) (*vars.System, error)

GetSystemByName retrieves/returns the system with the given name.

func GetSystems

func GetSystems() ([]*vars.System, error)

GetSystems retrieves/returns a slice of pointers to all System objects.

func GetSystemsByState

func GetSystemsByState(state string) ([]*vars.System, error)

GetSystemsByState retrieves/returns the systems with the given state.

func GetVarsNullBool

func GetVarsNullBool(b bool) vars.VarsNullBool

GetVarsNullBool creates/returns a VarsNullBool object using the given boolean paramter.

func GetVarsNullString

func GetVarsNullString(str string) vars.VarsNullString

GetVarsNullString creates/returns a VarsNullString object using the given string paramter.

func GetVarsNullTime

func GetVarsNullTime(t time.Time) vars.VarsNullTime

GetVarsNullTime creates/returns a VarsNullTime object using the given time paramter.

func GetVulnID

func GetVulnID(vname string) (int64, error)

GetVulnID returns the vulnid associated with the vname.

func GetVulnerabilities

func GetVulnerabilities() ([]*vars.Vulnerability, error)

GetVulnerabilities retrieves/returns all vulnerabilities.

func GetVulnerability

func GetVulnerability(vid int64) (*vars.Vulnerability, error)

GetVulnerability retrieves/returns the vulnerability with the given id.

func GetVulnerabilityByName

func GetVulnerabilityByName(name string) (*vars.Vulnerability, error)

GetVulnerabilityByName retrieves/returns the vulnerability with the given name.

func IsNameNotAvailableError

func IsNameNotAvailableError(err error) bool

IsNameNotAvailableError returns true if the error is caused by name not being available

func IsNilErr

func IsNilErr(err error) bool

IsNilErr returns true if the error is nil, false otherwise.

func IsNoRowsError

func IsNoRowsError(err error) bool

IsNoRowsError returns true if the error is caused by no rows being effected

func ReadConfig

func ReadConfig(config string) error

ReadConfig passes the config string to vars.ReadConfig to create the Config object.

func ReopenVulnerability

func ReopenVulnerability(db *sql.DB, vid int64) error

ReopenVulnerability sets the 'mitigated' date to a null date for the given vulnid.

func UpdateAffected

func UpdateAffected(db *sql.DB, vid, sid int64, mit bool) error

UpdateAffected will update the mitigated status of the row (vid, sid).

func UpdateCorpScore

func UpdateCorpScore(db *sql.DB, vid int64, corpscore float32) error

UpdateCorpscore will update the corpscore associated with the given vulnid.

func UpdateCve

func UpdateCve(db *sql.DB, vid int64, oldcve, newcve string) error

UpdateCve will update the CVE associated with the row (vid, cve).

func UpdateCves

func UpdateCves(tx *sql.Tx, old, vuln *vars.Vulnerability) error

UpdateCves determines the rows that need to be deleted/added and calls the appropriate VARS function.

func UpdateCvss

func UpdateCvss(db *sql.DB, vid int64, cvss float32, link string) error

UpdateCvss will update the cvss score and link if they have been changed.

func UpdateEmployee

func UpdateEmployee(db *sql.DB, emp *vars.Employee) error

UpdateEmployee will update the row in the emp table with the new employee information.

func UpdateEmployeeEmail

func UpdateEmployeeEmail(db *sql.DB, eid int64, email string) error

UpdateEmployeeEmail will update the email associated with the given empid.

func UpdateEmployeeLevel

func UpdateEmployeeLevel(db *sql.DB, eid int64, level int) error

UpdateEmployeeLevel will update the level associated with the given empid.

func UpdateEmployeeName

func UpdateEmployeeName(db *sql.DB, eid int64, fname, lname string) error

UpdateEmployeeName will update the first/last name associated with the given empid.

func UpdateEmployeeUsername

func UpdateEmployeeUsername(db *sql.DB, eid int64, username string) error

UpdateEmployeeUsername will update the username associated with the given empid.

func UpdateExploit

func UpdateExploit(db *sql.DB, vid int64, exploit string) error

UpdateExploit will update the exploit associated with vulnid.

func UpdateExploitable

func UpdateExploitable(db *sql.DB, vid int64, exploitable bool) error

UpdateExploitable will update the exploitable boolean associated with vulnid.

func UpdateFinder

func UpdateFinder(db *sql.DB, vid, eid int64) error

UpdateFinder will update the finder's empid associated with the vulnid

func UpdateNote

func UpdateNote(db *sql.DB, noteid int64, note string) error

UpdateNote will update the note with the given noteid.

func UpdateReference

func UpdateReference(db *sql.DB, vid int64, oldRef, newRef string) error

UpdateReference will update the reference associated with row (vid, oldRef) to newRef.

func UpdateReferences

func UpdateReferences(tx *sql.Tx, old, vuln *vars.Vulnerability) error

UpdateReferences determines the rows that need to be deleted/added and calls the appropriate VARS function.

func UpdateSystem

func UpdateSystem(db *sql.DB, sys *vars.System) error

UpdateSystem updates the edited parts of the system

func UpdateSystemDescription

func UpdateSystemDescription(db *sql.DB, sid int64, desc string) error

UpdateSystemDescription updates the description of the given system.

func UpdateSystemLocation

func UpdateSystemLocation(db *sql.DB, sid int64, loc string) error

UpdateSystemLocation updates the location of the given system.

func UpdateSystemName

func UpdateSystemName(db *sql.DB, sid int64, name string) error

UpdateSystemName updates the name associated with the sysid.

func UpdateSystemOS

func UpdateSystemOS(db *sql.DB, sid int64, opsys string) error

UpdateSystemOS updates the operating system of the given system.

func UpdateSystemState

func UpdateSystemState(db *sql.DB, sid int64, state string) error

UpdateSystemState sets the state of the given system to 'state'.

func UpdateSystemType

func UpdateSystemType(db *sql.DB, sid int64, tp string) error

UpdateSystemType updates the type of system.

func UpdateTicket

func UpdateTicket(db *sql.DB, vid int64, oldticket, newticket string) error

UpdateTicket will update the ticket associated with the row (vid, ticket).

func UpdateTickets

func UpdateTickets(tx *sql.Tx, old, vuln *vars.Vulnerability) error

UpdateTickets determines the rows that need to be deleted/added and calls the appropriate VARS function.

func UpdateVulnerability

func UpdateVulnerability(db *sql.DB, vuln *vars.Vulnerability) error

UpdateVulnerability updates the edited parts of the vulnerability

func UpdateVulnerabilityMitigation

func UpdateVulnerabilityMitigation(db *sql.DB, vid int64, mitigation string) error

UpdateVulnerabilityMitigation will update the mitigation associated with the given vulnid.

func UpdateVulnerabilityName

func UpdateVulnerabilityName(db *sql.DB, vid int64, name string) error

UpdateVulnerabilityName updates the name associated with the given vulnid.

func UpdateVulnerabilitySummary

func UpdateVulnerabilitySummary(db *sql.DB, vid int64, summary string) error

UpdateVulnerabilitySummary updates the summary associated with the given vulnid.

func UpdateVulnerabilityTest

func UpdateVulnerabilityTest(db *sql.DB, vid int64, test string) error

UpdateVulnerabilityTest will update the test associated with the given vulnid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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