Documentation
¶
Index ¶
- func AddAffected(db *sql.DB, vid, sid int64) error
- func AddCve(db *sql.DB, vid int64, cve string) error
- func AddEmployee(db *sql.DB, emp *vars.Employee) error
- func AddNote(db *sql.DB, vid, eid int64, note string) error
- func AddRef(db *sql.DB, vid int64, ref string) error
- func AddSystem(db *sql.DB, sys *vars.System) error
- func AddTicket(db *sql.DB, vid int64, ticket string) error
- func AddVulnerability(db *sql.DB, vuln *vars.Vulnerability) error
- func CloseDB(db *sql.DB)
- func CloseVulnerability(db *sql.DB, vid int64) error
- func ConnectDB() (*sql.DB, error)
- func CreateEmployee(firstname, lastname, email, username string, level int) *vars.Employee
- func CreateSystem(name, tp, opsys, loc, desc, state string) *vars.System
- func CreateVulnerability(name, summary, cvssLink, test, mitigation, exploit string, exploitable bool, ...) *vars.Vulnerability
- func DeleteAffected(db *sql.DB, vid, sid int64) error
- func DeleteCve(db *sql.DB, vid int64, cve string) error
- func DeleteEmployee(db *sql.DB, eid int64) error
- func DeleteNote(db *sql.DB, nid int64) error
- func DeleteRef(db *sql.DB, vid int64, ref string) error
- func DeleteSystem(db *sql.DB, sid int64) error
- func DeleteTicket(db *sql.DB, vid int64, ticket string) error
- func DeleteVulnerability(db *sql.DB, vid int64) error
- func GetClosedVulnerabilities() ([]*vars.Vulnerability, error)
- func GetConfig() vars.Config
- func GetCves(vid int64) (*[]string, error)
- func GetEmployeeByID(eid int64) (*vars.Employee, error)
- func GetEmployeeByUsername(username string) (*vars.Employee, error)
- func GetEmployees() ([]*vars.Employee, error)
- func GetNoteAuthor(noteid int64) (int64, error)
- func GetNotes(vid int64) ([]*vars.Note, error)
- func GetOpenVulnerabilities() ([]*vars.Vulnerability, error)
- func GetSystem(sid int64) (*vars.System, error)
- func GetSystemByName(name string) (*vars.System, error)
- func GetSystems() ([]*vars.System, error)
- func GetSystemsByState(state string) ([]*vars.System, error)
- func GetVarsNullBool(b bool) vars.VarsNullBool
- func GetVarsNullString(str string) vars.VarsNullString
- func GetVarsNullTime(t time.Time) vars.VarsNullTime
- func GetVulnID(vname string) (int64, error)
- func GetVulnerabilities() ([]*vars.Vulnerability, error)
- func GetVulnerability(vid int64) (*vars.Vulnerability, error)
- func GetVulnerabilityByName(name string) (*vars.Vulnerability, error)
- func IsNameNotAvailableError(err error) bool
- func IsNilErr(err error) bool
- func IsNoRowsError(err error) bool
- func ReadConfig(config string) error
- func ReopenVulnerability(db *sql.DB, vid int64) error
- func UpdateAffected(db *sql.DB, vid, sid int64, mit bool) error
- func UpdateCorpScore(db *sql.DB, vid int64, corpscore float32) error
- func UpdateCve(db *sql.DB, vid int64, oldcve, newcve string) error
- func UpdateCves(tx *sql.Tx, old, vuln *vars.Vulnerability) error
- func UpdateCvss(db *sql.DB, vid int64, cvss float32, link string) error
- func UpdateEmployee(db *sql.DB, emp *vars.Employee) error
- func UpdateEmployeeEmail(db *sql.DB, eid int64, email string) error
- func UpdateEmployeeLevel(db *sql.DB, eid int64, level int) error
- func UpdateEmployeeName(db *sql.DB, eid int64, fname, lname string) error
- func UpdateEmployeeUsername(db *sql.DB, eid int64, username string) error
- func UpdateExploit(db *sql.DB, vid int64, exploit string) error
- func UpdateExploitable(db *sql.DB, vid int64, exploitable bool) error
- func UpdateFinder(db *sql.DB, vid, eid int64) error
- func UpdateNote(db *sql.DB, noteid int64, note string) error
- func UpdateReference(db *sql.DB, vid int64, oldRef, newRef string) error
- func UpdateReferences(tx *sql.Tx, old, vuln *vars.Vulnerability) error
- func UpdateSystem(db *sql.DB, sys *vars.System) error
- func UpdateSystemDescription(db *sql.DB, sid int64, desc string) error
- func UpdateSystemLocation(db *sql.DB, sid int64, loc string) error
- func UpdateSystemName(db *sql.DB, sid int64, name string) error
- func UpdateSystemOS(db *sql.DB, sid int64, opsys string) error
- func UpdateSystemState(db *sql.DB, sid int64, state string) error
- func UpdateSystemType(db *sql.DB, sid int64, tp string) error
- func UpdateTicket(db *sql.DB, vid int64, oldticket, newticket string) error
- func UpdateTickets(tx *sql.Tx, old, vuln *vars.Vulnerability) error
- func UpdateVulnerability(db *sql.DB, vuln *vars.Vulnerability) error
- func UpdateVulnerabilityMitigation(db *sql.DB, vid int64, mitigation string) error
- func UpdateVulnerabilityName(db *sql.DB, vid int64, name string) error
- func UpdateVulnerabilitySummary(db *sql.DB, vid int64, summary string) error
- func UpdateVulnerabilityTest(db *sql.DB, vid int64, test string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAffected ¶
AddAffected adds a new vulnerability/system pair to the affected table
func AddEmployee ¶
AddEmployee inserts a new employee into the database.
func AddVulnerability ¶
func AddVulnerability(db *sql.DB, vuln *vars.Vulnerability) error
AddVulnerability starts a new VA
func CloseVulnerability ¶
CloseVulnerability sets the 'mitigated' date equal to the date parameter for the given vulnid.
func ConnectDB ¶
ConnectDB gets the VARS config object and calls the VARS function to set up the database connection.
func CreateEmployee ¶
CreateEmployee creates an employee object with the given parameters.
func CreateSystem ¶
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 ¶
DeleteAffected deletes the row (vid, sid) from affected.
func DeleteEmployee ¶
DeleteEmployee will change the username of the row with empid to 'removed'.
func DeleteNote ¶
DeleteNote deletes the note with the given noteid.
func DeleteSystem ¶
DeleteSystem will delete the row in the sys table associated with sid.
func DeleteTicket ¶
DeleteTicket will delete the row (vulnid, ticket).
func DeleteVulnerability ¶
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 GetEmployeeByID ¶
GetEmployeeByID returns an Employee object with the given empid.
func GetEmployeeByUsername ¶
GetEmployeeByUsername returns an Employee object with the given username.
func GetEmployees ¶
GetEmployees returns a slice of pointers to Employee objects.
func GetNoteAuthor ¶
GetNoteAuthor returns the empid of the author of the note.
func GetNotes ¶
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 GetSystemByName ¶
GetSystemByName retrieves/returns the system with the given name.
func GetSystems ¶
GetSystems retrieves/returns a slice of pointers to all System objects.
func GetSystemsByState ¶
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 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 ¶
IsNameNotAvailableError returns true if the error is caused by name not being available
func IsNoRowsError ¶
IsNoRowsError returns true if the error is caused by no rows being effected
func ReadConfig ¶
ReadConfig passes the config string to vars.ReadConfig to create the Config object.
func ReopenVulnerability ¶
ReopenVulnerability sets the 'mitigated' date to a null date for the given vulnid.
func UpdateAffected ¶
UpdateAffected will update the mitigated status of the row (vid, sid).
func UpdateCorpScore ¶
UpdateCorpscore will update the corpscore associated with the given vulnid.
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 ¶
UpdateCvss will update the cvss score and link if they have been changed.
func UpdateEmployee ¶
UpdateEmployee will update the row in the emp table with the new employee information.
func UpdateEmployeeEmail ¶
UpdateEmployeeEmail will update the email associated with the given empid.
func UpdateEmployeeLevel ¶
UpdateEmployeeLevel will update the level associated with the given empid.
func UpdateEmployeeName ¶
UpdateEmployeeName will update the first/last name associated with the given empid.
func UpdateEmployeeUsername ¶
UpdateEmployeeUsername will update the username associated with the given empid.
func UpdateExploit ¶
UpdateExploit will update the exploit associated with vulnid.
func UpdateExploitable ¶
UpdateExploitable will update the exploitable boolean associated with vulnid.
func UpdateFinder ¶
UpdateFinder will update the finder's empid associated with the vulnid
func UpdateNote ¶
UpdateNote will update the note with the given noteid.
func UpdateReference ¶
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 ¶
UpdateSystem updates the edited parts of the system
func UpdateSystemDescription ¶
UpdateSystemDescription updates the description of the given system.
func UpdateSystemLocation ¶
UpdateSystemLocation updates the location of the given system.
func UpdateSystemName ¶
UpdateSystemName updates the name associated with the sysid.
func UpdateSystemOS ¶
UpdateSystemOS updates the operating system of the given system.
func UpdateSystemState ¶
UpdateSystemState sets the state of the given system to 'state'.
func UpdateSystemType ¶
UpdateSystemType updates the type of system.
func UpdateTicket ¶
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 ¶
UpdateVulnerabilityMitigation will update the mitigation associated with the given vulnid.
func UpdateVulnerabilityName ¶
UpdateVulnerabilityName updates the name associated with the given vulnid.
func UpdateVulnerabilitySummary ¶
UpdateVulnerabilitySummary updates the summary associated with the given vulnid.
Types ¶
This section is empty.