Documentation ¶
Index ¶
- Constants
- type Alert
- type AlertManagedAgent
- type Client
- func (c *Client) Do(req *http.Request) (res *http.Response, err error)
- func (c *Client) GetAlerts() (alerts []*Alert, err error)
- func (c *Client) GetEndpoints() (endpoints []*Endpoint, err error)
- func (c *Client) GetResults(request *http.Request) (items []json.RawMessage, err error)
- func (c *Client) NewDataRequest(method, url string, body io.Reader) (req *http.Request, err error)
- func (c *Client) NewRequest(method, url string, body io.Reader) (req *http.Request, err error)
- func (c *Client) WhoAmI() (err error)
- type Endpoint
- type EndpointHealth
- type LoggingRoundTripper
- type PageInfo
- type ResponseBody
- type UserInfo
Constants ¶
View Source
const ( DefaultURL = "https://api.central.sophos.com" AuthTokenURL = "https://id.sophos.com/api/v2/oauth2/token" //nolint:gosec DefaultTimeout = 5 DefaultPageSize = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID string `json:"id"` // Alert categories. // // The following values are allowed: // azure, adSync, applicationControl, appReputation, blockListed, connectivity, cwg, denc, downloadReputation, // endpointFirewall, fenc, forensicSnapshot, general, iaas, iaasAzure, isolation, malware, mtr, mobiles, policy, // protection, pua, runtimeDetections, security, smc, systemHealth, uav, uncategorized, updating, utm, virt, // wireless, xgEmail Category string `json:"category"` Description string `json:"description"` GroupKey string `json:"groupKey"` ManagedAgent AlertManagedAgent `json:"managedAgent"` // Product types. // // The following values are allowed: // other, endpoint, server, mobile, encryption, emailGateway, webGateway, phishThreat, wireless, iaas, firewall Product string `json:"product"` // When the alert was triggered. RaisedAt time.Time `json:"raisedAt"` // Severity levels for alerts. // // The following values are allowed: // high, medium, low Severity string `json:"severity"` // Alert type. Type string `json:"type"` }
type AlertManagedAgent ¶ added in v0.2.0
type Client ¶
type Client struct { AuthConfig *clientcredentials.Config HttpClient *http.Client BaseURL string DataURL string UserInfo *UserInfo TenantID string PageSize uint32 }
func (*Client) GetEndpoints ¶
func (*Client) GetResults ¶
nolint: funlen
func (*Client) NewDataRequest ¶
func (*Client) NewRequest ¶ added in v0.2.0
type Endpoint ¶
type Endpoint struct { // The hostname of the endpoint. Hostname string `json:"hostname"` // The unique ID for the endpoint. ID string `json:"id"` // Products assigned to the endpoint. AssignedProducts []json.RawMessage `json:"assignedProducts"` // The health status of the endpoint. Health EndpointHealth `json:"health"` // The endpoint type. // // The following values are allowed: // computer, server, securityVm Type string `json:"type"` }
type EndpointHealth ¶
type EndpointHealth struct { // Health status of the endpoint or a service running on the endpoint. // // The following values are allowed: // good, suspicious, bad, unknown Overall string `json:"overall"` // Status of services on the endpoint. Services json.RawMessage `json:"services"` // Threats on the endpoint. Threats json.RawMessage `json:"threats"` }
type LoggingRoundTripper ¶ added in v0.2.0
type LoggingRoundTripper struct {
Base http.RoundTripper
}
type PageInfo ¶
type PageInfo struct { // The key of the first item in the returned page. FromKey string `json:"fromKey"` // (Optional) The total number of items on all the pages, if pageTotal=true was passed into the request. Items int `json:"items"` // The maximum page size that can be requested. MaxSize int `json:"maxSize"` // The key to use when fetching the next page. NextKey string `json:"nextKey"` // The size of the page being returned. Size int `json:"size"` // (Optional) The total number of pages that exist, if pageTotal=true in the request. Total int `json:"total"` }
type ResponseBody ¶
type ResponseBody struct { Items []json.RawMessage `json:"items"` Pages PageInfo `json:"pages"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.