Documentation ¶
Index ¶
- Constants
- func FiltersToValues(filters []Filter) url.Values
- type Agent
- type AgentGroup
- type AgentGroupName
- type AgentGroupRef
- type AgentGroups
- type AgentGroupsAPI
- func (c *AgentGroupsAPI) AddAgent(scannerID int, groupID int, agentID int) (bool, error)
- func (c *AgentGroupsAPI) Configure(scannerID int, groupID int, groupName string) (bool, error)
- func (c *AgentGroupsAPI) Create(scannerID int, groupName string) (*AgentGroup, error)
- func (c *AgentGroupsAPI) Delete(scannerID int, groupID int) (bool, error)
- func (c *AgentGroupsAPI) DeleteAgent(scannerID int, groupID int, agentID int) (bool, error)
- func (c *AgentGroupsAPI) Details(scannerID int, groupID int, opts ...FilterConfigShort) (*AgentGroup, error)
- func (c *AgentGroupsAPI) List(scannerID int) ([]AgentGroup, error)
- type AgentsAPI
- type AgentsList
- type Asset
- type AssetVulnInfo
- type AssetVulnOutput
- type AssetVulnOutputs
- type AssetVulnerabilities
- type Assets
- type Client
- type CommonFilterHelpers
- type Filter
- type FilterConfigShort
- func WithFilterType(ft FilterSearchType) FilterConfigShort
- func WithFilters(filters ...FilterShort) FilterConfigShort
- func WithLimit(limit int) FilterConfigShort
- func WithOffset(offset int) FilterConfigShort
- func WithSort(sorts ...SortConfig) FilterConfigShort
- func WithWildcardFields(fields ...string) FilterConfigShort
- func WithWildcardFilter(filterText string) FilterConfigShort
- type FilterSearchType
- type FilterShort
- type FilterSortType
- type Pagination
- type Plugin
- type PluginAttributes
- type PluginDetails
- type PluginFamilies
- type PluginFamily
- type PluginFamilyDetails
- type PluginsAPI
- type RequestModifier
- type Sort
- type SortConfig
- type Source
- type Vulnerability
- type VulnerabilityInfo
- type VulnerabilityInfoPluginDetails
- type VulnerabilityInformation
- type VulnerabilityOutput
- type WorkbenchesAPI
- func (c *WorkbenchesAPI) ApplyCommonFilters(req *resty.Request)
- func (c *WorkbenchesAPI) AssetVulnInfo(assetID string, pluginID int) (*AssetVulnInfo, error)
- func (c *WorkbenchesAPI) AssetVulnOutput(assetID string, pluginID int) (*AssetVulnOutputs, error)
- func (c *WorkbenchesAPI) AssetVulns(assetID string) (*AssetVulnerabilities, error)
- func (c *WorkbenchesAPI) Assets() (*Assets, error)
- func (c *WorkbenchesAPI) WithDateRange(numDaysIncluded int) *WorkbenchesAPI
- func (c *WorkbenchesAPI) WithFilters(filters ...Filter) *WorkbenchesAPI
- func (c *WorkbenchesAPI) WithSearchType(st FilterSearchType) *WorkbenchesAPI
Constants ¶
const ( Filter_CPE = "plugin.attributes.cpe" CPE_AppleMacOS = "cpe:/o:apple:macos" CPE_AppleMacOSX = "cpe:/o:apple:mac_os_x" CPE_MicrosoftWindows = "cpe:/o:microsoft:windows" CPE_GoogleChrome = "cpe:/a:google:chrome" CPE_MozillaFirefox = "cpe:/a:mozilla:firefox" CPE_MicrosoftIE = "cpe:/a:microsoft:ie" CPE_MicrosoftEdge = "cpe:/a:microsoft:edge" CPE_AppleSafari = "cpe:/a:apple:safari" CPE_OracleJRE = "cpe:/a:oracle:jre" CPE_OracleJDK = "cpe:/a:oracle:jdk" CPE_AdobeFlashPlayer = "cpe:/a:adobe:flash_player" CPE_AdobeAcrobat = "cpe:/a:adobe:acrobat" )
Note: these seem to be CPE v2.2 naming format
const ( FilterSearchTypeAnd FilterSearchType = "and" FilterSearchTypeOr FilterSearchType = "or" FilterSortTypeAsc FilterSortType = "asc" FilterSortTypeDesc FilterSortType = "desc" )
const (
BaseUrl string = "https://cloud.tenable.com/"
)
Variables ¶
This section is empty.
Functions ¶
func FiltersToValues ¶
Types ¶
type Agent ¶
type Agent struct { ID int `json:"id"` UUID string `json:"uuid"` LinkedOn int `json:"linked_on"` LastConnect int `json:"last_connect"` LastScanned int `json:"last_scanned"` PluginFeedID string `json:"plugin_feed_id"` CoreBuild string `json:"core_build"` CoreVersion string `json:"core_version"` Name string `json:"name"` Distro string `json:"distro"` Platform string `json:"platform"` IP string `json:"ip"` Status string `json:"status"` Groups []AgentGroupRef `json:"groups"` }
The details of an agent connected to a scanner. Ref: https://cloud.tenable.com/api#/resources/agents
type AgentGroup ¶
type AgentGroup struct { ID int `json:"id"` UUID string `json:"uuid"` CreationDate int `json:"creation_date"` LastModificationDate int `json:"last_modification_date"` Name string `json:"name"` OwnerID int `json:"owner_id"` OwnerUUID string `json:"owner_uuid"` Owner string `json:"owner"` OwnerName string `json:"owner_name"` AgentsCount int `json:"agents_count"` Agents []Agent `json:"agents"` Pagination Pagination `json:"pagination"` UserPermissions int `json:"user_permissions"` }
AgentGroup contains the details of an agent group. Not all fields may be returned unless Agent Enhancements are enabled for your account. Ref: https://cloud.tenable.com/api#/resources/agent-groups
type AgentGroupName ¶
type AgentGroupName struct {
Name string `json:"name"`
}
type AgentGroupRef ¶
type AgentGroups ¶
type AgentGroups struct {
Groups []AgentGroup `json:"groups"`
}
AgentGroups Ref: https://cloud.tenable.com/api#/resources/agent-groups/list
type AgentGroupsAPI ¶
type AgentGroupsAPI struct {
// contains filtered or unexported fields
}
func (*AgentGroupsAPI) AddAgent ¶
AddAgent adds an agent to the given agent group.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/add-agent
func (*AgentGroupsAPI) Configure ¶
Configure changes the name of the given agent group.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/configure
func (*AgentGroupsAPI) Create ¶
func (c *AgentGroupsAPI) Create(scannerID int, groupName string) (*AgentGroup, error)
Create creates an agent group on the given scanner.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/create
func (*AgentGroupsAPI) Delete ¶
func (c *AgentGroupsAPI) Delete(scannerID int, groupID int) (bool, error)
Delete deletes an agent group from the given scanner.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/delete
func (*AgentGroupsAPI) DeleteAgent ¶
DeleteAgent deletes an agent from the given agent group.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/delete-agent
func (*AgentGroupsAPI) Details ¶
func (c *AgentGroupsAPI) Details(scannerID int, groupID int, opts ...FilterConfigShort) (*AgentGroup, error)
Details returns details for the given agent group. Agent records which belong to this group will also be returned. You can apply filtering, sorting, or pagination to the agent records.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/details
func (*AgentGroupsAPI) List ¶
func (c *AgentGroupsAPI) List(scannerID int) ([]AgentGroup, error)
List returns the agent groups for the given scanner.
Ref: https://cloud.tenable.com/api#/resources/agent-groups/list
type AgentsAPI ¶
type AgentsAPI struct {
// contains filtered or unexported fields
}
func (*AgentsAPI) Delete ¶
Delete deletes an agent.
Ref: https://cloud.tenable.com/api#/resources/agents/delete
func (*AgentsAPI) Get ¶
Get returns the specified agent for the given scanner.
Ref: https://cloud.tenable.com/api#/resources/agents/get
func (*AgentsAPI) List ¶
func (c *AgentsAPI) List(scannerID int, opts ...FilterConfigShort) (*AgentsList, error)
List returns the agent list for the given scanner.
Ref: https://cloud.tenable.com/api#/resources/agents/list
type AgentsList ¶
type AgentsList struct { Agents []Agent `json:"agents"` Pagination Pagination `json:"pagination"` }
type Asset ¶
type Asset struct { ID string `json:"id""` HasAgent bool `json:"has_agent"` LastSeen string `json:"last_seen"` Sources []Source `json:"sources"` AgentName []string `json:"agent_name"` IPv4 []string `json:"ipv4"` IPv6 []string `json:"ipv6"` FQDN []string `json:"fqdn"` NetbiosName []string `json:"netbios_name"` OperatingSystem []string `json:"operating_system"` MacAddress []string `json:"mac_address"` }
Ref: https://cloud.tenable.com/api#/resources/workbenches/assets
type AssetVulnInfo ¶
type AssetVulnInfo struct {
Info VulnerabilityInfo `json:"info"`
}
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-info
type AssetVulnOutput ¶
type AssetVulnOutput struct { PluginOutput string `json:"plugin_output"` States interface{} `json:"states"` }
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-output TODO: Finish the AssetVulnOutput struct
type AssetVulnOutputs ¶
type AssetVulnOutputs struct {
Outputs []AssetVulnOutput `json:"outputs"`
}
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-output
type AssetVulnerabilities ¶
type AssetVulnerabilities struct {
Vulnerabilities []Vulnerability `json:"vulnerabilities"`
}
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerabilities
type Assets ¶
type Assets struct {
Assets []Asset `json:"assets"`
}
Ref: https://cloud.tenable.com/api#/resources/workbenches/assets
type Client ¶
type Client struct { Agents *AgentsAPI AgentGroups *AgentGroupsAPI Plugins *PluginsAPI Workbenches *WorkbenchesAPI // contains filtered or unexported fields }
func DefaultClient ¶
type CommonFilterHelpers ¶
type CommonFilterHelpers struct {
// contains filtered or unexported fields
}
func (CommonFilterHelpers) WithDateRange ¶
func (c CommonFilterHelpers) WithDateRange(numDaysIncluded int) CommonFilterHelpers
func (CommonFilterHelpers) WithFilters ¶
func (c CommonFilterHelpers) WithFilters(filters ...Filter) CommonFilterHelpers
func (CommonFilterHelpers) WithSearchType ¶
func (c CommonFilterHelpers) WithSearchType(st FilterSearchType) CommonFilterHelpers
type FilterConfigShort ¶
type FilterConfigShort RequestModifier
func WithFilterType ¶
func WithFilterType(ft FilterSearchType) FilterConfigShort
func WithFilters ¶
func WithFilters(filters ...FilterShort) FilterConfigShort
func WithLimit ¶
func WithLimit(limit int) FilterConfigShort
func WithOffset ¶
func WithOffset(offset int) FilterConfigShort
func WithSort ¶
func WithSort(sorts ...SortConfig) FilterConfigShort
func WithWildcardFields ¶
func WithWildcardFields(fields ...string) FilterConfigShort
func WithWildcardFilter ¶
func WithWildcardFilter(filterText string) FilterConfigShort
type FilterSearchType ¶
type FilterSearchType string
type FilterShort ¶
type FilterSortType ¶
type FilterSortType string
type Pagination ¶
type PluginAttributes ¶
type PluginDetails ¶
type PluginDetails struct { ID int `json:"id"` Name string `json:"name"` FamilyName string `json:"family_name"` Attributes []PluginAttributes `json:"attributes"` }
Ref: https://cloud.tenable.com/api#/resources/plugins/plugin-details
type PluginFamilies ¶
type PluginFamilies struct {
Families []PluginFamily `json:"families"`
}
type PluginFamily ¶
type PluginFamilyDetails ¶
type PluginFamilyDetails struct { ID int `json:"id"` Name string `json:"name"` Plugins []Plugin `json:"plugins"` }
Ref: https://cloud.tenable.com/api#/resources/plugins/family-details
type PluginsAPI ¶
type PluginsAPI struct {
// contains filtered or unexported fields
}
func (*PluginsAPI) Families ¶
func (c *PluginsAPI) Families() (*PluginFamilies, error)
Returns the list of plugin families.
Ref: https://cloud.tenable.com/api#/resources/plugins/families
func (*PluginsAPI) FamilyDetails ¶
func (c *PluginsAPI) FamilyDetails(familyID int) (*PluginFamilyDetails, error)
Returns the list of plugins in a family.
Ref:https://cloud.tenable.com/api#/resources/plugins/family-details
func (*PluginsAPI) PluginDetails ¶
func (c *PluginsAPI) PluginDetails(pluginID int) (*PluginDetails, error)
Returns details for a given plugin.
Ref: https://cloud.tenable.com/api#/resources/plugins/plugin-details
type SortConfig ¶
type SortConfig struct { Field string Type FilterSortType }
type Source ¶
type Source struct { Name string `json:"name"` FirstSeen string `json:"first_seen"` LastSeen string `json:"last_seen"` }
source
Ref: https://cloud.tenable.com/api#/resources/workbenches
type Vulnerability ¶
type Vulnerability struct { Count int `json:"count"` PluginFamily string `json:"plugin_family"` PluginID int `json:"plugin_id"` PluginName string `json:"plugin_name"` VulnerabilityState string `json:"vulnerability_state"` Severity int `json:"severity"` }
vulnerability
Ref: https://cloud.tenable.com/api#/resources/workbenches
type VulnerabilityInfo ¶
type VulnerabilityInfo struct { Description string `json:"description"` Synopsis string `json:"synopsis"` Discovery interface{} `json:"discovery"` PluginDetails VulnerabilityInfoPluginDetails `json:"plugin_details"` ReferenceInformation interface{} `json:"reference_information"` RiskInformation interface{} `json:"risk_information"` SeeAlso []interface{} `json:"see_also"` Solution string `json:"solution"` VulnerabilityInformation VulnerabilityInformation `json:"vulnerability_information"` }
vulnerability_info
Ref: https://cloud.tenable.com/api#/resources/workbenches
TODO: Finish the VulnerabilityInfo struct
type VulnerabilityInfoPluginDetails ¶
type VulnerabilityInfoPluginDetails struct { Name string `json:"name"` FamilyName string `json:"family"` Severity int `json:"severity"` Type string `json:"local"` PublicationDate *time.Time `json:"publication_date"` ModificationDate *time.Time `json:"modification_date"` Version string `json:"version"` }
type VulnerabilityInformation ¶
type VulnerabilityInformation struct { CPE []string `json:"cpe"` VulnPublicationDate *time.Time `json:"vulnerability_publication_date"` PatchPublicationDate *time.Time `json:"patch_publication_date"` UnsupportedByVendor bool `json:"unsupported_by_vendor"` // TODO: Finish implementing this.. ExploitAvailable interface{} `json:"exploit_available"` ExploitabilityEase interface{} `json:"exploitability_ease"` ExploitedByMalware interface{} `json:"exploited_by_malware"` ExploitedByNessus interface{} `json:"exploited_by_nessus"` ExploitFrameworks interface{} `json:"exploit_frameworks"` AssetInventory interface{} `json:"asset_inventory"` DefaultAccount interface{} `json:"default_account"` InTheNews interface{} `json:"in_the_news"` Malware interface{} `json:"malware"` }
vulnerability_info
Ref: https://cloud.tenable.com/api#/resources/workbenches
type VulnerabilityOutput ¶
type VulnerabilityOutput struct { ApplicationProtocol string `json:"application_protocol"` Assets []Asset `json:"assets"` Port int `json:"port"` TransportProtocol string `json:"transport_protocol"` }
vulnerability_output
Ref: https://cloud.tenable.com/api#/resources/workbenches
type WorkbenchesAPI ¶
type WorkbenchesAPI struct { CommonFilterHelpers // contains filtered or unexported fields }
func (*WorkbenchesAPI) ApplyCommonFilters ¶
func (c *WorkbenchesAPI) ApplyCommonFilters(req *resty.Request)
func (*WorkbenchesAPI) AssetVulnInfo ¶
func (c *WorkbenchesAPI) AssetVulnInfo(assetID string, pluginID int) (*AssetVulnInfo, error)
Get the details for a vulnerability recorded on a given asset.
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-info
func (*WorkbenchesAPI) AssetVulnOutput ¶
func (c *WorkbenchesAPI) AssetVulnOutput(assetID string, pluginID int) (*AssetVulnOutputs, error)
Get the vulnerability outputs for a plugin recorded on a given asset.
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerability-output
func (*WorkbenchesAPI) AssetVulns ¶
func (c *WorkbenchesAPI) AssetVulns(assetID string) (*AssetVulnerabilities, error)
A list of up to 5000 of the vulnerabilities recorded for a given asset. By default, this list is sorted by vulnerability count, descending.
Ref: https://cloud.tenable.com/api#/resources/workbenches/asset-vulnerabilities
func (*WorkbenchesAPI) Assets ¶
func (c *WorkbenchesAPI) Assets() (*Assets, error)
A list of up to 5000 assets. The list can be modified using filters.
Ref: https://cloud.tenable.com/api#/resources/workbenches/assets
func (*WorkbenchesAPI) WithDateRange ¶
func (c *WorkbenchesAPI) WithDateRange(numDaysIncluded int) *WorkbenchesAPI
func (*WorkbenchesAPI) WithFilters ¶
func (c *WorkbenchesAPI) WithFilters(filters ...Filter) *WorkbenchesAPI
func (*WorkbenchesAPI) WithSearchType ¶
func (c *WorkbenchesAPI) WithSearchType(st FilterSearchType) *WorkbenchesAPI