Documentation
¶
Index ¶
- type AuthProvider
- type BasicAuthProvider
- type Client
- type KeyAuthProvider
- type NessusClient
- func (c *NessusClient) CreateScan(scan *Scan) (*PersistedScan, error)
- func (c *NessusClient) GetPluginByID(ID int64) (*Plugin, error)
- func (c *NessusClient) GetScanByID(ID int64) (*ScanDetail, error)
- func (c *NessusClient) GetScanTemplates() ([]*ScanTemplate, error)
- func (c *NessusClient) GetScans(lastModificationDate int64) ([]*PersistedScan, error)
- func (c *NessusClient) LaunchScan(scanID int64) error
- func (c *NessusClient) StopScan(scanID int64) error
- type PersistedScan
- type Plugin
- type PluginAttribute
- type Scan
- type ScanDetail
- type ScanInfo
- type ScanSettings
- type ScanTemplate
- type Vulnerability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶
type AuthProvider interface { AddAuthHeaders(*http.Request) Prepare(url string, client *http.Client) error }
AuthProvider expose the methods necessary to perform authenticated calls
type BasicAuthProvider ¶
type BasicAuthProvider struct {
// contains filtered or unexported fields
}
BasicAuthProvider represent the basic auth method
func NewBasicAuthProvider ¶
func NewBasicAuthProvider(username string, password string) *BasicAuthProvider
NewBasicAuthProvider returns a new BasicAuthProvider
func (*BasicAuthProvider) AddAuthHeaders ¶
func (b *BasicAuthProvider) AddAuthHeaders(r *http.Request)
AddAuthHeaders add auth headers
type Client ¶
type Client interface { GetScanTemplates() ([]*ScanTemplate, error) LaunchScan(scanId int64) error StopScan(scanId int64) error CreateScan(scan *Scan) (*PersistedScan, error) GetScans(lastModificationDate int64) ([]*PersistedScan, error) GetScanByID(id int64) (*ScanDetail, error) GetPluginByID(id int64) (*Plugin, error) }
Client expose the methods callable on Nessus Api
type KeyAuthProvider ¶
type KeyAuthProvider struct {
// contains filtered or unexported fields
}
KeyAuthProvider represent the key based auth method
func NewKeyAuthProvider ¶
func NewKeyAuthProvider(accessKey string, secretKey string) *KeyAuthProvider
NewKeyAuthProvider returns a new KeyAuthProvider
func (*KeyAuthProvider) AddAuthHeaders ¶
func (k *KeyAuthProvider) AddAuthHeaders(r *http.Request)
AddAuthHeaders add auth headers
type NessusClient ¶
type NessusClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(auth AuthProvider, url string, allowInsecureConnection bool) (*NessusClient, error)
NewClient returns a new NessusClient
func (*NessusClient) CreateScan ¶
func (c *NessusClient) CreateScan(scan *Scan) (*PersistedScan, error)
CreateScan creates a scan
func (*NessusClient) GetPluginByID ¶
func (c *NessusClient) GetPluginByID(ID int64) (*Plugin, error)
GetPluginByID retrieves a plugin by ID
func (*NessusClient) GetScanByID ¶
func (c *NessusClient) GetScanByID(ID int64) (*ScanDetail, error)
GetScanByID retrieve a scan by ID
func (*NessusClient) GetScanTemplates ¶
func (c *NessusClient) GetScanTemplates() ([]*ScanTemplate, error)
GetScanTemplates retrieves Scan Templates
func (*NessusClient) GetScans ¶
func (c *NessusClient) GetScans(lastModificationDate int64) ([]*PersistedScan, error)
GetScans get a list of scan matching the provided lastModificationDate (check Nessus documentation)
func (*NessusClient) LaunchScan ¶
func (c *NessusClient) LaunchScan(scanID int64) error
LaunchScan launch spe scan with the specified scanID
func (*NessusClient) StopScan ¶
func (c *NessusClient) StopScan(scanID int64) error
StopScan stops the scan with the given scanID
type PersistedScan ¶
type Plugin ¶
type Plugin struct { ID int64 `json:"id"` Name string `json:"name"` FamilyName string `json:"family_name"` Attributes []PluginAttribute `json:"attributes"` }
type PluginAttribute ¶
type Scan ¶
type Scan struct { TemplateUUID string `json:"uuid"` Settings ScanSettings `json:"settings"` }
type ScanDetail ¶
type ScanDetail struct { ID int64 Info *ScanInfo `json:"info"` Vulnerabilities []Vulnerability `json:"vulnerabilities"` }