nessusAPI

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package nessusAPI implements Tenable's Nessus 6 product API.

The tests for the package should be used as examples, and include the session creation as well as the actual method to make copy and paste usage easier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Distro      string `json:"distro"`
	ID          int    `json:"id"`
	IP          string `json:"ip"`
	LastScanned string `json:"last_scanned"`
	Name        string `json:"name"`
	Platform    string `json:"platform"`
	Token       string `json:"token"`
	UUID        string `json:"uuid"`
}

Agent is an indvidual Agent resource

type Agents

type Agents struct {
	Agents []Agent `json:"agents"`
}

Agents lists agents known to the Nessus server

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents the API client which is used to interact with the Nessus API. It supports either Username/Password or Access/Secret key pairs.

func NewAccessTokenClient

func NewAccessTokenClient(host, port, accessKey, secretKey string, debug bool) *Client

NewAccessTokenClient creates a new Nessus API Client structure using a combination of access key and secret key. Please note you must call NewSession after creating a client to initialize the connection.

func NewUsernameClient

func NewUsernameClient(host, port, username, password string, debug bool) *Client

NewUsernameClient creates a new Nessus API Client structure using a combination of username and password. Please note you must call NewSession after creating a client to initialize the connection.

func (*Client) ChangeMailSettings

func (c *Client) ChangeMailSettings(httpClient *http.Client, updatedMailSettings string) (bool, error)

ChangeMailSettings changes the permissions for an object. Allowed objectType values are "policy", "scan", "scanner", "agent-group", "scanner-pool", and "connector". It requires an http.Client pointer to make the request to Nessus.

func (*Client) ChangePassword

func (c *Client) ChangePassword(httpClient *http.Client, newPassword string) (bool, error)

ChangePassword changes password for the current user. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ChangePermissions

func (c *Client) ChangePermissions(httpClient *http.Client, objectType string, objectID int, updatedPermissions string) (bool, error)

ChangePermissions changes the permissions for an object. Allowed objectType values are "policy", "scan", "scanner", "agent-group", "scanner-pool", and "connector". It requires an http.Client pointer to make the request to Nessus.

func (*Client) ChangeProxy

func (c *Client) ChangeProxy(httpClient *http.Client, changeJSON string) (bool, error)

ChangeProxy changes the proxy settings. It requires an http.Client pointer to make the request to Nessus. It also requires the JSON object that will be used to submit the change as a string argument.

func (*Client) ConfigurePolicy

func (c *Client) ConfigurePolicy(httpClient *http.Client, policyID int, configurationJSON string) (bool, error)

ConfigurePolicy changes the parameters of a policy. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ConfigureScan

func (c *Client) ConfigureScan(httpClient *http.Client, scanID int, configureScanJSON string) (CreateScanResponse, error)

ConfigureScan changes the schedule or policy parameters of a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) CopyPolicy

func (c *Client) CopyPolicy(httpClient *http.Client, policyID int) (CopyPolicyResponse, error)

CopyPolicy copies a policy. It requires an http.Client pointer to make the request to Nessus.

func (*Client) CopyScan

func (c *Client) CopyScan(httpClient *http.Client, scanID int, copyScanJSON string) (Scan, error)

CopyScan copies a given scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) CreatePluginRule

func (c *Client) CreatePluginRule(httpClient *http.Client, pluginRuleJSON string) (bool, error)

CreatePluginRule creates a new plugin rule for the current user. It requires an http.Client pointer to make the request to Nessus.

func (*Client) CreatePolicy

func (c *Client) CreatePolicy(httpClient *http.Client, policyJSON string) (CreatePolicyResponse, error)

CreatePolicy creates a policy. It requires an http.Client pointer to make the request to Nessus.

func (*Client) CreateScan

func (c *Client) CreateScan(httpClient *http.Client, newScanJSON string) (CreateScanResponse, error)

CreateScan creates a new scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) CreateSession

func (c *Client) CreateSession(httpClient *http.Client) (*Client, error)

CreateSession creates a new session token for the given user/password within Client. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DeleteAgent

func (c *Client) DeleteAgent(httpClient *http.Client, scannerID, agentID int) (bool, error)

DeleteAgent deletes an agent. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DeletePluginRule

func (c *Client) DeletePluginRule(httpClient *http.Client, ruleID int) (bool, error)

DeletePluginRule deletes a plugin rule. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DeletePolicy

func (c *Client) DeletePolicy(httpClient *http.Client, policyID int) (bool, error)

DeletePolicy deletes a policy. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DeleteScan

func (c *Client) DeleteScan(httpClient *http.Client, scanID int) (bool, error)

DeleteScan deletes a scan. NOTE: Scans in running, paused or stopping states can not be deleted. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DeleteScanHistory

func (c *Client) DeleteScanHistory(httpClient *http.Client, scanID, historyID int) (bool, error)

DeleteScanHistory deletes historical results from a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DestroySession

func (c *Client) DestroySession(httpClient *http.Client) (bool, error)

DestroySession logs the current user out and destroys the session. It requires an http.Client pointer to make the request to Nessus.

func (*Client) DownloadScan

func (c *Client) DownloadScan(httpClient *http.Client, scanID, fileID int) (string, error)

DownloadScan downloads an exported scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) EditPluginRule

func (c *Client) EditPluginRule(httpClient *http.Client, ruleID int, editJSON string) (bool, error)

EditPluginRule modifies a plugin rule for the current user. It requires an http.Client pointer to make the request to Nessus.

func (*Client) EditSession

func (c *Client) EditSession(httpClient *http.Client, updateJSON string) (SessionInfo, error)

EditSession changes settings for the current user. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ExportPolicy

func (c *Client) ExportPolicy(httpClient *http.Client, policyID int) (string, error)

ExportPolicy exports the given policy in nessus (XML) format. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ExportScan

func (c *Client) ExportScan(httpClient *http.Client, scanID int, exportSettingsJSON string) (ExportedScan, error)

ExportScan exports the given scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) GenerateAPIKeys

func (c *Client) GenerateAPIKeys(httpClient *http.Client) (NewAPIKeys, error)

GenerateAPIKeys generates API Keys for the current user. It requires an http.Client pointer to make the request to Nessus.

func (*Client) GetSession

func (c *Client) GetSession(httpClient *http.Client) (SessionInfo, error)

GetSession returns the user session data. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ImportPolicy

func (c *Client) ImportPolicy(httpClient *http.Client, file string) (PolicyResponse, error)

ImportPolicy imports an existing policy uploaded using Nessus.file (.nessus format only). It requires an http.Client pointer to make the request to Nessus.

func (*Client) LaunchScan

func (c *Client) LaunchScan(httpClient *http.Client, scanID int) (LaunchedScan, error)

LaunchScan launches a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ListAgents

func (c *Client) ListAgents(httpClient *http.Client, scannerID int) (Agents, error)

ListAgents returns the agent list for the given scanner. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ListPermissions

func (c *Client) ListPermissions(httpClient *http.Client, objectType string, objectID int) (Permissions, error)

ListPermissions returns the current object's permissions. Allowed objectType values are "policy", "scan", "scanner", "agent-group", "scanner-pool", and "connector". It requires an http.Client pointer to make the request to Nessus.

func (*Client) ListPolicy

func (c *Client) ListPolicy(httpClient *http.Client) (ListPolicyResponse, error)

ListPolicy returns the policy list. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ListScanTimezones

func (c *Client) ListScanTimezones(httpClient *http.Client) (ScanTimezones, error)

ListScanTimezones returns the timezone list for creating a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ListScanners

func (c *Client) ListScanners(httpClient *http.Client) (ListScannersResponse, error)

ListScanners returns the scanner list. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ListScans

func (c *Client) ListScans(httpClient *http.Client) (ScanList, error)

ListScans returns the scan list. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PauseScan

func (c *Client) PauseScan(httpClient *http.Client, scanID int) (bool, error)

PauseScan pauses a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PluginDetails

func (c *Client) PluginDetails(httpClient *http.Client, pluginID int) (PluginDetails, error)

PluginDetails returns the details for a given plugin. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PluginFamilies

func (c *Client) PluginFamilies(httpClient *http.Client) (PluginFamilies, error)

PluginFamilies returns the list of plugin families. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PluginFamilyDetails

func (c *Client) PluginFamilyDetails(httpClient *http.Client, pluginFamilyID int) (PluginFamilyDetails, error)

PluginFamilyDetails returns the list of plugins in a family. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PluginRulesDetails

func (c *Client) PluginRulesDetails(httpClient *http.Client, ruleID int) (PluginRuleResponse, error)

PluginRulesDetails returns the details for a given rule. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PluginRulesList

func (c *Client) PluginRulesList(httpClient *http.Client) (PluginRulesList, error)

PluginRulesList returns the current user plugin rules. It requires an http.Client pointer to make the request to Nessus.

func (*Client) PolicyDetails

func (c *Client) PolicyDetails(httpClient *http.Client, policyID int) (PolicyDetailsResponse, error)

PolicyDetails returns details for the given policy. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ResumeScan

func (c *Client) ResumeScan(httpClient *http.Client, scanID int) (bool, error)

ResumeScan stops a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ScanDetails

func (c *Client) ScanDetails(httpClient *http.Client, scanID int) (ScanDetails, error)

ScanDetails downloads an exported scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ScanExportStatus

func (c *Client) ScanExportStatus(httpClient *http.Client, scanID, fileID int) (ScanExportStatus, error)

ScanExportStatus checks the file status of an exported scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ServerProperties

func (c *Client) ServerProperties(httpClient *http.Client) (ServerPropertiesResponse, error)

ServerProperties returns the Nessus server version and other properties. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ServerStatus

func (c *Client) ServerStatus(httpClient *http.Client) (ServerStatusResponse, error)

ServerStatus returns the Nessus server status. It requires an http.Client pointer to make the request to Nessus.

func (*Client) StopScan

func (c *Client) StopScan(httpClient *http.Client, scanID int) (bool, error)

StopScan stops a scan. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ToggleScanResultReadStatus

func (c *Client) ToggleScanResultReadStatus(httpClient *http.Client, scanID int, read bool) (bool, error)

ToggleScanResultReadStatus changes the read status of a scan. If read is true, the scan result have been read. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ToggleScheduledScan

func (c *Client) ToggleScheduledScan(httpClient *http.Client, scanID int, enabled bool) (ToggleScheduledScan, error)

ToggleScheduledScan enables or disables a scan schedule. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ViewMailSettings

func (c *Client) ViewMailSettings(httpClient *http.Client) (MailSettings, error)

ViewMailSettings returns the mail server settings. It requires an http.Client pointer to make the request to Nessus.

func (*Client) ViewProxy

func (c *Client) ViewProxy(httpClient *http.Client) (ViewProxyResponse, error)

ViewProxy returns the proxy settings. It requires an http.Client pointer to make the request to Nessus.

type CopyPolicyResponse

type CopyPolicyResponse struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

CopyPolicyResponse is the response when copying a policy

type CreatePolicyResponse

type CreatePolicyResponse struct {
	PolicyID   int    `json:"policy_id"`
	PolicyName string `json:"policy_name"`
}

CreatePolicyResponse is the response to a successful creation of a new policy

type CreateScan

type CreateScan struct {
	UUID     string             `json:"uuid"`
	Settings CreateScanSettings `json:"settings"`
}

CreateScan is the JSON object used to create a new scan in Nessus 6.

type CreateScanResponse

type CreateScanResponse struct {
	Scan struct {
		CreationDate           int    `json:"creation_date"`
		CustomTargets          string `json:"custom_targets"`
		DefaultPermisssions    int    `json:"default_permisssions"`
		Description            string `json:"description"`
		Emails                 string `json:"emails"`
		Enabled                bool   `json:"enabled"`
		ID                     int    `json:"id"`
		LastModificationDate   int    `json:"last_modification_date"`
		Name                   string `json:"name"`
		NotificationFilterType string `json:"notification_filter_type"`
		NotificationFilters    string `json:"notification_filters"`
		Owner                  string `json:"owner"`
		OwnerID                int    `json:"owner_id"`
		PolicyID               int    `json:"policy_id"`
		Rrules                 string `json:"rrules"`
		ScannerID              int    `json:"scanner_id"`
		Shared                 int    `json:"shared"`
		Starttime              string `json:"starttime"`
		TagID                  int    `json:"tag_id"`
		Timezone               string `json:"timezone"`
		Type                   string `json:"type"`
		UseDashboard           bool   `json:"use_dashboard"`
		UserPermissions        int    `json:"user_permissions"`
		UUID                   string `json:"uuid"`
	} `json:"scan"`
}

CreateScanResponse is the Nessus server response when successfully creating a scan

type CreateScanSettings

type CreateScanSettings struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	FolderID    string `json:"folder_id"`
	ScannerID   string `json:"scanner_id"`
	PolicyID    string `json:"policy_id"`
	TextTargets string `json:"text_targets"`
	FileTargets string `json:"file_targets"`
	Launch      string `json:"launch"`
	Enabled     bool   `json:"enabled"`
	LaunchNow   bool   `json:"launch_now"`
	Emails      string `json:"emails"`
}

CreateScanSettings is the sub-JSON structure used in CreateScan when generating a new scan in Nessus 6.

type CreateSessionResponse

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

CreateSessionResponse is The response from Nessus when CreateSession() is called.

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse is used whenever there is an error with completing a request to Nessus

type ExportedScan

type ExportedScan struct {
	File int `json:"file"`
}

ExportedScan is the response when a scan is successfully exported

type Folder

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

Folder represents a folder object

type LaunchedScan

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

LaunchedScan is returned when a scan is successfully launched

type ListPolicyResponse

type ListPolicyResponse struct {
	Policies []PolicyResponse `json:"policies"`
}

ListPolicyResponse is the response of the List method on Nessus.Policies

type ListScannersResponse

type ListScannersResponse struct {
	Scanners []struct {
		AwsAvailabilityZone  interface{} `json:"aws_availability_zone"`
		AwsUpdateInterval    interface{} `json:"aws_update_interval"`
		Challenge            string      `json:"challenge"`
		CreationDate         int         `json:"creation_date"`
		EngineBuild          string      `json:"engine_build"`
		EngineVersion        string      `json:"engine_version"`
		Expiration           int         `json:"expiration"`
		ExpirationTime       int         `json:"expiration_time"`
		ID                   int         `json:"id"`
		Key                  string      `json:"key"`
		LastConnect          interface{} `json:"last_connect"`
		LastModificationDate int         `json:"last_modification_date"`
		License              struct {
			ActivationCode string `json:"activation_code"`
			AgentsUsed     int    `json:"agents_used"`
			Drm            string `json:"drm"`
			ExpirationDate int    `json:"expiration_date"`
			Mode           int    `json:"mode"`
			Name           string `json:"name"`
			ScannersUsed   int    `json:"scanners_used"`
			Type           string `json:"type"`
			UpdatePassword string `json:"update_password"`
			UpdateURL      string `json:"update_url"`
		} `json:"license"`
		Linked           int         `json:"linked"`
		Loadavg          interface{} `json:"loadavg"`
		LoadedPluginSet  string      `json:"loaded_plugin_set"`
		Name             string      `json:"name"`
		NeedsRestart     interface{} `json:"needs_restart"`
		NumHosts         interface{} `json:"num_hosts"`
		NumScans         interface{} `json:"num_scans"`
		NumSessions      interface{} `json:"num_sessions"`
		NumTCPSessions   interface{} `json:"num_tcp_sessions"`
		Owner            string      `json:"owner"`
		OwnerID          int         `json:"owner_id"`
		OwnerName        string      `json:"owner_name"`
		Platform         string      `json:"platform"`
		RegistrationCode string      `json:"registration_code"`
		ScanCount        int         `json:"scan_count"`
		Shared           int         `json:"shared"`
		Status           string      `json:"status"`
		Timestamp        int         `json:"timestamp"`
		Token            interface{} `json:"token"`
		Type             string      `json:"type"`
		UIBuild          string      `json:"ui_build"`
		UIVersion        string      `json:"ui_version"`
		UserPermissions  int         `json:"user_permissions"`
		UUID             string      `json:"uuid"`
	} `json:"scanners"`
}

ListScannersResponse is the list of scanners returned by ListScanners

type MailSettings

type MailSettings struct {
	SMTPAuth    string `json:"smtp_auth"`
	SMTPEnc     string `json:"smtp_enc"`
	SMTPFrom    string `json:"smtp_from"`
	SMTPHost    string `json:"smtp_host"`
	SMTPPass    string `json:"smtp_pass"`
	SMTPPort    string `json:"smtp_port"`
	SMTPUser    string `json:"smtp_user"`
	SMTPWwwHost string `json:"smtp_www_host"`
}

MailSettings are Nessus's mail server settings

type NewAPIKeys

type NewAPIKeys struct {
	AccessKey string `json:"accessKey"`
	SecretKey string `json:"secretKey"`
}

NewAPIKeys is the response to GenerateAPIKeys which includes the new API keys to connect to the API.

type Permission

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

Permission are used to provide access rights to a given object

type Permissions

type Permissions struct {
	Acls []Permission `json:"acls"`
}

Permissions is used to display an array of permissions

type Plugin

type Plugin struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Plugin is the name and id of a plugin family

type PluginAttributes

type PluginAttributes struct {
	AttributeName  string `json:"attribute_name"`
	AttributeValue string `json:"attribute_value"`
}

PluginAttributes are the attributes for a given plugin

type PluginDetails

type PluginDetails struct {
	Attributes []PluginAttributes `json:"attributes"`
	FamilyName string             `json:"family_name"`
	ID         int                `json:"id"`
	Name       string             `json:"name"`
}

PluginDetails are the details for a given plugin

type PluginFamilies

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

PluginFamilies / plugin families are used to organize and group plugins

type PluginFamily

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

PluginFamily / plugin families are used to organize and group plugins.

type PluginFamilyDetails

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

PluginFamilyDetails is the list of plugins in a family

type PluginRuleResponse

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

PluginRuleResponse represents a single Plugin Rule

type PluginRulesList

type PluginRulesList struct {
	PluginRules []PluginRuleResponse `json:"plugin_rules"`
}

PluginRulesList represents a list of plugin rules for a user.

type PolicyDetailsResponse

type PolicyDetailsResponse struct {
	Plugins  interface{} `json:"plugins"`
	Settings interface{} `json:"settings"`
	UUID     string      `json:"uuid"`
}

PolicyDetailsResponse represents the policy details object

type PolicyResponse

type PolicyResponse struct {
	CreationDate         int    `json:"creation_date"`
	Description          string `json:"description"`
	ID                   int    `json:"id"`
	LastModificationDate int    `json:"last_modification_date"`
	Name                 string `json:"name"`
	NoTarget             string `json:"no_target"`
	Owner                string `json:"owner"`
	OwnerID              int    `json:"owner_id"`
	Shared               int    `json:"shared"`
	TemplateUUID         string `json:"template_uuid"`
	UserPermissions      int    `json:"user_permissions"`
	Visibility           string `json:"visibility"`
}

PolicyResponse represents a single policy object

type Scan

type Scan struct {
	Control              bool   `json:"control"`
	CreationDate         int    `json:"creation_date"`
	Enabled              bool   `json:"enabled"`
	FolderID             int    `json:"folder_id"`
	ID                   int    `json:"id"`
	LastModificationDate int    `json:"last_modification_date"`
	Name                 string `json:"name"`
	Owner                string `json:"owner"`
	Read                 bool   `json:"read"`
	Rrules               string `json:"rrules"`
	Shared               bool   `json:"shared"`
	Starttime            string `json:"starttime"`
	Status               string `json:"status"`
	Timezone             string `json:"timezone"`
	Type                 string `json:"type"`
	UseDashboard         bool   `json:"use_dashboard"`
	UserPermissions      int    `json:"user_permissions"`
	UUID                 string `json:"uuid"`
}

Scan represents the details of a scan.

type ScanDetails

type ScanDetails struct {
	Comphosts  []interface{} `json:"comphosts"`
	Compliance []interface{} `json:"compliance"`
	Filters    []struct {
		Control struct {
			ReadableRegex string `json:"readable_regex"`
			Regex         string `json:"regex"`
			Type          string `json:"type"`
		} `json:"control"`
		Name         string   `json:"name"`
		Operators    []string `json:"operators"`
		ReadableName string   `json:"readable_name"`
	} `json:"filters"`
	History []struct {
		AltTargetsUsed       bool        `json:"alt_targets_used"`
		CreationDate         interface{} `json:"creation_date"`
		HistoryID            interface{} `json:"history_id"`
		LastModificationDate interface{} `json:"last_modification_date"`
		OwnerID              interface{} `json:"owner_id"`
		Scheduler            interface{} `json:"scheduler"`
		Status               string      `json:"status"`
		Type                 string      `json:"type"`
		UUID                 string      `json:"uuid"`
	} `json:"history"`
	Hosts []struct {
		Critical            int         `json:"critical"`
		High                int         `json:"high"`
		HostID              int         `json:"host_id"`
		HostIndex           int         `json:"host_index"`
		Hostname            string      `json:"hostname"`
		Info                int         `json:"info"`
		Low                 int         `json:"low"`
		Medium              int         `json:"medium"`
		Numchecksconsidered int         `json:"numchecksconsidered"`
		Progress            string      `json:"progress"`
		Scanprogresscurrent interface{} `json:"scanprogresscurrent"`
		Scanprogresstotal   interface{} `json:"scanprogresstotal"`
		Score               interface{} `json:"score"`
		Severity            interface{} `json:"severity"`
		Severitycount       struct {
			Item []struct {
				Count         int `json:"count"`
				Severitylevel int `json:"severitylevel"`
			} `json:"item"`
		} `json:"severitycount"`
		Totalchecksconsidered int `json:"totalchecksconsidered"`
	} `json:"hosts"`
	Info struct {
		Acls []struct {
			DisplayName interface{} `json:"display_name"`
			ID          interface{} `json:"id"`
			Name        interface{} `json:"name"`
			Owner       interface{} `json:"owner"`
			Permissions interface{} `json:"permissions"`
			Type        string      `json:"type"`
		} `json:"acls"`
		AltTargetsUsed  interface{} `json:"alt_targets_used"`
		Control         bool        `json:"control"`
		EditAllowed     bool        `json:"edit_allowed"`
		FolderID        interface{} `json:"folder_id"`
		Hasaudittrail   bool        `json:"hasaudittrail"`
		Haskb           bool        `json:"haskb"`
		Hostcount       interface{} `json:"hostcount"`
		Name            string      `json:"name"`
		NoTarget        interface{} `json:"no_target"`
		ObjectID        interface{} `json:"object_id"`
		PCICanUpload    bool        `json:"pci-can-upload"`
		Policy          string      `json:"policy"`
		ScanEnd         interface{} `json:"scan_end"`
		ScanStart       interface{} `json:"scan_start"`
		ScanType        string      `json:"scan_type"`
		ScannerEnd      interface{} `json:"scanner_end"`
		ScannerName     string      `json:"scanner_name"`
		ScannerStart    interface{} `json:"scanner_start"`
		Status          string      `json:"status"`
		Targets         string      `json:"targets"`
		Timestamp       interface{} `json:"timestamp"`
		UserPermissions interface{} `json:"user_permissions"`
		UUID            string      `json:"uuid"`
	} `json:"info"`
	Notes        interface{} `json:"notes"`
	Remediations struct {
		NumCves           interface{} `json:"num_cves"`
		NumHosts          interface{} `json:"num_hosts"`
		NumImpactedHosts  interface{} `json:"num_impacted_hosts"`
		NumRemediatedCves interface{} `json:"num_remediated_cves"`
		Remediations      []struct {
			Hosts       interface{} `json:"hosts"`
			Remediation string      `json:"remediation"`
			Value       string      `json:"value"`
			Vulns       interface{} `json:"vulns"`
		} `json:"remediations"`
	} `json:"remediations"`
	Vulnerabilities []struct {
		Count         interface{} `json:"count"`
		PluginFamily  string      `json:"plugin_family"`
		PluginID      interface{} `json:"plugin_id"`
		PluginName    string      `json:"plugin_name"`
		Severity      interface{} `json:"severity"`
		SeverityIndex interface{} `json:"severity_index"`
		VulnIndex     interface{} `json:"vuln_index"`
	} `json:"vulnerabilities"`
}

ScanDetails represents details about a specific scan

type ScanExportStatus

type ScanExportStatus struct {
	Status string `json:"status"`
}

ScanExportStatus is the current status of the scan result exporting. A status of "ready" indicates the file can be downloaded.

type ScanList

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

ScanList is a list of scans and folders

type ScanTimezone

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

ScanTimezone is used to ensure scans run at the proper local time.

type ScanTimezones

type ScanTimezones struct {
	Timezones []ScanTimezone `json:"timezones"`
}

ScanTimezones is a list of scan timezone objects

type ServerPropertiesResponse

type ServerPropertiesResponse struct {
	Capabilities struct {
		MultiScanner      bool   `json:"multi_scanner"`
		MultiUser         string `json:"multi_user"`
		ReportEmailConfig bool   `json:"report_email_config"`
	} `json:"capabilities"`
	Enterprise     bool `json:"enterprise"`
	Expiration     int  `json:"expiration"`
	ExpirationTime int  `json:"expiration_time"`
	IdleTimeout    int  `json:"idle_timeout"`
	License        struct {
		Agents         int    `json:"agents"`
		ExpirationDate string `json:"expiration_date"`
		Ips            int    `json:"ips"`
		Scanners       int    `json:"scanners"`
	} `json:"license"`
	LoadedPluginSet string `json:"loaded_plugin_set"`
	LoginBanner     bool   `json:"login_banner"`
	NessusType      string `json:"nessus_type"`
	NessusUIVersion string `json:"nessus_ui_version"`
	Notifications   []struct {
		Message string `json:"message"`
		Type    string `json:"type"`
	} `json:"notifications"`
	PluginSet       string `json:"plugin_set"`
	ScannerBoottime int    `json:"scanner_boottime"`
	ServerUUID      string `json:"server_uuid"`
	ServerVersion   string `json:"server_version"`
	Update          []struct {
		Href       string `json:"href"`
		NewVersion bool   `json:"new_version"`
		Restart    bool   `json:"restart"`
	} `json:"update"`
}

ServerPropertiesResponse represents Nessus's response to ServerProperties

type ServerStatusResponse

type ServerStatusResponse struct {
	Code     int    `json:"code"`
	Progress int    `json:"progress"`
	Status   string `json:"status"`
}

ServerStatusResponse is the current status of the Nessus server

type SessionInfo

type SessionInfo struct {
	Connectors      interface{} `json:"connectors"`
	ContainerID     int         `json:"container_id"`
	Email           string      `json:"email"`
	Groups          interface{} `json:"groups"`
	ID              int         `json:"id"`
	Lastlogin       int         `json:"lastlogin"`
	Lockout         bool        `json:"lockout"`
	Name            string      `json:"name"`
	Permissions     int         `json:"permissions"`
	Type            string      `json:"type"`
	Username        string      `json:"username"`
	Whatsnew        bool        `json:"whatsnew"`
	WhatsnewVersion string      `json:"whatsnew_version"`
}

SessionInfo represents the current user's session information

type ToggleScheduledScan

type ToggleScheduledScan struct {
	Control   bool   `json:"control"`
	Enabled   bool   `json:"enabled"`
	Rrules    string `json:"rrules"`
	Starttime string `json:"starttime"`
	Timezone  string `json:"timezone"`
}

ToggleScheduledScan represents the response to a scheduled scan which has been enabled or disabled.

type ViewProxyResponse

type ViewProxyResponse struct {
	Proxy         string `json:"proxy"`
	ProxyPassword string `json:"proxy_password"`
	ProxyPort     string `json:"proxy_port"`
	ProxyUsername string `json:"proxy_username"`
	UserAgent     string `json:"user_agent"`
}

ViewProxyResponse is the returned proxy settings for the Nessus server.

Jump to

Keyboard shortcuts

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