Documentation ¶
Overview ¶
Package wallarm implements the Wallarm v2 API.
Index ¶
- Constants
- Variables
- func Contains(a interface{}, x interface{}) bool
- type API
- type Action
- type ActionBody
- type ActionCreate
- type ActionCreateResp
- type ActionDetails
- type ActionFetch
- type ActionFilter
- type ActionRead
- type AppCreate
- type AppDelete
- type AppFilter
- type AppRead
- type AppReadFilter
- type AppReadResp
- type AppUpdate
- type AppUpdateFields
- type AppUpdateFilter
- type Application
- type Blacklist
- type BlacklistCreate
- type BlacklistRead
- type Bulk
- type Client
- type ClientFields
- type ClientFilter
- type ClientInfo
- type ClientRead
- type ClientReadFilter
- type ClientUpdate
- type EmailIntegrationCreate
- type GetVulnFilter
- type GetVulnRead
- type GetVulnReadResp
- type HintDelete
- type HintDeleteFilter
- type HintFilter
- type HintRead
- type HintReadResp
- type Integration
- type IntegrationCreate
- type IntegrationCreateResp
- type IntegrationEvents
- type IntegrationObject
- type IntegrationRead
- type IntegrationWithAPICreate
- type IntegrationWithAPITarget
- type Logger
- type Node
- type NodeCreate
- type NodeCreateResp
- type NodeFilter
- type NodeRead
- type NodeReadBody
- type NodeReadBodyPOST
- type NodeReadByFilter
- type NodeReadPOST
- type Option
- type RetryPolicy
- type Scanner
- type ScannerCreate
- type ScannerCreateBody
- type ScannerDelete
- type ScannerDeleteBulk
- type ScannerFilter
- type ScannerUpdate
- type Trigger
- type TriggerActions
- type TriggerCreate
- type TriggerCreateResp
- type TriggerFilters
- type TriggerParam
- type TriggerRead
- type TriggerResp
- type TriggerThreshold
- type TwoDimensionalSlice
- type User
- type UserCreate
- type UserDelete
- type UserDetails
- type UserFields
- type UserFilter
- type UserGet
- type UserParams
- type UserRead
- type UserUpdate
- type Vulnerability
Constants ¶
const (
// Version is the client version
Version = "0.0.14"
)
Variables ¶
var ErrExistingResource = errors.New("This resource has already been created earlier")
ErrExistingResource is returned when resource was created other than Terrafom ways - directly via the API.
var ErrInvalidCredentials = errors.New("Credentials are not set. Specify UUID and Secret")
ErrInvalidCredentials is raised when not all the credentials are presented.
Functions ¶
Types ¶
type API ¶
type API interface { Action Application Blacklist Client Vulnerability Integration Node Scanner Trigger User }
API holds the configuration for the current API client. A client should not be modified concurrently.
type Action ¶
type Action interface { HintRead(hintBody *HintRead) (*HintReadResp, error) RuleRead(ruleBody *ActionRead) (*ActionFetch, error) HintCreate(ruleBody *ActionCreate) (*ActionCreateResp, error) RuleDelete(actionID int) error HintDelete(hintbody *HintDelete) error }
Action contains operations available on Action resource
type ActionBody ¶
type ActionBody struct { ID int `json:"id"` ActionID int `json:"actionid"` Clientid int `json:"clientid"` Action []ActionDetails `json:"action"` CreateTime int `json:"create_time"` CreateUserid int `json:"create_userid"` Validated bool `json:"validated"` System bool `json:"system"` RegexID interface{} `json:"regex_id"` UpdatedAt int `json:"updated_at"` Type string `json:"type"` Enabled bool `json:"enabled"` Mode string `json:"mode"` Regex string `json:"regex"` Point []interface{} `json:"point"` AttackType string `json:"attack_type"` Rules []string `json:"rules"` // Headers for the Set Response Headers Rule // are defined by these two parameters. Name string `json:"name"` Values []interface{} `json:"values"` }
ActionBody is an inner body for the Action and Hint responses.
type ActionCreate ¶
type ActionCreate struct { Type string `json:"type"` Action *[]ActionDetails `json:"action,omitempty"` Clientid int `json:"clientid,omitempty"` Validated bool `json:"validated"` Point TwoDimensionalSlice `json:"point,omitempty"` Rules []string `json:"rules,omitempty"` AttackType string `json:"attack_type,omitempty"` Mode string `json:"mode,omitempty"` Counter string `json:"counter,omitempty"` Regex string `json:"regex,omitempty"` RegexID int `json:"regex_id,omitempty"` Enabled *bool `json:"enabled,omitempty"` Name string `json:"name,omitempty"` Values []string `json:"values,omitempty"` Comment string `json:"comment,omitempty"` }
ActionCreate is a creation skeleton for the Rule.
type ActionCreateResp ¶
type ActionCreateResp struct { Status int `json:"status"` Body *ActionBody `json:"body"` }
ActionCreateResp is the response of just created Rule.
type ActionDetails ¶ added in v0.0.6
type ActionDetails struct { Type string `json:"type,omitempty"` Point []interface{} `json:"point,omitempty"` Value interface{} `json:"value,omitempty"` }
ActionDetails defines the Action of how to parse the request. Point represents a part of the request where the condition should be satisfied. ActionDetails is used to define the particular assets of the Action field.
type ActionFetch ¶ added in v0.0.7
type ActionFetch struct { Status int `json:"status"` Body []struct { ID int `json:"id"` Clientid int `json:"clientid"` Name interface{} `json:"name"` Conditions []interface{} `json:"conditions"` Hints int `json:"hints"` GroupedHintsCount int `json:"grouped_hints_count"` UpdatedAt int `json:"updated_at"` } `json:"body"` }
ActionFetch is a response struct which portrays all conditions set for requests of filtered type.
type ActionFilter ¶
type ActionFilter struct { ID []int `json:"id,omitempty"` NotID []int `json:"!id,omitempty"` Clientid []int `json:"clientid,omitempty"` HintsCount TwoDimensionalSlice `json:"hints_count,omitempty"` HintType []string `json:"hint_type,omitempty"` }
ActionFilter is the specific filter for getting the rules. This is an inner structure.
type ActionRead ¶
type ActionRead struct { Filter *ActionFilter `json:"filter"` Limit int `json:"limit"` Offset int `json:"offset"` }
ActionRead is used as a filter to fetch the rules.
type AppDelete ¶
type AppDelete struct {
Filter *AppFilter `json:"filter"`
}
AppDelete is a root object for deleting filter.
type AppRead ¶
type AppRead struct { Limit int `json:"limit"` Offset int `json:"offset"` Filter *AppReadFilter `json:"filter"` }
AppRead is a request body for filtration of the App.
type AppReadFilter ¶
type AppReadFilter struct {
Clientid []int `json:"clientid"`
}
AppReadFilter is a filter by Client ID.
type AppReadResp ¶
type AppReadResp struct { Status int `json:"status"` Body []struct { *AppCreate Deleted bool `json:"deleted"` } `json:"body"` }
AppReadResp is a response with parameters of the application.
type AppUpdate ¶
type AppUpdate struct { Filter *AppUpdateFilter `json:"filter"` Fields *AppUpdateFields `json:"fields"` }
AppUpdate is a request body to update Fields in the existing Application defined by Filter.
type AppUpdateFields ¶
type AppUpdateFields struct {
Name string `json:"name"`
}
AppUpdateFields is used as identificator what should be changed in Application. Only Name is supported.
type AppUpdateFilter ¶
type AppUpdateFilter struct { *AppReadFilter ID int `json:"id"` }
AppUpdateFilter is used as a filter with ID of the Application.
type Application ¶ added in v0.0.15
type Application interface { AppRead(appBody *AppRead) (*AppReadResp, error) AppCreate(appBody *AppCreate) error AppDelete(appBody *AppDelete) error AppUpdate(appBody *AppUpdate) error }
Application contains operations available on Application resource
type Blacklist ¶ added in v0.0.15
type Blacklist interface { BlacklistRead(clientID int) ([]BlacklistRead, error) BlacklistCreate(blacklistBody *BlacklistCreate) error BlacklistDelete(clientID int, ids []int) error }
Blacklist contains operations available on Blacklist resource
type BlacklistCreate ¶
type BlacklistCreate struct {
Bulks *[]Bulk `json:"bulk"`
}
BlacklistCreate is a root object to fill the blacklist
type BlacklistRead ¶
type BlacklistRead struct { Body struct { Result string `json:"result"` Total int `json:"total"` Continuation interface{} `json:"continuation"` EventContinuation string `json:"event_continuation"` Objects []struct { ID int `json:"id"` Clientid int `json:"clientid"` Country string `json:"country"` Poolid int `json:"poolid"` StillAttacks bool `json:"still_attacks"` IP string `json:"ip"` ExpireAt int `json:"expire_at"` Tags []interface{} `json:"tags"` BlockedAt int `json:"blocked_at"` Reason string `json:"reason"` Tor interface{} `json:"tor"` Datacenter interface{} `json:"datacenter"` ProxyType interface{} `json:"proxy_type"` } `json:"objects"` } `json:"body"` }
BlacklistRead is used to unmarshal blacklist Read function
type Bulk ¶
type Bulk struct { IP string `json:"ip"` ExpireAt int `json:"expire_at"` Reason string `json:"reason"` Poolid int `json:"poolid"` Clientid int `json:"clientid"` }
Bulk is used to define IP address, applications, time and reason
type Client ¶ added in v0.0.15
type Client interface { ClientUpdate(clientBody *ClientUpdate) (*ClientInfo, error) ClientRead(clientBody *ClientRead) (*ClientInfo, error) }
Client contains operations available on Client resource
type ClientFields ¶
type ClientFields struct { Mode string `json:"mode,omitempty"` ScannerMode string `json:"scanner_mode,omitempty"` AttackRecheckerMode string `json:"attack_rechecker_mode,omitempty"` }
ClientFields defines fields which are subject to update.
type ClientFilter ¶
type ClientFilter struct {
ID int `json:"id"`
}
ClientFilter is used for filtration. ID is a Client ID entity.
type ClientInfo ¶ added in v0.0.6
type ClientInfo struct { Status int `json:"status"` Body []struct { ClientFilter Name string `json:"name"` Components []string `json:"components"` VulnPrefix string `json:"vuln_prefix"` SupportPlan string `json:"support_plan"` DateFormat string `json:"date_format"` Mode string `json:"mode"` BlockingType string `json:"blocking_type"` ScannerMode string `json:"scanner_mode"` QratorBlacklists bool `json:"qrator_blacklists"` Notifications struct { ReportDaily struct { Email []interface{} `json:"email"` Telegram []interface{} `json:"telegram"` Slack []interface{} `json:"slack"` Splunk []interface{} `json:"splunk"` PagerDuty []interface{} `json:"pager_duty"` } `json:"report_daily"` ReportWeekly struct { Email []interface{} `json:"email"` Telegram []interface{} `json:"telegram"` Slack []interface{} `json:"slack"` Splunk []interface{} `json:"splunk"` PagerDuty []interface{} `json:"pager_duty"` } `json:"report_weekly"` ReportMonthly struct { Email []interface{} `json:"email"` Telegram []interface{} `json:"telegram"` Slack []interface{} `json:"slack"` Splunk []interface{} `json:"splunk"` PagerDuty []interface{} `json:"pager_duty"` } `json:"report_monthly"` System struct { Email []interface{} `json:"email"` Telegram []interface{} `json:"telegram"` Slack []interface{} `json:"slack"` Splunk []interface{} `json:"splunk"` PagerDuty []interface{} `json:"pager_duty"` } `json:"system"` Vuln struct { Email []interface{} `json:"email"` Telegram []interface{} `json:"telegram"` Slack []interface{} `json:"slack"` Splunk []interface{} `json:"splunk"` PagerDuty []interface{} `json:"pager_duty"` } `json:"vuln"` Scope struct { Email []interface{} `json:"email"` Telegram []interface{} `json:"telegram"` Slack []interface{} `json:"slack"` Splunk []interface{} `json:"splunk"` PagerDuty []interface{} `json:"pager_duty"` } `json:"scope"` } `json:"notifications"` LastScan interface{} `json:"last_scan"` ScannerCluster string `json:"scanner_cluster"` ScannerScopeCluster string `json:"scanner_scope_cluster"` ScannerState struct { LastScan int `json:"last_scan"` LastVuln int `json:"last_vuln"` LastVulnCheck interface{} `json:"last_vuln_check"` LastWapi interface{} `json:"last_wapi"` } `json:"scanner_state"` Language string `json:"language"` AttackRecheckerMode string `json:"attack_rechecker_mode"` VulnRecheckerMode string `json:"vuln_rechecker_mode"` Validated bool `json:"validated"` Enabled bool `json:"enabled"` CreateAt int `json:"create_at"` Partnerid int `json:"partnerid"` CanEnableBlacklist bool `json:"can_enable_blacklist"` BlacklistDisabledAt int `json:"blacklist_disabled_at"` HiddenVulns bool `json:"hidden_vulns"` ScannerPriority string `json:"scanner_priority"` } `json:"body"` }
ClientInfo is the response on the Client Read. It shows the common information about the client.
type ClientRead ¶ added in v0.0.6
type ClientRead struct { Filter *ClientReadFilter `json:"filter"` Limit int `json:"limit"` Offset int `json:"offset"` }
ClientRead is used for filtration of Client Info.
type ClientReadFilter ¶ added in v0.0.6
type ClientReadFilter struct { ClientFilter Enabled bool `json:"enabled,omitempty"` Name string `json:"name,omitempty"` }
ClientReadFilter is the inner object for Filter.
type ClientUpdate ¶ added in v0.0.6
type ClientUpdate struct { Filter *ClientFilter `json:"filter"` Fields *ClientFields `json:"fields"` }
ClientUpdate is a root object for updating.
type EmailIntegrationCreate ¶
type EmailIntegrationCreate struct { Name string `json:"name,omitempty"` Active bool `json:"active"` Target []string `json:"target,omitempty"` Events *[]IntegrationEvents `json:"events,omitempty"` Type string `json:"type,omitempty"` Clientid int `json:"clientid,omitempty"` }
EmailIntegrationCreate is a root object of `Create` action for the `email` integration. Temporary workaround (`Target` is a slice instead of string) to not check type many times. Then it will be changed to interface{} with type checking
type GetVulnFilter ¶
type GetVulnFilter struct {
Status string `json:"status"`
}
GetVulnFilter is used to filter the vulnerability status Possible values: "active", "closed", "falsepositive"
type GetVulnRead ¶
type GetVulnRead struct { Filter *GetVulnFilter `json:"filter"` Limit int `json:"limit"` Offset int `json:"offset"` OrderBy string `json:"order_by"` OrderDesc bool `json:"order_desc"` }
GetVulnRead is a root object for requesting vulnerabilities. Limit is a number between 0 - 1000 Offset is a number between 0 - 1000
type GetVulnReadResp ¶
type GetVulnReadResp struct { Status int `json:"status"` Body []struct { ValidateTime int `json:"validate_time"` InvalidateTime interface{} `json:"invalidate_time"` LastCheck interface{} `json:"last_check"` Incidents interface{} `json:"incidents"` ID int `json:"id"` Wid string `json:"wid"` Template string `json:"template"` Status string `json:"status"` Target string `json:"target"` Type string `json:"type"` Threat int `json:"threat"` Clientid int `json:"clientid"` TestrunID interface{} `json:"testrun_id"` TicketStatus interface{} `json:"ticket_status"` TicketHistory []struct { Time int `json:"time"` Type string `json:"type"` Message string `json:"message"` Link interface{} `json:"link"` } `json:"ticket_history"` Method string `json:"method"` Domain string `json:"domain"` Path string `json:"path"` Parameter string `json:"parameter"` Title string `json:"title"` Description string `json:"description"` Additional string `json:"additional"` ExploitExample string `json:"exploit_example"` Filter []struct { Method string `json:"method"` Domain string `json:"domain"` Path string `json:"path"` Parameter string `json:"parameter"` } `json:"filter"` Validated bool `json:"validated"` Hidden bool `json:"hidden"` DetectionMethod string `json:"detection_method"` VulnRecheckType interface{} `json:"vuln_recheck_type"` TemplateParams struct { Method string `json:"method"` Domain string `json:"domain"` Path string `json:"path"` Parameter string `json:"parameter"` ExploitExample string `json:"exploit_example"` } `json:"template_params,omitempty"` } `json:"body"` }
GetVulnReadResp is the response on the inquiry of vulnerabilities by filter
type HintDelete ¶
type HintDelete struct {
Filter *HintDeleteFilter `json:"filter"`
}
HintDelete is used for removal of Rule by Hint ID.
type HintDeleteFilter ¶
HintDeleteFilter is used as a filter by Hint ID.
type HintFilter ¶
type HintFilter struct { Clientid []int `json:"clientid,omitempty"` ActionID []int `json:"actionid,omitempty"` ID []int `json:"id,omitempty"` NotID []int `json:"!id,omitempty"` NotActionID []int `json:"!actionid,omitempty"` CreateUserid []int `json:"create_userid,omitempty"` NotCreateUserid []int `json:"!create_userid,omitempty"` CreateTime [][]int `json:"create_time,omitempty"` NotCreateTime [][]int `json:"!create_time,omitempty"` System bool `json:"system,omitempty"` Type []string `json:"type,omitempty"` }
HintFilter is used as a filter by Action ID.
type HintRead ¶
type HintRead struct { Filter *HintFilter `json:"filter"` OrderBy string `json:"order_by"` OrderDesc bool `json:"order_desc"` Limit int `json:"limit"` Offset int `json:"offset"` }
HintRead is used to define whether action of the rule exists.
type HintReadResp ¶
type HintReadResp struct { Status int `json:"status"` Body *[]ActionBody `json:"body"` }
HintReadResp is the response of filtered rules by Action ID.
type Integration ¶ added in v0.0.15
type Integration interface { IntegrationCreate(integrationBody *IntegrationCreate) (*IntegrationCreateResp, error) IntegrationUpdate(integrationBody *IntegrationCreate, integrationID int) (*IntegrationCreateResp, error) IntegrationRead(clientID int, id int) (*IntegrationObject, error) IntegrationDelete(integrationID int) error IntegrationWithAPICreate(integrationBody *IntegrationWithAPICreate) (*IntegrationCreateResp, error) IntegrationWithAPIUpdate(integrationBody *IntegrationWithAPICreate, integrationID int) (*IntegrationCreateResp, error) EmailIntegrationCreate(emailBody *EmailIntegrationCreate) (*IntegrationCreateResp, error) EmailIntegrationUpdate(integrationBody *EmailIntegrationCreate, integrationID int) (*IntegrationCreateResp, error) }
Integration contains operations available on Integration resource
type IntegrationCreate ¶
type IntegrationCreate struct { Name string `json:"name"` Active bool `json:"active"` Target string `json:"target"` Events *[]IntegrationEvents `json:"events"` Type string `json:"type"` Clientid int `json:"clientid,omitempty"` }
IntegrationCreate defines how to configure Integration. `Type` possible values: "insight_connect", "opsgenie", "slack",
"pager_duty", "splunk", "sumo_logic"
type IntegrationCreateResp ¶ added in v0.0.7
type IntegrationCreateResp struct { Body struct { Result string `json:"result"` IntegrationObject `json:"object"` } `json:"body"` }
IntegrationCreateResp represents successful creating of an integration entity with the associative parameters.
type IntegrationEvents ¶
IntegrationEvents represents `Events` object while creating a new integration. Event possible values: "hit", "vuln", "system", "scope". If `IntegrationObject.Type` is "opsgenie" possible values: "hit", "vuln". `Active` identifies whether the current Event should be reported.
type IntegrationObject ¶
type IntegrationObject struct { ID int `json:"id"` Active bool `json:"active"` Name string `json:"name"` Type string `json:"type"` CreatedAt int `json:"created_at"` CreatedBy string `json:"created_by"` Target interface{} `json:"target"` Events []struct { IntegrationEvents } `json:"events"` }
IntegrationObject is an inner object for the Read function containing. ID is a unique identifier of the Integration.
type IntegrationRead ¶
type IntegrationRead struct { Body struct { Result string `json:"result"` Object *[]IntegrationObject `json:"object"` } `json:"body"` }
IntegrationRead is the response on the Read action. This is used for correct Unmarshalling of the response as a container.
type IntegrationWithAPICreate ¶
type IntegrationWithAPICreate struct { Name string `json:"name"` Active bool `json:"active"` Target *IntegrationWithAPITarget `json:"target"` Events *[]IntegrationEvents `json:"events"` Type string `json:"type"` Clientid int `json:"clientid,omitempty"` }
IntegrationWithAPICreate is a root object of Create action for Integrations. It aids to set `Events` to trigger this integration. `Type` possible values: "web_hooks" `Target` is a struct for a Webhooks endpoint containing params such as URL, Token, etc.
type IntegrationWithAPITarget ¶
type IntegrationWithAPITarget struct { Token string `json:"token,omitempty"` API string `json:"api,omitempty"` URL string `json:"url,omitempty"` HTTPMethod string `json:"http_method,omitempty"` Headers map[string]interface{} `json:"headers"` CaFile string `json:"ca_file"` CaVerify bool `json:"ca_verify"` Timeout int `json:"timeout,omitempty"` OpenTimeout int `json:"open_timeout,omitempty"` }
IntegrationWithAPITarget is used to create an Integration with the following parameters. On purpose to fulfil a custom Webhooks integration.
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger defines the interface this library needs to use logging This is a subset of the methods implemented in the log package
type Node ¶ added in v0.0.15
type Node interface { NodeCreate(nodeBody *NodeCreate) (*NodeCreateResp, error) NodeDelete(nodeID int) error NodeRead(clientID int, typeNode string) (*NodeRead, error) NodeReadByFilter(getNodeBody *NodeReadByFilter) (*NodeReadPOST, error) }
Node contains operations available on Node resource
type NodeCreate ¶
type NodeCreate struct { Hostname string `json:"hostname"` Type string `json:"type"` Clientid int `json:"clientid"` }
NodeCreate represents options to set for the Node for creating.
type NodeCreateResp ¶
type NodeCreateResp struct { Status int `json:"status"` Body *NodeReadBody `json:"body"` }
NodeCreateResp is the API response on the Create action containing information about one concrete node. Used to get specific parameters of the created Node such as time of last syncronisation along with relevant LOM and Proton files.
type NodeFilter ¶ added in v0.0.5
type NodeFilter struct { UUID string `json:"uuid,omitempty"` IP string `json:"ip,omitempty"` Hostname string `json:"hostname,omitempty"` }
NodeFilter is a filter object to convey for the Node request
type NodeRead ¶ added in v0.0.15
type NodeRead struct { Status int `json:"status"` Body []NodeReadBody `json:"body"` }
NodeRead represents a root object of the fetching action for Nodes. It allows to iterate over several Nodes.
type NodeReadBody ¶ added in v0.0.15
type NodeReadBody struct { *NodeReadBodyPOST ID int `json:"id"` UUID string `json:"uuid"` IP interface{} `json:"ip"` LastActivity interface{} `json:"last_activity"` LastAnalytic interface{} `json:"last_analytic"` ProtondbVersion interface{} `json:"protondb_version"` LomVersion interface{} `json:"lom_version"` InstanceCount int `json:"instance_count"` ActiveInstanceCount int `json:"active_instance_count"` Token string `json:"token"` RequestsAmount int `json:"requests_amount"` Secret string `json:"secret"` }
NodeReadBody is used to find out configurations and parameters of one specific Node.
type NodeReadBodyPOST ¶ added in v0.0.15
type NodeReadBodyPOST struct { Type string `json:"type"` ID string `json:"id"` IP string `json:"ip"` Hostname string `json:"hostname"` LastActivity int `json:"last_activity"` Enabled bool `json:"enabled"` Clientid int `json:"clientid"` LastAnalytic int `json:"last_analytic"` CreateTime int `json:"create_time"` CreateFrom string `json:"create_from"` ProtondbVersion int `json:"protondb_version"` LomVersion int `json:"lom_version"` ProtondbUpdatedAt interface{} `json:"protondb_updated_at"` LomUpdatedAt interface{} `json:"lom_updated_at"` NodeEnvParams struct { Packages struct { } `json:"packages"` } `json:"node_env_params"` Active bool `json:"active"` }
NodeReadBodyPOST is used as an additional response on the GET request to fetch the statuses for all the Nodes.
type NodeReadByFilter ¶ added in v0.0.15
type NodeReadByFilter struct { Filter *NodeFilter `json:"filter"` Limit int `json:"limit"` Offset int `json:"offset"` OrderBy string `json:"order_by,omitempty"` OrderDesc bool `json:"order_desc,omitempty"` }
NodeReadByFilter is used to fetch Nodes by POST method using filter by UUID/IP/Hostname
type NodeReadPOST ¶ added in v0.0.15
type NodeReadPOST struct { Status int `json:"status"` Body []NodeReadBodyPOST `json:"body"` }
NodeReadPOST represents a root object of the fetching of Nodes.
type Option ¶
type Option func(*api) error
Option is a functional option for configuring the API client
func HTTPClient ¶
HTTPClient accepts a custom *http.Client for making API calls.
func Headers ¶
Headers allows you to set custom HTTP headers when making API calls (e.g. for satisfying HTTP proxies, or for debugging).
func UsingBaseURL ¶ added in v0.0.15
UsingBaseURL allows to set the Wallarm API endpoint
func UsingLogger ¶
UsingLogger can be set if you want to get log output from this API instance By default no log output is emitted
type RetryPolicy ¶
RetryPolicy specifies number of retries and min/max retry delays This config is used when the client exponentially backs off after errored requests
type Scanner ¶ added in v0.0.15
type Scanner interface { ScannerCreate(scannerBody *ScannerCreate) (*ScannerCreateBody, error) ScannerDelete(scannerBody *ScannerDelete, resType string) error ScannerUpdate(scannerBody *ScannerUpdate, resType string, resID int) error }
Scanner contains operations available on Scanner resource
type ScannerCreate ¶
ScannerCreate is a request query to put in a new resource.
type ScannerCreateBody ¶
type ScannerCreateBody struct { Body struct { Result string `json:"result"` Objects []struct { Rps interface{} `json:"rps"` ID int `json:"id"` IP string `json:"ip"` Domain string `json:"domain"` New bool `json:"new"` Datacenter interface{} `json:"datacenter"` Disabled bool `json:"disabled"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` LastDisabled interface{} `json:"last_disabled"` Group bool `json:"group"` ParentID int `json:"parent_id"` Clientid int `json:"clientid"` EnabledDomainBinds int `json:"enabled_domain_binds"` DisabledDomainBinds int `json:"disabled_domain_binds"` EnabledServiceBinds int `json:"enabled_service_binds"` DisabledServiceBinds int `json:"disabled_service_binds"` DiscoveredAutomatically bool `json:"discovered_automatically"` DisabledEdge interface{} `json:"disabled_edge"` } `json:"objects"` } `json:"body"` }
ScannerCreateBody is a response on the Create action.
type ScannerDelete ¶
type ScannerDelete struct {
Bulk *[]ScannerDeleteBulk `json:"bulk"`
}
ScannerDelete is used to delete scanner resources in bulk.
type ScannerDeleteBulk ¶
type ScannerDeleteBulk struct {
Filter *ScannerFilter `json:"filter"`
}
ScannerDeleteBulk is used to update scope resource.
type ScannerFilter ¶ added in v0.0.7
type ScannerFilter struct { *ScannerCreate ID []int `json:"id"` }
ScannerFilter is used as a filter for delete query.
type ScannerUpdate ¶
ScannerUpdate is used to update scope resource. The only field is disabling of resource so far.
type Trigger ¶
type Trigger interface { TriggerRead(clientID int) (*TriggerRead, error) TriggerCreate(triggerBody *TriggerCreate, clientID int) (*TriggerCreateResp, error) TriggerDelete(clientID, triggerID int) error TriggerUpdate(triggerBody *TriggerCreate, clientID, triggerID int) (*TriggerResp, error) }
Trigger contains operations available on Triggers resource
type TriggerActions ¶
type TriggerActions struct { ID string `json:"id"` Params struct { IntegrationIds []int `json:"integration_ids,omitempty"` LockTime int `json:"lock_time,omitempty"` } `json:"params"` }
TriggerActions is used to specify params for Trigger["Actions"] which is used as a slice
type TriggerCreate ¶
type TriggerCreate struct {
Trigger *TriggerParam `json:"trigger"`
}
TriggerCreate is used to define JSON body for create action
type TriggerCreateResp ¶ added in v0.0.7
type TriggerCreateResp struct {
*TriggerResp `json:"trigger"`
}
TriggerCreateResp is the response on the creating a trigger.
type TriggerFilters ¶
type TriggerFilters struct { ID string `json:"id"` Operator string `json:"operator"` Values []interface{} `json:"values"` }
TriggerFilters is used to specify params for Trigger["Filters"] which is used as a slice
type TriggerParam ¶ added in v0.0.15
type TriggerParam struct { Filters *[]TriggerFilters `json:"filters"` Actions *[]TriggerActions `json:"actions"` TemplateID string `json:"template_id"` Threshold *TriggerThreshold `json:"threshold"` Enabled bool `json:"enabled"` Name string `json:"name,omitempty"` Comment string `json:"comment,omitempty"` }
TriggerParam is used to specify params for TriggerCreate
type TriggerRead ¶
type TriggerRead struct {
Triggers []TriggerResp `json:"triggers"`
}
TriggerRead is the response which contains information about all the created Triggers within an account
type TriggerResp ¶ added in v0.0.7
type TriggerResp struct { ID int `json:"id"` Name string `json:"name"` Comment interface{} `json:"comment"` Enabled bool `json:"enabled"` ClientID int `json:"client_id"` Filters []interface{} `json:"filters"` Actions []struct { ID string `json:"id"` } `json:"actions"` Thresholds []struct { Operator string `json:"operator"` Period int `json:"period"` Count int `json:"count"` } `json:"thresholds"` Template struct { ID string `json:"id"` Filters []struct { ID string `json:"id"` Required bool `json:"required"` Values []interface{} `json:"values"` AllowedOperators []string `json:"allowed_operators"` Operator string `json:"operator"` } `json:"filters"` Threshold struct { AllowedOperators []string `json:"allowed_operators"` Operator string `json:"operator"` Period int `json:"period"` Count int `json:"count"` } `json:"threshold"` Actions []struct { ID string `json:"id"` Params struct { LockTime int `json:"lock_time"` } `json:"params,omitempty"` } `json:"actions"` } `json:"template"` Threshold struct { Operator string `json:"operator"` Period int `json:"period"` Count int `json:"count"` } `json:"threshold"` }
TriggerResp is returned on successful trigger updating and creating
type TriggerThreshold ¶
type TriggerThreshold struct { Period int `json:"period"` Operator string `json:"operator"` AllowedOperators []string `json:"allowed_operators"` Count int `json:"count"` }
TriggerThreshold is used to specify params for Trigger["Threshold"]
type TwoDimensionalSlice ¶ added in v0.0.11
type TwoDimensionalSlice [][]interface{}
TwoDimensionalSlice is used for Point and HintsCount structures.
type User ¶ added in v0.0.15
type User interface { UserRead(userBody *UserGet) (*UserRead, error) UserCreate(userBody *UserCreate) (*UserDetails, error) UserDelete(userBody *UserDelete) error UserUpdate(userBody *UserUpdate) error UserDetails() (*UserDetails, error) }
User contains operations available on User resource
type UserCreate ¶
type UserCreate struct { Email string `json:"email"` Phone string `json:"phone,omitempty"` Password string `json:"password"` Username string `json:"username"` Realname string `json:"realname"` Permissions []string `json:"permissions"` Clientid int `json:"clientid,omitempty"` }
UserCreate is a POST body for the request to create a new user with the following parameters
type UserDelete ¶
type UserDelete struct {
Filter *UserFilter `json:"filter"`
}
UserDelete is utilised to Delete Users
type UserDetails ¶
type UserDetails struct { Status int `json:"status"` Body *UserParams `json:"body"` }
UserDetails is used as a response for request about the specific User. For example, it may be used to find out a parameter (Client ID) for the current user which auth params are used
type UserFields ¶
type UserFields struct { Phone string `json:"phone,omitempty"` Realname string `json:"realname,omitempty"` Permissions []string `json:"permissions,omitempty"` Clientid int `json:"clientid,omitempty"` Timezone string `json:"timezone,omitempty"` JobTitle string `json:"job_title,omitempty"` ResultsPerPage int `json:"results_per_page,omitempty"` DefaultPool string `json:"default_pool,omitempty"` Enabled bool `json:"enabled,omitempty"` Password string `json:"password,omitempty"` Notifications struct { ReportDaily struct { Email bool `json:"email,omitempty"` Sms bool `json:"sms,omitempty"` } `json:"report_daily,omitempty"` ReportWeekly struct { Email bool `json:"email,omitempty"` Sms bool `json:"sms,omitempty"` } `json:"report_weekly,omitempty"` ReportMonthly struct { Email bool `json:"email,omitempty"` Sms bool `json:"sms,omitempty"` } `json:"report_monthly,omitempty"` System struct { Email bool `json:"email,omitempty"` Sms bool `json:"sms,omitempty"` } `json:"system,omitempty"` Vuln struct { Email bool `json:"email,omitempty"` Sms bool `json:"sms,omitempty"` } `json:"vuln,omitempty"` } `json:"notifications,omitempty"` SearchTemplates struct { } `json:"search_templates,omitempty"` }
UserFields represents fields of the Users for Update function
type UserFilter ¶
type UserFilter struct { ID int `json:"id,omitempty"` Clientid int `json:"clientid,omitempty"` UUID string `json:"uuid,omitempty"` Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` }
UserFilter is intended to filter Users for the Delete purpose
type UserGet ¶
type UserGet struct { Limit int `json:"limit"` OrderBy string `json:"order_by"` OrderDesc bool `json:"order_desc"` Filter *UserFilter `json:"filter"` }
UserGet is used for Read function purposes (to request Users by a GET method)
type UserParams ¶ added in v0.0.6
type UserParams struct { *UserCreate Phone interface{} `json:"phone"` ID int `json:"id"` UUID string `json:"uuid"` ActualPermissions []string `json:"actual_permissions"` MfaEnabled bool `json:"mfa_enabled"` CreateBy int64 `json:"create_by"` CreateAt int `json:"create_at"` CreateFrom string `json:"create_from"` Enabled bool `json:"enabled"` Validated bool `json:"validated"` PasswordChanged int `json:"password_changed"` LoginHistory []struct { Time int `json:"time"` IP string `json:"ip"` } `json:"login_history"` Timezone string `json:"timezone"` ResultsPerPage int `json:"results_per_page"` DefaultPool string `json:"default_pool"` DefaultPoolid interface{} `json:"default_poolid"` LastReadNewsID int `json:"last_read_news_id"` SearchTemplates struct { } `json:"search_templates"` Notifications struct { ReportDaily struct { Email bool `json:"email"` Sms bool `json:"sms"` } `json:"report_daily"` ReportWeekly struct { Email bool `json:"email"` Sms bool `json:"sms"` } `json:"report_weekly"` ReportMonthly struct { Email bool `json:"email"` Sms bool `json:"sms"` } `json:"report_monthly"` Vuln struct { Email bool `json:"email"` Sms bool `json:"sms"` } `json:"vuln"` Scope struct { Email bool `json:"email"` Sms bool `json:"sms"` } `json:"scope"` System struct { Email bool `json:"email"` Sms bool `json:"sms"` } `json:"system"` } `json:"notifications"` Components []string `json:"components"` Language string `json:"language"` LastLoginTime int `json:"last_login_time"` DateFormat string `json:"date_format"` TimeFormat string `json:"time_format"` JobTitle interface{} `json:"job_title"` AvailableAuthentications []string `json:"available_authentications"` FrontendURL string `json:"frontend_url"` }
UserParams wraps the entire parameters of the User entity
type UserRead ¶
type UserRead struct { Status int `json:"status"` Body []UserParams `json:"body"` }
UserRead is used as a response for the Read function for the User endpoints
type UserUpdate ¶
type UserUpdate struct { *UserFilter `json:"filter,omitempty"` *UserFields `json:"fields,omitempty"` Limit int `json:"limit,omitempty"` Offset int `json:"offset,omitempty"` OrderBy string `json:"order_by,omitempty"` OrderDesc bool `json:"order_desc,omitempty"` }
UserUpdate is used to Update Users
type Vulnerability ¶ added in v0.0.15
type Vulnerability interface {
GetVulnRead(getVulnBody *GetVulnRead) (*GetVulnReadResp, error)
}
Vulnerability contains operations available on Vulnerability resource