nessie

package module
v0.0.0-...-9831ccc Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 20 Imported by: 0

README

Build Status GoDoc

Nessie

Tenable Nessus 6 API client in Go.

Usage

Have a look at the client example for how to start a scan, wait until it finishes and exports the results to a CSV file.

Status

Here are the resources accessible via the official API and their current implementation status in this client:

  • AgentGroups
    • Add agent
    • Add agents
    • Configure
    • Create
    • Delete group
    • Delete groups
    • Delete agent
    • Delete agents
    • List groups ✓
  • Editor
    • Details
    • Edit
    • List policy templates ✓
    • List scan templates ✓
    • Plugin description
  • File
    • Upload ✓
  • Folders ✓
    • Create ✓
    • Delete ✓
    • Edit ✓
    • List ✓
  • Groups
    • Add user
    • Create ✓
    • Delete
    • Delete user
    • Edit
    • List ✓
    • List users
  • Permissions
    • Change
    • List ✓
  • Plugins ✓
    • Families ✓
    • Family details ✓
    • Plugin details ✓
  • Plugin rules
    • Create
    • Delete
    • Edit
    • List
  • Policies
    • Configure ✓
    • Copy
    • Create ✓
    • Delete ✓
    • Details
    • Import
    • Export
    • List ✓
  • Scanners ✓
    • List ✓
  • Scans
    • Configure ✓
    • Create ✓
    • Delete ✓
    • Delete history
    • Details ✓
    • Download ✓
    • Export ✓
    • Export status ✓
    • Host details
    • Import
    • Launch ✓
    • List ✓
    • Pause ✓
    • Plugin output
    • Read status
    • Resume ✓
    • Stop ✓
    • Timezones ✓
  • Server ✓
    • Properties ✓
    • Status ✓
  • Sessions
    • Create ✓
    • Destroy ✓
    • Edit
    • Get ✓
    • Password
  • Users ✓
    • Create ✓
    • Delete ✓
    • Edit ✓
    • List ✓
    • Password ✓

Some methods are not part of the API but are implemented by this client to make life easier:

  • Get all plugin details

Documentation

Overview

Package nessie implements a client for the Tenable Nessus 6 API.

Index

Constants

View Source
const (
	UserTypeLocal = "local"
	UserTypeLDAP  = "ldap"

	Permissions0   = "0"
	Permissions16  = "16"
	Permissions32  = "32"
	Permissions64  = "64"
	Permissions128 = "128"
)
View Source
const (
	LaunchOnDemand = "ON_DEMAND"
	LaunchDaily    = "DAILY"
	LaunchWeekly   = "WEEKLY"
	LaunchMonthly  = "MONTHLY"
	LaunchYearly   = "YEARLY"
)
View Source
const (
	ExportNessus = "nessus"
	ExportPDF    = "pdf"
	ExportHTML   = "html"
	ExportCSV    = "csv"
	ExportDB     = "db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Acl

type Acl struct {
	Permissions int         `json:"permissions"`
	Owner       interface{} `json:"owner"`
	DisplayName interface{} `json:"display_name"`
	Name        interface{} `json:"name"`
	ID          interface{} `json:"id"`
	Type        string      `json:"type"`
}

type Acls

type Acls struct {
	ObjectType  string `json:"object_type"`
	Permissions int    `json:"permissions"`
	Type        string `json:"type"`
	DisplayName string `json:"display_name,omitempty"`
	Name        string `json:"name,omitempty"`
	Owner       int    `json:"owner,omitempty"`
	ID          int    `json:"id,omitempty"`
}

type AgentGroup

type AgentGroup struct {
	ID                   int64  `json:"id"`
	Name                 string `json:"name"`
	OwnerID              int64  `json:"owner_id"`
	Owner                string `json:"owner"`
	Shared               int    `json:"shared"`
	UserPerms            int64  `json:"user_permissions"`
	CreationDate         int64  `json:"creation_date"`
	LastModificationDate int64  `json:"last_modification_date"`
}

AgentGroup The details of an agent group.

type AuditCustomItem

type AuditCustomItem struct {
	Category string `json:"category"`
	File     string `json:"file"`
}

AuditCustomItem custom audit item

type Capability

type Capability struct {
	ScanVulnerabilityGroups      bool `json:"scan_vulnerability_groups"`
	ReportEmailConfig            bool `json:"report_email_config"`
	ScanVulnerabilityGroupsMixed bool `json:"scan_vulnerability_groups_mixed"`
}

type Chapter

type Chapter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Control

type Control struct {
	ReadableRegex string   `json:"readable_regex"`
	Prefix        string   `json:"prefix"`
	Type          string   `json:"type"`
	Regex         string   `json:"regex"`
	List          []string `json:"list"`
	OOptions      []string `json:"options"`
}

type CreatePolicyRequest

type CreatePolicyRequest struct {
	UUID     string         `json:"uuid"`
	Audits   PolicyAudits   `json:"audits"`
	Settings PolicySettings `json:"settings"`
}

CreatePolicyRequest Policies are created by sending the below fields.

type CreatePolicyResp

type CreatePolicyResp struct {
	PolicyID   int64  `json:"policy_id"`
	PolicyName string `json:"policy_name"`
}

CreatePolicyResp response body If successful

type CredentialItem

type CredentialItem struct {
	Types         []Type `json:"types"`
	Name          string `json:"name"`
	DefaultExpand int    `json:"default_expand"`
}

type Credentials

type Credentials struct {
	Data []CredentialItem `json:"data"`
}

type DetailColumn

type DetailColumn struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

type Export

type Export struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ExportFormat

type ExportFormat struct {
	Custom []interface{} `json:"custom"`
	Export []Export      `json:"export"`
	Format []Format      `json:"format"`
}

type FamilyDetails

type FamilyDetails struct {
	Name    string   `json:"name"`
	ID      int64    `json:"id"`
	Plugins []Plugin `json:"plugins"`
}

type FamilyInfo

type FamilyInfo struct {
	Count  int    `json:"count"`
	ID     int    `json:"id"`
	Status string `json:"status"`
}

type Feature

type Feature struct {
	Policies     bool `json:"policies"`
	Report       bool `json:"report"`
	RemoteLink   bool `json:"remote_link"`
	Cluster      bool `json:"cluster"`
	Users        bool `json:"users"`
	PluginRules  bool `json:"plugin_rules"`
	API          bool `json:"api"`
	ScanAPI      bool `json:"scan_api"`
	Folders      bool `json:"folders"`
	LocalScanner bool `json:"local_scanner"`
	Logs         bool `json:"logs"`
	SMTP         bool `json:"smtp"`
}

type Filter

type Filter struct {
	Operators    []string `json:"operators"`
	Control      Control  `json:"control,omitempty"`
	Name         string   `json:"name"`
	ReadableName string   `json:"readable_name"`
}

type FilterAttribute

type FilterAttribute struct {
	Operators    []string `json:"operators"`
	Control      Control  `json:"control,omitempty"`
	Name         string   `json:"name"`
	ReadableName string   `json:"readable_name"`
}

type Folder

type Folder struct {
	UnreadCount int    `json:"unread_count"`
	Custom      int    `json:"custom"`
	DefaultTag  int    `json:"default_tag"`
	Type        string `json:"type"`
	Name        string `json:"name"`
	ID          int    `json:"id"`
}

type Format

type Format struct {
	Name     string    `json:"name"`
	Chapters []Chapter `json:"chapters,omitempty"`
	Value    string    `json:"value"`
}

type Group

type Group struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Permissions int64  `json:"permissions"`
	UserCount   int64  `json:"user_count"`
}

type GroupItem

type GroupItem struct {
	Title string `json:"title"`
	Name  string `json:"name"`
	ACLs  []Acl  `json:"acls"`
}

type History

type History struct {
	AltTargetsUsed       bool        `json:"alt_targets_used"`
	Scheduler            int         `json:"scheduler"`
	NodeName             interface{} `json:"node_name"`
	NodeHost             interface{} `json:"node_host"`
	ScanGroup            interface{} `json:"scan_group"`
	NodeID               interface{} `json:"node_id"`
	ScheduleType         string      `json:"schedule_type"`
	Status               string      `json:"status"`
	Type                 string      `json:"type"`
	UUID                 string      `json:"uuid"`
	LastModificationDate int         `json:"last_modification_date"`
	CreationDate         int         `json:"creation_date"`
	OwnerID              int         `json:"owner_id"`
	HistoryID            int         `json:"history_id"`
}

type Host

type Host struct {
	TotalChecksConsidered int `json:"totalchecksconsidered"`
	NumChecksConsidered   int `json:"numchecksconsidered"`
	ScanProgressTotal     int `json:"scanprogresstotal"`
	ScanProgressCurrent   int `json:"scanprogresscurrent"`
	HostIndex             int `json:"host_index"`
	Score                 int `json:"score"`
	SeverityCount         struct {
		Item []struct {
			Count         int `json:"count"`
			SeverityLevel int `json:"severitylevel"`
		} `json:"item"`
	} `json:"severitycount"`
	Progress        string `json:"progress"`
	OfflineCritical int    `json:"offline_critical"`
	OfflineHigh     int    `json:"offline_high"`
	OfflineMedium   int    `json:"offline_medium"`
	OfflineLow      int    `json:"offline_low"`
	OfflineInfo     int    `json:"offline_info"`
	Critical        int    `json:"critical"`
	High            int    `json:"high"`
	Medium          int    `json:"medium"`
	Low             int    `json:"low"`
	Info            int    `json:"info"`
	Severity        int    `json:"severity"`
	HostID          int    `json:"host_id"`
	Hostname        string `json:"hostname"`
}

type HostCompliance

type HostCompliance struct {
	HostID       int64  `json:"host_id"`
	Hostname     string `json:"hostname"`
	PluginID     int64  `json:"plugin_id"`
	PluginName   string `json:"plugin_name"`
	PluginFamily string `json:"plugin_family"`
	Count        int64  `json:"count"`
	SeverityIdx  int64  `json:"severity_index"`
	Severity     int64  `json:"severity"`
}

type HostInfo

type HostInfo struct {
	HostStart       string `json:"host_start"`
	HostEnd         string `json:"host_end"`
	NetbiosName     string `json:"netbios-name"`
	OperatingSystem string `json:"operating-system"`
	HostIP          string `json:"host-ip"`
}

type HostScanDetailsResp

type HostScanDetailsResp struct {
	Vulnerabilities []Vulnerability `json:"vulnerabilities"`
	Compliance      []interface{}   `json:"compliance"`
	Info            HostInfo        `json:"info"`
}

type HostVulnerability

type HostVulnerability struct {
	HostID       int64  `json:"host_id"`
	Hostname     string `json:"hostname"`
	PluginID     int64  `json:"plugin_id"`
	PluginName   string `json:"plugin_name"`
	PluginFamily string `json:"plugin_family"`
	Count        int64  `json:"count"`
	VulnIdx      int64  `json:"vuln_index"`
	SeverityIdx  int64  `json:"severity_index"`
	Severity     int64  `json:"severity"`
}

type HostsDetailInfo

type HostsDetailInfo struct {
	Ports           []int       `json:"ports"`
	OperatingSystem interface{} `json:"operating_system"`
	HostFqdn        interface{} `json:"host_fqdn"`
	Hostname        string      `json:"hostname"`
	HostIP          string      `json:"host_ip"`
	ID              int         `json:"id"`
}

type Input

type Input struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Type          string   `json:"type"`
	Hint          string   `json:"hint,omitempty"`
	Required      bool     `json:"required"`
	Default       string   `json:"default,omitempty"`
	Label         string   `json:"label"`
	Options       []string `json:"options,omitempty"`
	OptionsLabels []string `json:"optionsLabels,omitempty"`
}

type Installer

type Installer struct {
}

type License

type License struct {
	Features       Feature `json:"features"`
	Type           string  `json:"type"`
	ExpirationDate int     `json:"expiration_date"`
	Ips            int64   `json:"ips"`
	Restricted     bool    `json:"restricted"`
	Agents         int     `json:"agents"`
	Mode           int     `json:"mode"`
	Scanners       int     `json:"scanners"`
	ScannersUsed   int     `json:"scanners_used"`
	AgentsUsed     int     `json:"agents_used"`
	Name           string  `json:"name"`
}

type LicenseInfo

type LicenseInfo struct {
	Trimmed interface{} `json:"trimmed"`
	Limit   int64       `json:"limit"`
}

type ListScansResponse

type ListScansResponse struct {
	Folders   []Folder `json:"folders"`
	Scans     []Scan   `json:"scans"`
	Timestamp int64    `json:"timestamp"`
}

type Mode

type Mode struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Type    string `json:"type"`
	Default string `json:"default"`
	Options []struct {
		Desc string `json:"desc"`
		Name string `json:"name"`
	} `json:"options"`
}

type Nessus

type Nessus interface {
	SetVerbose(bool)
	AuthCookie() string
	SetApiKeys(apiKeys string)
	Request(method string, resource string, js interface{}, wantStatus []int) (resp *http.Response, err error)
	Login(username, password string) error
	Logout() error
	Session() (Session, error)

	ServerProperties() (*ServerProperties, error)
	ServerStatus() (*ServerStatus, error)

	CreateUser(username, password, userType, permissions, name, email string) (*User, error)
	ListUsers() ([]User, error)
	DeleteUser(userID int) error
	SetUserPassword(userID int, password string) error
	EditUser(userID int, permissions, name, email string) (*User, error)

	PluginFamilies() ([]PluginFamily, error)
	FamilyDetails(ID int64) (*FamilyDetails, error)
	PluginDetails(ID int64) (*PluginDetails, error)
	AllPlugins() (chan PluginDetails, error)

	Scanners() ([]Scanner, error)
	Policies() ([]Policy, error)
	CreatePolicy(policySettings CreatePolicyRequest) (CreatePolicyResp, error)
	ConfigurePolicy(id int64, policySettings CreatePolicyRequest) error
	DeletePolicy(id int64) error

	Upload(filePath string) error
	AgentGroups() ([]AgentGroup, error)

	NewScan(editorTmplUUID, settingsName string, outputFolderID, policyID, scannerID int64, launch string, targets []string) (*Scan, error)
	CreateScan(newScanRequest NewScanRequest) (*Scan, error)
	Scans() (*ListScansResponse, error)
	ScanTemplates() ([]Template, error)
	PolicyTemplates() ([]Template, error)
	StartScan(scanID int64) (string, error)
	PauseScan(scanID int64) error
	ResumeScan(scanID int64) error
	StopScan(scanID int64) error
	DeleteScan(scanID int64) error
	ScanDetails(scanID int64, args url.Values) (*ScanDetailsResp, error)
	HostScanDetails(scanID int64, hostID int64, args url.Values) (*HostScanDetailsResp, error)
	ScanPluginOutput(scanID int64, hostID int64, pluginID int64) (*ScanPluginOutput, error)
	ScanKbInfo(scanID int64, hostID int64) (*ScanHostKbInfo, error)
	ConfigureScan(scanID int64, scanSetting NewScanRequest) (*Scan, error)

	Timezones() ([]TimeZone, error)

	Folders() ([]Folder, error)
	CreateFolder(name string) error
	EditFolder(folderID int64, newName string) error
	DeleteFolder(folderID int64) error

	ExportScan(scanID int64, format string) (int64, error)
	ExportFinished(scanID, exportID int64) (bool, error)
	DownloadExport(scanID, exportID int64) ([]byte, error)

	Permissions(objectType string, objectID int64) ([]Permission, error)
}

Nessus exposes the resources offered via the Tenable Nessus RESTful API.

func NewFingerprintedNessus

func NewFingerprintedNessus(apiURL string, certFingerprints []string) (Nessus, error)

NewFingerprintedNessus will return a nessus instance which verifies the api server's certificate by its SHA256 fingerprint (on the RawSubjectPublicKeyInfo and base64 encoded) against a whitelist of good certFingerprints. Fingerprint verification will enable InsecureSkipVerify.

func NewInsecureNessus

func NewInsecureNessus(apiURL string) (Nessus, error)

NewInsecureNessus will return a nessus instance which does not check for the api certificate validity, do not use in production environment.

func NewNessus

func NewNessus(apiURL, caCertPath string) (Nessus, error)

NewNessus will return a new Nessus instance, if caCertPath is empty, the host certificate roots will be used to check for the validity of the nessus server API certificate.

type NewScanRequest

type NewScanRequest struct {
	UUID     string              `json:"uuid"`
	Settings ScanSettingsRequest `json:"settings"`
}

type Note

type Note struct {
	Title    string `json:"title"`
	Message  string `json:"message"`
	Severity int64  `json:"severity"`
}

type Permission

type Permission struct {
	Owner       int64  `json:"owner"`
	Type        string `json:"type"`
	Permissions int64  `json:"permissions"`
	ID          int64  `json:"id"`
	Name        string `json:"name"`
}

type Plugin

type Plugin struct {
	ID       int64                 `json:"id"`
	Name     string                `json:"name"`
	ReadOnly bool                  `json:"readOnly"`
	Families map[string]FamilyInfo `json:"families"`
}

type PluginAttr

type PluginAttr struct {
	Name string `json:"attribute_name"`
	Val  string `json:"attribute_value"`
}

type PluginAttribute

type PluginAttribute struct {
	ScriptCopyright   string            `json:"script_copyright"`
	Synopsis          string            `json:"synopsis"`
	Description       string            `json:"description"`
	RiskInformation   RiskInformation   `json:"risk_information"`
	PluginName        string            `json:"plugin_name"`
	FName             string            `json:"fname"`
	Dependency        string            `json:"dependency"`
	PluginInformation PluginInformation `json:"plugin_information"`
	Solution          string            `json:"solution"`
}

type PluginDescription

type PluginDescription struct {
	Severity         int             `json:"severity"`
	PluginName       string          `json:"pluginname"`
	PluginAttributes PluginAttribute `json:"pluginattributes"`
	PluginFamily     string          `json:"pluginfamily"`
	PluginID         string          `json:"pluginid"`
}

type PluginDetails

type PluginDetails struct {
	Plugin
	FamilyName string       `json:"family_name"`
	Attrs      []PluginAttr `json:"attributes"`
}

type PluginFamilies

type PluginFamilies struct {
	Families []PluginFamily `json:"families"`
}

type PluginFamily

type PluginFamily struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Count int64  `json:"count"`
}

type PluginInformation

type PluginInformation struct {
	PluginVersion          string `json:"plugin_version"`
	PluginID               int    `json:"plugin_id"`
	PluginType             string `json:"plugin_type"`
	PluginPublicationDate  string `json:"plugin_publication_date"`
	PluginFamily           string `json:"plugin_family"`
	PluginModificationDate string `json:"plugin_modification_date"`
}

type PluginOutput

type PluginOutput struct {
	Ports         map[string]interface{} `json:"ports,omitempty"`
	HasAttachment interface{}            `json:"has_attachment"`
	Hosts         interface{}            `json:"hosts"`
	Severity      int                    `json:"severity"`
	PluginOutput  string                 `json:"plugin_output"`
}

type Policy

type Policy struct {
	IsScap               int         `json:"is_scap"`
	HasCredentials       int         `json:"has_credentials"`
	NoTarget             string      `json:"no_target"`
	PluginFilters        interface{} `json:"plugin_filters"`
	TemplateUUID         string      `json:"template_uuid"`
	Description          string      `json:"description"`
	Name                 string      `json:"name"`
	Owner                string      `json:"owner"`
	Visibility           string      `json:"visibility"`
	Shared               int         `json:"shared"`
	UserPermissions      int         `json:"user_permissions"`
	LastModificationDate int         `json:"last_modification_date"`
	CreationDate         int         `json:"creation_date"`
	OwnerID              int         `json:"owner_id"`
	ID                   int         `json:"id"`
}

type PolicyAudits

type PolicyAudits struct {
	Custom interface{} `json:"custom"`
	Feed   interface{} `json:"feed"`
}

type PolicyDetail

type PolicyDetail struct {
	Credentials      Credentials       `json:"credentials"`
	UserPermissions  int               `json:"user_permissions"`
	Owner            string            `json:"owner"`
	Title            string            `json:"title"`
	IsAgent          bool              `json:"is_agent"`
	UUID             string            `json:"uuid"`
	DynamicScan      bool              `json:"dynamic_scan"`
	Plugins          Plugin            `json:"plugins"`
	FilterAttributes []FilterAttribute `json:"filter_attributes"`
	Migrated         interface{}       `json:"migrated"`
	Settings         Settings          `json:"settings"`
	Name             string            `json:"name"`
}

type PolicySettings

type PolicySettings struct {
	UnixfileanalysisDisableXdev       string `json:"unixfileanalysis_disable_xdev"`
	UnixfileanalysisIncludePaths      string `json:"unixfileanalysis_include_paths"`
	UnixfileanalysisExcludePaths      string `json:"unixfileanalysis_exclude_paths"`
	UnixfileanalysisFileExtensions    string `json:"unixfileanalysis_file_extensions"`
	UnixfileanalysisMaxSize           string `json:"unixfileanalysis_max_size"`
	UnixfileanalysisMaxCumulativeSize string `json:"unixfileanalysis_max_cumulative_size"`
	UnixfileanalysisMaxDepth          string `json:"unixfileanalysis_max_depth"`
	StaggeredStartMins                string `json:"staggered_start_mins"`
	LogWholeAttack                    string `json:"log_whole_attack"`
	EnablePluginDebugging             string `json:"enable_plugin_debugging"`
	AuditTrail                        string `json:"audit_trail"`
	IncludeKb                         string `json:"include_kb"`
	EnablePluginList                  string `json:"enable_plugin_list"`
	AllowPostScanEditing              string `json:"allow_post_scan_editing"`
	WmiNetstatScanner                 string `json:"wmi_netstat_scanner"`
	SSHNetstatScanner                 string `json:"ssh_netstat_scanner"`
	Acls                              []Acls `json:"acls"`
	Name                              string `json:"name"`
	Description                       string `json:"description"`
}

type PolicyTemplate

type PolicyTemplate struct {
	Unsupported      bool   `json:"unsupported"`
	LicenseFulfilled int    `json:"license_fulfilled"`
	Desc             string `json:"desc"`
	Order            int    `json:"order"`
	SubscriptionOnly bool   `json:"subscription_only"`
	Title            string `json:"title"`
	IsAgent          bool   `json:"is_agent"`
	UUID             string `json:"uuid"`
	DynamicScan      bool   `json:"dynamic_scan"`
	Icon             string `json:"icon"`
	ManagerOnly      bool   `json:"manager_only"`
	Category         string `json:"category"`
	Name             string `json:"name"`
	MoreInfo         string `json:"more_info,omitempty"`
}

type Remediation

type Remediation struct {
	Remediation       interface{} `json:"remediations"`
	NumHosts          int         `json:"num_hosts"`
	NumCVEs           int         `json:"num_cves"`
	NumImpactedHosts  int         `json:"num_impacted_hosts"`
	NumRemediatedCVEs int         `json:"num_remediated_cves"`
	Value             string      `json:"value"`
	NumVulns          string      `json:"vulns"`
}

type ReportOption

type ReportOption struct {
	CsvColumns            []SectionItem `json:"csvColumns"`
	VulnerabilitySections []SectionItem `json:"vulnerabilitySections"`
	HostSections          []SectionItem `json:"hostSections"`
	FormattingOptions     []SectionItem `json:"formattingOptions"`
}

type RestartPending

type RestartPending struct {
	Reason interface{} `json:"reason"`
	Type   interface{} `json:"type"`
}

type RiskInformation

type RiskInformation struct {
	RiskFactor string `json:"risk_factor"`
}

type Rule

type Rule struct {
	ID       int64  `json:"id"`
	PluginID int64  `json:"plugin_id"`
	Date     string `json:"date"`
	Host     string `json:"host"`
	Type     string `json:"type"`
	Owner    string `json:"owner"`
	OwnerID  int64  `json:"owner_id"`
}

type Scan

type Scan struct {
	ID                        int64       `json:"id"`
	UUID                      string      `json:"uuid"`
	Name                      string      `json:"name"`
	Owner                     string      `json:"owner"`
	Shared                    int         `json:"shared"`
	UserPermissions           int64       `json:"user_permissions"`
	CreationDate              int64       `json:"creation_date"`
	LastModificationDate      int64       `json:"last_modification_date"`
	StartTime                 string      `json:"starttime"`
	TimeZone                  string      `json:"timezone"`
	RRules                    string      `json:"rrules"`
	ContainerID               int         `json:"container_id"`
	Description               string      `json:"description"`
	PolicyID                  int         `json:"policy_id"`
	ScannerID                 int         `json:"scanner_id"`
	Emails                    string      `json:"emails"`
	AttachReport              int         `json:"attach_report"`
	AttachedReportMaximumSize int         `json:"attached_report_maximum_size"`
	AttachedReportType        interface{} `json:"attached_report_type"`
	Sms                       interface{} `json:"sms"`
	Enabled                   int         `json:"enabled"`
	UseDashboard              int         `json:"use_dashboard"`
	DashboardFile             interface{} `json:"dashboard_file"`
	LiveResults               int         `json:"live_results"`
	ScanTimeWindow            int         `json:"scan_time_window"`
	CustomTargets             string      `json:"custom_targets"`
	Migrated                  int         `json:"migrated"`
	LastScheduledRun          string      `json:"last_scheduled_run"`
	NotificationFilters       interface{} `json:"notification_filters"`
	TagID                     int         `json:"tag_id"`
	DefaultPermissions        int         `json:"default_permissions"`
	OwnerID                   int         `json:"owner_id"`
	Type                      string      `json:"type"`
}

Scan resource.

type ScanDetailsResp

type ScanDetailsResp struct {
	Info            ScanInfo          `json:"info"`
	HostsDetailInfo []HostsDetailInfo `json:"hosts_detail_info"`
	Compliance      []interface{}     `json:"compliance"`
	Filters         []Filter          `json:"filters"`
	CompHosts       []interface{}     `json:"comphosts"`
	History         []History         `json:"history"`
	Notes           interface{}       `json:"notes"`
	Hosts           []Host            `json:"hosts"`
	Remediation     Remediation       `json:"remediations"`
	Vulnerabilities []Vulnerability   `json:"vulnerabilities"`
}

type ScanHostKbInfo

type ScanHostKbInfo struct {
	Content string
}

type ScanHostKbPrepareResp

type ScanHostKbPrepareResp struct {
	Token string `json:"token"`
}

type ScanInfo

type ScanInfo struct {
	ACLs               []Acl       `json:"acls"`
	EditAllowed        bool        `json:"edit_allowed"`
	AltTargetsUsed     bool        `json:"alt_targets_used"`
	Status             string      `json:"status"`
	ScannerStart       int         `json:"scanner_start"`
	Policy             string      `json:"policy"`
	ScanGroup          interface{} `json:"scan_group"`
	PciCanUpload       bool        `json:"pci-can-upload"`
	ScanStart          int         `json:"scan_start"`
	HasAuditTrail      bool        `json:"hasaudittrail"`
	UserPermissions    int         `json:"user_permissions"`
	FolderID           int         `json:"folder_id"`
	NodeName           interface{} `json:"node_name"`
	NoTarget           bool        `json:"no_target"`
	NodeHost           interface{} `json:"node_host"`
	NodeID             interface{} `json:"node_id"`
	Targets            string      `json:"targets"`
	Control            bool        `json:"control"`
	Timestamp          int         `json:"timestamp"`
	Offline            bool        `json:"offline"`
	ObjectID           int         `json:"object_id"`
	ScannerName        string      `json:"scanner_name"`
	UUID               string      `json:"uuid"`
	HasKb              bool        `json:"haskb"`
	ScannerEnd         int         `json:"scanner_end"`
	PolicyTemplateUUID string      `json:"policy_template_uuid"`
	HostCount          int         `json:"hostcount"`
	ScanEnd            int         `json:"scan_end"`
	ScanType           string      `json:"scan_type"`
	LicenseInfo        LicenseInfo `json:"license_info"`
	Migrated           int         `json:"migrated"`
	Name               string      `json:"name"`
}

type ScanLaunchResponse

type ScanLaunchResponse struct {
	ScanUUID string `json:"scan_uuid"`
}

type ScanPluginOutput

type ScanPluginOutput struct {
	Outputs []PluginOutput `json:"outputs"`
	Info    struct {
		PluginDescription PluginDescription `json:"plugindescription"`
	} `json:"info"`
}

type ScanSettingsRequest

type ScanSettingsRequest struct {
	Acls           []Acls        `json:"acls"`
	Emails         string        `json:"emails"`
	FilterType     string        `json:"filter_type"`
	Filters        []interface{} `json:"filters"`
	Launch         string        `json:"launch"`
	LaunchNow      bool          `json:"launch_now"`
	Enabled        bool          `json:"enabled"`
	UseDashboard   string        `json:"use_dashboard"`
	Name           string        `json:"name"`
	Description    string        `json:"description"`
	FolderID       int64         `json:"folder_id"`
	ScannerID      int64         `json:"scanner_id"`
	AgentGroupID   []string      `json:"agent_group_id"`
	ScanTimeWindow int64         `json:"scan_time_window"`
	PolicyID       int64         `json:"policy_id"`
	TextTargets    string        `json:"text_targets"`
	FileTargets    string        `json:"file_targets"`
	RRules         string        `json:"rrules"`
	TimeZone       string        `json:"timezone"`
	StartTime      string        `json:"starttime"`
}

type Scanner

type Scanner struct {
	Challenge            string      `json:"challenge"`
	License              License     `json:"license"`
	NumScans             interface{} `json:"num_scans"`
	AwsAvailabilityZone  interface{} `json:"aws_availability_zone"`
	AwsUpdateInterval    interface{} `json:"aws_update_interval"`
	NeedsRestart         interface{} `json:"needs_restart"`
	LastConnect          interface{} `json:"last_connect"`
	Loadavg              interface{} `json:"loadavg"`
	NumTCPSessions       interface{} `json:"num_tcp_sessions"`
	NumHosts             interface{} `json:"num_hosts"`
	NumSessions          interface{} `json:"num_sessions"`
	RegistrationCode     interface{} `json:"registration_code"`
	ExpirationTime       interface{} `json:"expiration_time"`
	Expiration           int         `json:"expiration"`
	LoadedPluginSet      interface{} `json:"loaded_plugin_set"`
	Platform             string      `json:"platform"`
	UIBuild              string      `json:"ui_build"`
	UIVersion            string      `json:"ui_version"`
	EngineBuild          string      `json:"engine_build"`
	EngineVersion        string      `json:"engine_version"`
	Status               string      `json:"status"`
	ScanCount            int         `json:"scan_count"`
	Linked               int         `json:"linked"`
	Key                  string      `json:"key"`
	Type                 string      `json:"type"`
	Name                 string      `json:"name"`
	UUID                 string      `json:"uuid"`
	Token                interface{} `json:"token"`
	OwnerName            string      `json:"owner_name"`
	Owner                string      `json:"owner"`
	Shared               int         `json:"shared"`
	UserPermissions      int         `json:"user_permissions"`
	Timestamp            int         `json:"timestamp"`
	LastModificationDate int         `json:"last_modification_date"`
	CreationDate         int         `json:"creation_date"`
	OwnerID              int         `json:"owner_id"`
	ID                   int         `json:"id"`
}

type Section

type Section struct {
	Inputs []Input `json:"inputs"`
	Title  string  `json:"title"`
	Name   string  `json:"name"`
}

type SectionItem

type SectionItem struct {
	Name          string         `json:"name"`
	Key           string         `json:"key"`
	IsDefault     bool           `json:"isDefault"`
	DetailColumns []DetailColumn `json:"detailColumns,omitempty"`
}

type ServerProperties

type ServerProperties struct {
	ServerProperty
}

ServerProperties is the structure returned by the ServerProperties() method.

type ServerProperty

type ServerProperty struct {
	Installers                      Installer      `json:"installers"`
	LoadedPluginSet                 interface{}    `json:"loaded_plugin_set"`
	Features                        Feature        `json:"features"`
	ServerUUID                      string         `json:"server_uuid"`
	UsersCount                      int            `json:"users_count"`
	TemplateVersion                 string         `json:"template_version"`
	Update                          Update         `json:"update"`
	RestartPending                  RestartPending `json:"restart_pending"`
	NessusUIVersion                 string         `json:"nessus_ui_version"`
	NessusType                      string         `json:"nessus_type"`
	License                         License        `json:"license"`
	TenableLinks                    []TenableLink  `json:"tenable_links"`
	FeedError                       int            `json:"feed_error"`
	RestartNeeded                   interface{}    `json:"restart_needed"`
	ServerBuild                     string         `json:"server_build"`
	ShowNpv7WhatsNew                int            `json:"show_npv7_whats_new"`
	Npv7DowngradeAvailable          int            `json:"npv7_downgrade_available"`
	Capabilities                    Capability     `json:"capabilities"`
	PluginSet                       interface{}    `json:"plugin_set"`
	UsedIPCount                     int            `json:"used_ip_count"`
	IdleTimeout                     string         `json:"idle_timeout"`
	NessusUIBuild                   string         `json:"nessus_ui_build"`
	Npv7UpgradeRequired             bool           `json:"npv7_upgrade_required"`
	ScannerBootTime                 int            `json:"scanner_boottime"`
	DisableRssWidget                interface{}    `json:"disable_rss_widget"`
	Npv7                            int            `json:"npv7"`
	LoginBanner                     interface{}    `json:"login_banner"`
	TemplateVersionUpgradeNecessary interface{}    `json:"template_version_upgrade_necessary"`
	Npv7UpgradeNotification         int            `json:"npv7_upgrade_notification"`
	Platform                        string         `json:"platform"`
	ServerVersion                   string         `json:"server_version"`
}

type ServerStatus

type ServerStatus struct {
	Status             string `json:"status"`
	Progress           int64  `json:"progress"`
	MustDestroySession bool
}

ServerStatus is the stucture returned by the ServerStatus() method.

type Session

type Session struct {
	ID          int64    `json:"id"`
	Username    string   `json:"username"`
	Email       string   `json:"email"`
	Name        string   `json:"name"`
	Type        string   `json:"type"`
	Perms       int64    `json:"permissions"`
	LastLogin   int64    `json:"last_login"`
	ContainerID int64    `json:"container_id"`
	Groups      []string `json:"groups"`
}

type Setting

type Setting struct {
	Inputs   []Input   `json:"inputs"`
	Modes    Mode      `json:"modes"`
	Title    string    `json:"title"`
	Name     string    `json:"name"`
	Groups   []Setting `json:"groups"`
	Sections []Section `json:"sections"`
}

type Settings

type Settings map[string]Setting

basic, assessment, advanced, discovery, report

type Template

type Template struct {
	// The uuid for the template.
	UUID string `json:"uuid"`
	// The short name of the template.
	Name string `json:"name"`
	// The long name of the template.
	Title string `json:"title"`
	// The description of the template.
	Desc string `json:"description"`
	// If true, template is only available on the cloud.
	CloudOnly bool `json:"cloud_only"`
	// If true, the template is only available for subscribers.
	SubscriptionOnly bool `json:"subscription_only"`
	// If true, the template is for agent scans.
	IsAgent bool `json:"is_agent"`
	// An external URL to link the template to.
	MoreInfo string `json:"more_info"`
}

Template is used to create scans or policies with predefined parameters.

type TemplateDisplayGroup

type TemplateDisplayGroup struct {
	Name     string   `json:"name"`
	Title    string   `json:"title"`
	Inputs   []string `json:"inputs"`
	Sections []string `json:"sections"`
}

type TemplateFormInput

type TemplateFormInput struct {
	ID      string   `json:"id"`
	Type    string   `json:"type"`
	Label   string   `json:"label"`
	Default string   `json:"default"`
	Options []string `json:"options"`
}

type TemplateMode

type TemplateMode struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Desc string `json:"desc"`
}

type TemplatePluginFamily

type TemplatePluginFamily struct {
	ID     int64  `json:"id"`
	Count  int64  `json:"count"`
	Status string `json:"status"`
}

type TemplateSection

type TemplateSection struct {
	Name   string   `json:"name"`
	Title  string   `json:"title"`
	Inputs []string `json:"inputs"`
}
type TenableLink struct {
	SelectedIcon string `json:"selected_icon"`
	Title        string `json:"title"`
	Icon         string `json:"icon"`
	Link         string `json:"link"`
}

type TimeZone

type TimeZone struct {
	Name string `json:"name"`
	Val  string `json:"value"`
}

type Type

type Type struct {
	Inputs    []Input       `json:"inputs"`
	Max       int           `json:"max"`
	Name      string        `json:"name"`
	Instances []interface{} `json:"instances"`
	Settings  interface{}   `json:"settings"`
}

type Update

type Update struct {
	Href       interface{} `json:"href"`
	NewVersion int         `json:"new_version"`
	Restart    int         `json:"restart"`
}

type User

type User struct {
	LastLogin   int     `json:"lastlogin"`
	Permissions int     `json:"permissions"`
	Type        string  `json:"type"`
	Name        string  `json:"name"`
	Email       *string `json:"email"`
	Username    string  `json:"username"`
	ID          int     `json:"id"`
}

type Vulnerability

type Vulnerability struct {
	Count         int         `json:"count"`
	VulnIndex     interface{} `json:"vuln_index"`
	PluginName    string      `json:"plugin_name"`
	Severity      int         `json:"severity"`
	PluginID      int         `json:"plugin_id"`
	SeverityIndex int         `json:"severity_index"`
	Cpe           interface{} `json:"cpe"`
	Offline       bool        `json:"offline"`
	PluginFamily  string      `json:"plugin_family"`
	Snoozed       int         `json:"snoozed"`
	HostID        int         `json:"host_id"`
}

Directories

Path Synopsis
Package main implements a test client that starts a scan, wait until it finishes and exports its results to a csv file.
Package main implements a test client that starts a scan, wait until it finishes and exports its results to a csv file.

Jump to

Keyboard shortcuts

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