Documentation
¶
Overview ¶
Package sigsci provides methods for interacting with the Signal Sciences API.
Index ¶
- Constants
- func SetAPIUrl(theURL string)
- type Action
- type ActivityEvent
- type Agent
- type AgentLog
- type Alert
- type AlertUpdateBody
- type Client
- func (sc *Client) AddBlacklistIP(corpName, siteName string, body ListIPBody) (ListIP, error)
- func (sc *Client) AddCorpIntegration(corpName string, body IntegrationBody) (Integration, error)
- func (sc *Client) AddHeaderLink(corpName, siteName string, body HeaderLinkBody) ([]HeaderLink, error)
- func (sc *Client) AddIntegration(corpName, siteName string, body IntegrationBody) ([]Integration, error)
- func (sc *Client) AddRedaction(corpName, siteName string, body RedactionBody) ([]Redaction, error)
- func (sc *Client) AddSiteMember(corpName, siteName, email string) (SiteMemberResponse, error)
- func (sc *Client) AddSiteMembers(corpName, siteName string, body siteMembersBody) ([]SiteMember, error)
- func (sc *Client) AddWhitelistIP(corpName, siteName string, body ListIPBody) (ListIP, error)
- func (sc *Client) CreateCloudWAFInstance(corpName string, body CloudWAFInstanceBody) (CloudWAFInstance, error)
- func (sc *Client) CreateCorpList(corpName string, body CreateListBody) (ResponseListBody, error)
- func (sc *Client) CreateCorpRule(corpName string, body CreateCorpRuleBody) (ResponseCorpRuleBody, error)
- func (sc *Client) CreateCorpSignalTag(corpName string, body CreateSignalTagBody) (ResponseSignalTagBody, error)
- func (sc *Client) CreateCustomAlert(corpName, siteName string, body CustomAlertBody) (CustomAlert, error)
- func (sc *Client) CreateOrUpdateEdgeDeployment(corpName, siteName string) error
- func (sc *Client) CreateOrUpdateEdgeDeploymentService(corpName, siteName, fastlySID string, ...) error
- func (sc *Client) CreateSite(corpName string, body CreateSiteBody) (Site, error)
- func (sc *Client) CreateSiteList(corpName, siteName string, body CreateListBody) (ResponseListBody, error)
- func (sc *Client) CreateSiteRedaction(corpName, siteName string, body CreateSiteRedactionBody) (ResponseSiteRedactionBody, error)
- func (sc *Client) CreateSiteRule(corpName, siteName string, body CreateSiteRuleBody) (ResponseSiteRuleBody, error)
- func (sc *Client) CreateSiteSignalTag(corpName, siteName string, body CreateSignalTagBody) (ResponseSignalTagBody, error)
- func (sc *Client) DeleteBlacklistIP(corpName, siteName, id string) error
- func (sc *Client) DeleteCloudWAFCertificate(corpName, id string) error
- func (sc *Client) DeleteCloudWAFInstance(corpName, id string) error
- func (sc *Client) DeleteCorpIntegration(corpName, id string) error
- func (sc *Client) DeleteCorpListByID(corpName string, id string) error
- func (sc *Client) DeleteCorpRuleByID(corpName, id string) error
- func (sc *Client) DeleteCorpSignalTagByID(corpName string, id string) error
- func (sc *Client) DeleteCorpUser(corpName, email string) error
- func (sc *Client) DeleteCustomAlert(corpName, siteName, id string) error
- func (sc *Client) DeleteEdgeDeployment(corpName, siteName string) error
- func (sc *Client) DeleteHeaderLink(corpName, siteName, id string) error
- func (sc *Client) DeleteIntegration(corpName, siteName, id string) error
- func (sc *Client) DeleteRedaction(corpName, siteName, id string) error
- func (sc *Client) DeleteSite(corpName, siteName string) error
- func (sc *Client) DeleteSiteListByID(corpName, siteName string, id string) error
- func (sc *Client) DeleteSiteMember(corpName, siteName, email string) error
- func (sc *Client) DeleteSiteMonitor(corpName, siteName, id string) error
- func (sc *Client) DeleteSiteRedactionByID(corpName, siteName string, id string) error
- func (sc *Client) DeleteSiteRuleByID(corpName, siteName, id string) error
- func (sc *Client) DeleteSiteSignalTagByID(corpName, siteName, id string) error
- func (sc *Client) DeleteWhitelistIP(corpName, siteName, id string) error
- func (sc *Client) DetachEdgeDeploymentService(corpName, siteName, fastlySID string) error
- func (sc *Client) ExpireEvent(corpName, siteName, id string) (Event, error)
- func (sc *Client) GenerateSiteMonitor(corpName, siteName string) (SiteMonitor, error)
- func (sc *Client) GenerateSiteMonitorDashboard(corpName, siteName, dashboard string) (SiteMonitor, error)
- func (sc *Client) GetAgent(corpName, siteName, agentName string) (Agent, error)
- func (sc *Client) GetAgentLogs(corpName, siteName, agentName string) ([]AgentLog, error)
- func (sc *Client) GetAllCorpLists(corpName string) (ResponseListBodyList, error)
- func (sc *Client) GetAllCorpRules(corpName string) (ResponseCorpRuleBodyList, error)
- func (sc *Client) GetAllCorpSignalTags(corpName string) (ResponseSignalTagBodyList, error)
- func (sc *Client) GetAllSiteLists(corpName, siteName string) (ResponseListBodyList, error)
- func (sc *Client) GetAllSiteRedactions(corpName, siteName string) (ResponseSiteRedactionBodyList, error)
- func (sc *Client) GetAllSiteRules(corpName, siteName string) (ResponseSiteRuleBodyList, error)
- func (sc *Client) GetAllSiteSignalTags(corpName, siteName string) (ResponseSignalTagBodyList, error)
- func (sc *Client) GetCloudWAFCertificate(corpName, id string) (CloudWAFCertificate, error)
- func (sc *Client) GetCloudWAFInstance(corpName, id string) (CloudWAFInstance, error)
- func (sc *Client) GetCorp(corpName string) (Corp, error)
- func (sc *Client) GetCorpIntegration(corpName, id string) (Integration, error)
- func (sc *Client) GetCorpListByID(corpName string, id string) (ResponseListBody, error)
- func (sc *Client) GetCorpRuleByID(corpName, id string) (ResponseCorpRuleBody, error)
- func (sc *Client) GetCorpSignalTagByID(corpName string, id string) (ResponseSignalTagBody, error)
- func (sc *Client) GetCorpUser(corpName, email string) (CorpUser, error)
- func (sc *Client) GetCustomAlert(corpName, siteName, id string) (CustomAlert, error)
- func (sc *Client) GetEvent(corpName, siteName, id string) (Event, error)
- func (sc *Client) GetHeaderLink(corpName, siteName, id string) (HeaderLink, error)
- func (sc *Client) GetIntegration(corpName, siteName, id string) (Integration, error)
- func (sc *Client) GetOverviewReport(corpName string, query url.Values) ([]OverviewSite, error)
- func (sc *Client) GetRedaction(corpName, siteName, id string) (Redaction, error)
- func (sc *Client) GetRequest(corpName, siteName, id string) (Request, error)
- func (sc *Client) GetRequestFeed(corpName, siteName string, query url.Values) (next string, requests []Request, err error)
- func (sc *Client) GetSite(corpName, siteName string) (Site, error)
- func (sc *Client) GetSiteListByID(corpName, siteName string, id string) (ResponseListBody, error)
- func (sc *Client) GetSiteMember(corpName, siteName, email string) (SiteMember, error)
- func (sc *Client) GetSiteMonitor(corpName, siteName, email string) ([]SiteMonitor, error)
- func (sc *Client) GetSitePrimaryAgentKey(corpName, siteName string) (PrimaryAgentKey, error)
- func (sc *Client) GetSiteRedactionByID(corpName, siteName, id string) (ResponseSiteRedactionBody, error)
- func (sc *Client) GetSiteRuleByID(corpName, siteName, id string) (ResponseSiteRuleBody, error)
- func (sc *Client) GetSiteSignalTagByID(corpName, siteName, id string) (ResponseSignalTagBody, error)
- func (sc *Client) GetSiteTemplateRuleByID(corpName, siteName, id string) (SiteTemplate, error)
- func (sc *Client) GetTimeseries(corpName, siteName string, query url.Values) ([]Timeseries, error)
- func (sc *Client) InviteSiteMember(corpName, siteName, email string, body SiteMemberBody) (SiteMemberResponse, error)
- func (sc *Client) InviteUser(corpName, email string, invite CorpUserInvite) (CorpUser, error)
- func (sc *Client) ListAgents(corpName, siteName string) ([]Agent, error)
- func (sc *Client) ListBlacklistIPs(corpName, siteName string) ([]ListIP, error)
- func (sc *Client) ListCloudWAFCertificates(corpName string) ([]CloudWAFCertificate, error)
- func (sc *Client) ListCloudWAFInstances(corpName string) ([]CloudWAFInstance, error)
- func (sc *Client) ListCorpActivity(corpName string, limit, page int) ([]ActivityEvent, error)
- func (sc *Client) ListCorpUsers(corpName string) ([]CorpUser, error)
- func (sc *Client) ListCorps() ([]Corp, error)
- func (sc *Client) ListCustomAlerts(corpName, siteName string) ([]CustomAlert, error)
- func (sc *Client) ListEvents(corpName, siteName string, query url.Values) ([]Event, error)
- func (sc *Client) ListHeaderLinks(corpName, siteName string) ([]HeaderLink, error)
- func (sc *Client) ListIntegrations(corpName, siteName string) ([]Integration, error)
- func (sc *Client) ListParams(corpName, siteName string) ([]Param, error)
- func (sc *Client) ListPaths(corpName, siteName string) ([]Path, error)
- func (sc *Client) ListRedactions(corpName, siteName string) ([]Redaction, error)
- func (sc *Client) ListSiteActivity(corpName, siteName string, limit, page int) ([]ActivityEvent, error)
- func (sc *Client) ListSiteMembers(corpName, siteName string) ([]SiteMember, error)
- func (sc *Client) ListSites(corpName string) ([]Site, error)
- func (sc *Client) ListSuspiciousIPs(corpName, siteName string) ([]SuspiciousIP, error)
- func (sc *Client) ListTopAttacks(corpName, siteName string, query url.Values) ([]TopAttack, error)
- func (sc *Client) ListWhitelistIPs(corpName, siteName string) ([]ListIP, error)
- func (sc *Client) RestartCloudWAFInstance(corpName, id string) error
- func (sc *Client) SearchRequests(corpName, siteName string, query url.Values) (totalCount int, next string, requests []Request, err error)
- func (c *Client) SetFastlyKey(fastlyKey string)
- func (sc *Client) UpdateCloudWAFCertificate(corpName, id string, body UpdateCloudWAFCertificateBody) (CloudWAFCertificate, error)
- func (sc *Client) UpdateCloudWAFInstance(corpName, id string, body CloudWAFInstanceBody) error
- func (sc *Client) UpdateCorp(corpName string, body UpdateCorpBody) (Corp, error)
- func (sc *Client) UpdateCorpIntegration(corpName, id string, body UpdateIntegrationBody) error
- func (sc *Client) UpdateCorpListByID(corpName string, id string, body UpdateListBody) (ResponseListBody, error)
- func (sc *Client) UpdateCorpRuleByID(corpName, id string, body CreateCorpRuleBody) (ResponseCorpRuleBody, error)
- func (sc *Client) UpdateCorpSignalTagByID(corpName string, id string, body UpdateSignalTagBody) (ResponseSignalTagBody, error)
- func (sc *Client) UpdateCustomAlert(corpName, siteName, id string, body CustomAlertBody) (CustomAlert, error)
- func (sc *Client) UpdateEdgeDeploymentBackends(corpName, siteName, fastlySID string) error
- func (sc *Client) UpdateIntegration(corpName, siteName, id string, body UpdateIntegrationBody) error
- func (sc *Client) UpdateRedaction(corpName, siteName, id string, body UpdateRedactionBody) (Redaction, error)
- func (sc *Client) UpdateSite(corpName, siteName string, body UpdateSiteBody) (Site, error)
- func (sc *Client) UpdateSiteListByID(corpName, siteName string, id string, body UpdateListBody) (ResponseListBody, error)
- func (sc *Client) UpdateSiteMonitor(corpName, siteName, id string, body UpdateSiteMonitorBody) error
- func (sc *Client) UpdateSiteRedactionByID(corpName, siteName string, id string, body CreateSiteRedactionBody) (ResponseSiteRedactionBody, error)
- func (sc *Client) UpdateSiteRuleByID(corpName, siteName, id string, body CreateSiteRuleBody) (ResponseSiteRuleBody, error)
- func (sc *Client) UpdateSiteSignalTagByID(corpName, siteName, id string, body UpdateSignalTagBody) (ResponseSignalTagBody, error)
- func (sc *Client) UpdateSiteTemplateRuleByID(corpName, siteName, id string, body SiteTemplateRuleBody) (SiteTemplate, error)
- func (sc *Client) UploadCloudWAFCertificate(corpName string, body UploadCloudWAFCertificateBody) (ResponseCloudWAFCertificateBody, error)
- type ClientIPRules
- type ClientIdentifier
- type CloudWAFCertificate
- type CloudWAFCertificateBase
- type CloudWAFInstance
- type CloudWAFInstanceBody
- type CloudWAFInstanceDeployment
- type CloudWAFInstanceEgressIP
- type CloudWAFInstanceWorkspaceConfig
- type CloudWAFInstanceWorkspaceRoute
- type Condition
- type ConfiguredDetectionField
- type Corp
- type CorpUser
- type CorpUserInvite
- type CreateCorpRuleBody
- type CreateListBody
- type CreateOrUpdateEdgeDeploymentServiceBody
- type CreateSignalTagBody
- type CreateSiteBody
- type CreateSiteRedactionBody
- type CreateSiteRuleBody
- type CustomAlert
- type CustomAlertBody
- type Detection
- type DetectionUpdateBody
- type Entries
- type Event
- type HeaderLink
- type HeaderLinkBody
- type Integration
- type IntegrationBody
- type ListIP
- type ListIPBody
- type OverviewSite
- type Param
- type Path
- type PrimaryAgentKey
- type RateLimit
- type Redaction
- type RedactionBody
- type Request
- type RequestTag
- type ResponseCloudWAFCertificateBody
- type ResponseCorpRuleBody
- type ResponseCorpRuleBodyList
- type ResponseListBody
- type ResponseListBodyList
- type ResponseSignalTagBody
- type ResponseSignalTagBodyList
- type ResponseSiteRedactionBody
- type ResponseSiteRedactionBodyList
- type ResponseSiteRuleBody
- type ResponseSiteRuleBodyList
- type Role
- type Site
- type SiteMember
- type SiteMemberBody
- type SiteMemberResponse
- type SiteMemberUser
- type SiteMembership
- type SiteMonitor
- type SiteMonitorResp
- type SiteTemplate
- type SiteTemplateRuleBody
- type SuspiciousIP
- type Timeseries
- type TopAttack
- type UpdateCloudWAFCertificateBody
- type UpdateCorpBody
- type UpdateIntegrationBody
- type UpdateListBody
- type UpdateRedactionBody
- type UpdateSignalTagBody
- type UpdateSiteBody
- type UpdateSiteMonitorBody
- type UploadCloudWAFCertificateBody
Examples ¶
Constants ¶
const ( RoleNoAccess = Role("none") RoleUnknown = Role("unknown") RoleOwner = Role("owner") RoleAdmin = Role("admin") RoleUser = Role("user") RoleObserver = Role("observer") // Deprecated corp/site roles RoleSiteNoAccess = Role("none") RoleSiteUnknown = Role("unknown") RoleSiteOwner = Role("owner") RoleSiteAdmin = Role("admin") RoleSiteUser = Role("user") RoleSiteObserver = Role("observer") RoleCorpOwner = Role("corpOwner") RoleCorpUser = Role("corpUser") )
All available Roles
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶ added in v0.1.1
type Action struct { Type string `json:"type,omitempty"` //(block, allow, exclude) Signal string `json:"signal,omitempty"` ResponseCode int `json:"responseCode,omitempty"` //(400-499) }
Action contains the rule action
type ActivityEvent ¶
type ActivityEvent struct { ID string EventType string MsgData map[string]string Message string Attachments []struct{} Created time.Time }
ActivityEvent contains the data for activity page responses.
type Agent ¶
type Agent struct { AgentActive bool `json:"agent.active"` AgentAddr string `json:"agent.addr"` AgentArgs string `json:"agent.args"` AgentBuildID string `json:"agent.build_id"` AgentCGroup string `json:"agent.cgroup"` AgentConnectionsDropped int `json:"agent.connections_dropped"` AgentConnectionsOpen int `json:"agent.connections_open"` AgentConnectionsTotal int `json:"agent.connections_total"` AgentCurrentRequests int `json:"agent.current_requests"` AgentDecisionTime50th float64 `json:"agent.decision_time_50th"` AgentDecisionTime95th float64 `json:"agent.decision_time_95th"` AgentDecisionTime99th float64 `json:"agent.decision_time_99th"` AgentEnabled bool `json:"agent.enabled"` AgentLastRuleUpdate time.Time `json:"agent.last_rule_update"` AgentLastSeen time.Time `json:"agent.last_seen"` AgentLatencyTime50th float64 `json:"agent.latency_time_50th"` AgentLatencyTime95th float64 `json:"agent.latency_time_95th"` AgentLatencyTime99th float64 `json:"agent.latency_time_99th"` AgentMaxProcs int `json:"agent.max_procs"` AgentName string `json:"agent.name"` AgentPID int `json:"agent.pid"` AgentReadBytes int `json:"agent.read_bytes"` AgentRPCPostrequest int `json:"agent.rpc_postrequest"` AgentRPCPrerequest int `json:"agent.rpc_prerequest"` AgentRPCUpdaterequest int `json:"agent.rpc_updaterequest"` AgentRuleUpdates int `json:"agent.rule_updates"` AgentStatus string `json:"agent.status"` AgentTimestamp int `json:"agent.timestamp"` AgentTimezone string `json:"agent.timezone"` AgentTimezoneOffset int `json:"agent.timezone_offset"` AgentUploadMetadataFailures int `json:"agent.upload_metadata_failures"` AgentUploadSize int `json:"agent.upload_size"` AgentUptime int `json:"agent.uptime"` AgentVersion string `json:"agent.version"` AgentVersionsBehind int `json:"agent.versions_behind"` AgentWriteBytes int `json:"agent.write_bytes"` HostAgentCPU float64 `json:"host.agent_cpu"` HostArchitecture string `json:"host.architecture"` HostClockSkew int `json:"host.clock_skew"` HostCPU float64 `json:"host.cpu"` HostCPUMhz int `json:"host.cpu_mhz"` HostInstanceType string `json:"host.instance_type"` HostNumCPU int `json:"host.num_cpu"` HostOS string `json:"host.os"` HostRemoteAddr string `json:"host.remote_addr"` ModuleDetected bool `json:"module.detected"` ModuleServer string `json:"module.server"` ModuleType string `json:"module.type"` ModuleVersion string `json:"module.version"` ModuleVersionsBehind int `json:"module.versions_behind"` RuntimeGcPauseMillis float64 `json:"runtime.gc_pause_millis"` RuntimeMemSize int `json:"mem_size"` RuntimeNumGc int `json:"num_gc"` RuntimeNumGoroutines int `json:"num_goroutines"` }
Agent contains the data for an agent
type AgentLog ¶
type AgentLog struct { Hostname string `json:"hostName"` LogLevel string `json:"logLevel"` Message string `json:"message"` CreatedAt time.Time `json:"createdAt"` }
AgentLog is an agent log
type Alert ¶ added in v0.1.1
type Alert struct { AlertUpdateBody ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` TagName string `json:"tag_name,omitempty"` FieldName string `json:"field_name,omitempty"` Created *time.Time `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` }
Alert basic struct for an Alert
type AlertUpdateBody ¶ added in v0.1.1
type AlertUpdateBody struct { LongName string `json:"longName"` Interval int `json:"interval"` // 1, 10 or 60 Threshold int `json:"threshold"` // greater than 0, max 10000 SkipNotifications bool `json:"skipNotifications,omitempty"` Enabled bool `json:"enabled"` Action string `json:"action"` BlockDurationSeconds int `json:"blockDurationSeconds,omitempty"` }
AlertUpdateBody body needed to update an alert
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the API client
func NewTokenClient ¶
NewTokenClient creates a Client using token authentication
func (*Client) AddBlacklistIP ¶
func (sc *Client) AddBlacklistIP(corpName, siteName string, body ListIPBody) (ListIP, error)
AddBlacklistIP adds an IP address to the blacklist.
func (*Client) AddCorpIntegration ¶ added in v0.1.1
func (sc *Client) AddCorpIntegration(corpName string, body IntegrationBody) (Integration, error)
AddCorpIntegration adds an integration.
func (*Client) AddHeaderLink ¶
func (sc *Client) AddHeaderLink(corpName, siteName string, body HeaderLinkBody) ([]HeaderLink, error)
AddHeaderLink adds a header link.
func (*Client) AddIntegration ¶
func (sc *Client) AddIntegration(corpName, siteName string, body IntegrationBody) ([]Integration, error)
AddIntegration adds an integration.
func (*Client) AddRedaction ¶
func (sc *Client) AddRedaction(corpName, siteName string, body RedactionBody) ([]Redaction, error)
AddRedaction adds a redaction.
func (*Client) AddSiteMember ¶
func (sc *Client) AddSiteMember(corpName, siteName, email string) (SiteMemberResponse, error)
AddSiteMember adds an existing user to a site by email.
func (*Client) AddSiteMembers ¶
func (sc *Client) AddSiteMembers(corpName, siteName string, body siteMembersBody) ([]SiteMember, error)
AddSiteMembers adds one or more existing users to a site.
func (*Client) AddWhitelistIP ¶
func (sc *Client) AddWhitelistIP(corpName, siteName string, body ListIPBody) (ListIP, error)
AddWhitelistIP adds an IP address to the whitelist.
func (*Client) CreateCloudWAFInstance ¶ added in v0.1.5
func (sc *Client) CreateCloudWAFInstance(corpName string, body CloudWAFInstanceBody) (CloudWAFInstance, error)
CreateCloudWAFInstance adds a Cloud WAF instance.
func (*Client) CreateCorpList ¶ added in v0.1.1
func (sc *Client) CreateCorpList(corpName string, body CreateListBody) (ResponseListBody, error)
CreateCorpList corp list
func (*Client) CreateCorpRule ¶ added in v0.1.1
func (sc *Client) CreateCorpRule(corpName string, body CreateCorpRuleBody) (ResponseCorpRuleBody, error)
CreateCorpRule creates a rule and returns the response
func (*Client) CreateCorpSignalTag ¶ added in v0.1.1
func (sc *Client) CreateCorpSignalTag(corpName string, body CreateSignalTagBody) (ResponseSignalTagBody, error)
CreateCorpSignalTag create signal tag
func (*Client) CreateCustomAlert ¶
func (sc *Client) CreateCustomAlert(corpName, siteName string, body CustomAlertBody) (CustomAlert, error)
CreateCustomAlert creates a custom alert.
func (*Client) CreateOrUpdateEdgeDeployment ¶ added in v0.1.9
CreateOrUpdateEdgeDeployment initializes the Next-Gen WAF deployment in Compute@Edge and configures the site for Edge Deployment.
func (*Client) CreateOrUpdateEdgeDeploymentService ¶ added in v0.1.9
func (sc *Client) CreateOrUpdateEdgeDeploymentService(corpName, siteName, fastlySID string, body CreateOrUpdateEdgeDeploymentServiceBody) error
CreateOrUpdateEdgeDeploymentService copies the backends from the Fastly service to the Edge Deployment and pre-configures the Fastly service with an edge dictionary and custom VCL.
func (*Client) CreateSite ¶ added in v0.1.1
func (sc *Client) CreateSite(corpName string, body CreateSiteBody) (Site, error)
CreateSite Creates a site in a corp.
func (*Client) CreateSiteList ¶ added in v0.1.1
func (sc *Client) CreateSiteList(corpName, siteName string, body CreateListBody) (ResponseListBody, error)
CreateSiteList Create a site list
func (*Client) CreateSiteRedaction ¶ added in v0.1.1
func (sc *Client) CreateSiteRedaction(corpName, siteName string, body CreateSiteRedactionBody) (ResponseSiteRedactionBody, error)
CreateSiteRedaction Create a site list
func (*Client) CreateSiteRule ¶ added in v0.1.1
func (sc *Client) CreateSiteRule(corpName, siteName string, body CreateSiteRuleBody) (ResponseSiteRuleBody, error)
CreateSiteRule creates a rule and returns the response
func (*Client) CreateSiteSignalTag ¶ added in v0.1.1
func (sc *Client) CreateSiteSignalTag(corpName, siteName string, body CreateSignalTagBody) (ResponseSignalTagBody, error)
CreateSiteSignalTag create signal tag
func (*Client) DeleteBlacklistIP ¶
DeleteBlacklistIP deletes a blacklisted IP by id.
func (*Client) DeleteCloudWAFCertificate ¶ added in v0.1.6
DeleteCloudWAFCertificate deletes a Cloud WAF certificate by id.
func (*Client) DeleteCloudWAFInstance ¶ added in v0.1.5
DeleteCloudWAFInstance deletes a Cloud WAF instance by id.
func (*Client) DeleteCorpIntegration ¶ added in v0.1.1
DeleteCorpIntegration deletes a redaction by id.
func (*Client) DeleteCorpListByID ¶ added in v0.1.1
DeleteCorpListByID deletes a rule and returns an error
func (*Client) DeleteCorpRuleByID ¶ added in v0.1.1
DeleteCorpRuleByID deletes a rule and returns an error
func (*Client) DeleteCorpSignalTagByID ¶ added in v0.1.1
DeleteCorpSignalTagByID delete signal tag by id
func (*Client) DeleteCorpUser ¶
DeleteCorpUser deletes a user from the given corp.
func (*Client) DeleteCustomAlert ¶
DeleteCustomAlert deletes a custom alert.
func (*Client) DeleteEdgeDeployment ¶ added in v0.1.9
DeleteEdgeDeployment deletes an edge deployment
func (*Client) DeleteHeaderLink ¶
DeleteHeaderLink deletes a header link by id.
func (*Client) DeleteIntegration ¶
DeleteIntegration deletes a redaction by id.
func (*Client) DeleteRedaction ¶
DeleteRedaction deletes a redaction by id.
func (*Client) DeleteSite ¶ added in v0.1.1
DeleteSite deletes the site
func (*Client) DeleteSiteListByID ¶ added in v0.1.1
DeleteSiteListByID deletes a rule and returns an error
func (*Client) DeleteSiteMember ¶
DeleteSiteMember deletes a site member by email.
func (*Client) DeleteSiteMonitor ¶ added in v0.1.1
DeleteSiteMonitor Deletes the site monitor URL for a given site.
func (*Client) DeleteSiteRedactionByID ¶ added in v0.1.1
DeleteSiteRedactionByID deletes a redaction and returns an error
func (*Client) DeleteSiteRuleByID ¶ added in v0.1.1
DeleteSiteRuleByID deletes a rule and returns an error
func (*Client) DeleteSiteSignalTagByID ¶ added in v0.1.1
DeleteSiteSignalTagByID delete signal tag by id
func (*Client) DeleteWhitelistIP ¶
DeleteWhitelistIP deletes a whitelisted IP by id.
func (*Client) DetachEdgeDeploymentService ¶ added in v0.1.9
DetachEdgeDeploymentService removes all backends from the Edge Deployment connected to the Fastly service and detaches the Fastly Service from the Edge Deployment.
func (*Client) ExpireEvent ¶
ExpireEvent expires an event by ID.
func (*Client) GenerateSiteMonitor ¶
func (sc *Client) GenerateSiteMonitor(corpName, siteName string) (SiteMonitor, error)
GenerateSiteMonitor generates a site monitor URL.
func (*Client) GenerateSiteMonitorDashboard ¶ added in v0.1.1
func (sc *Client) GenerateSiteMonitorDashboard(corpName, siteName, dashboard string) (SiteMonitor, error)
GenerateSiteMonitorDashboard generates a site monitor URL for a dashboard.
func (*Client) GetAgentLogs ¶
GetAgentLogs gets agent logs for a given agent.
func (*Client) GetAllCorpLists ¶ added in v0.1.1
func (sc *Client) GetAllCorpLists(corpName string) (ResponseListBodyList, error)
GetAllCorpLists get all corp lists
func (*Client) GetAllCorpRules ¶ added in v0.1.1
func (sc *Client) GetAllCorpRules(corpName string) (ResponseCorpRuleBodyList, error)
GetAllCorpRules get all corp rules
func (*Client) GetAllCorpSignalTags ¶ added in v0.1.1
func (sc *Client) GetAllCorpSignalTags(corpName string) (ResponseSignalTagBodyList, error)
GetAllCorpSignalTags get all corp signals
func (*Client) GetAllSiteLists ¶ added in v0.1.1
func (sc *Client) GetAllSiteLists(corpName, siteName string) (ResponseListBodyList, error)
GetAllSiteLists get all site lists
func (*Client) GetAllSiteRedactions ¶ added in v0.1.1
func (sc *Client) GetAllSiteRedactions(corpName, siteName string) (ResponseSiteRedactionBodyList, error)
GetAllSiteRedactions Lists the Sites Redactions
func (*Client) GetAllSiteRules ¶ added in v0.1.1
func (sc *Client) GetAllSiteRules(corpName, siteName string) (ResponseSiteRuleBodyList, error)
GetAllSiteRules Lists the Site Rules
func (*Client) GetAllSiteSignalTags ¶ added in v0.1.1
func (sc *Client) GetAllSiteSignalTags(corpName, siteName string) (ResponseSignalTagBodyList, error)
GetAllSiteSignalTags get all site signals
func (*Client) GetCloudWAFCertificate ¶ added in v0.1.6
func (sc *Client) GetCloudWAFCertificate(corpName, id string) (CloudWAFCertificate, error)
GetCloudWAFCertificate gets a Cloud WAF certificate by id.
func (*Client) GetCloudWAFInstance ¶ added in v0.1.5
func (sc *Client) GetCloudWAFInstance(corpName, id string) (CloudWAFInstance, error)
GetCloudWAFInstance gets a Cloud WAF instance by id.
func (*Client) GetCorpIntegration ¶ added in v0.1.1
func (sc *Client) GetCorpIntegration(corpName, id string) (Integration, error)
GetCorpIntegration gets an integration by id.
func (*Client) GetCorpListByID ¶ added in v0.1.1
func (sc *Client) GetCorpListByID(corpName string, id string) (ResponseListBody, error)
GetCorpListByID get corp list by ID
func (*Client) GetCorpRuleByID ¶ added in v0.1.1
func (sc *Client) GetCorpRuleByID(corpName, id string) (ResponseCorpRuleBody, error)
GetCorpRuleByID get a site rule by id
func (*Client) GetCorpSignalTagByID ¶ added in v0.1.1
func (sc *Client) GetCorpSignalTagByID(corpName string, id string) (ResponseSignalTagBody, error)
GetCorpSignalTagByID get corp signal by id
func (*Client) GetCorpUser ¶
GetCorpUser gets a corp user by email.
func (*Client) GetCustomAlert ¶
func (sc *Client) GetCustomAlert(corpName, siteName, id string) (CustomAlert, error)
GetCustomAlert gets a custom alert by ID
func (*Client) GetHeaderLink ¶
func (sc *Client) GetHeaderLink(corpName, siteName, id string) (HeaderLink, error)
GetHeaderLink gets a header link by id.
func (*Client) GetIntegration ¶
func (sc *Client) GetIntegration(corpName, siteName, id string) (Integration, error)
GetIntegration gets an integration by id.
func (*Client) GetOverviewReport ¶
GetOverviewReport gets the overview report data for a given corp.
func (*Client) GetRedaction ¶
GetRedaction gets a redaction by id.
func (*Client) GetRequest ¶
GetRequest gets a request by id.
func (*Client) GetRequestFeed ¶
func (sc *Client) GetRequestFeed(corpName, siteName string, query url.Values) (next string, requests []Request, err error)
GetRequestFeed gets the request feed for the site.
func (*Client) GetSiteListByID ¶ added in v0.1.1
func (sc *Client) GetSiteListByID(corpName, siteName string, id string) (ResponseListBody, error)
GetSiteListByID get site list by ID
func (*Client) GetSiteMember ¶
func (sc *Client) GetSiteMember(corpName, siteName, email string) (SiteMember, error)
GetSiteMember gets a site member by email.
func (*Client) GetSiteMonitor ¶
func (sc *Client) GetSiteMonitor(corpName, siteName, email string) ([]SiteMonitor, error)
GetSiteMonitor gets the site monitor URL.
func (*Client) GetSitePrimaryAgentKey ¶ added in v0.1.2
func (sc *Client) GetSitePrimaryAgentKey(corpName, siteName string) (PrimaryAgentKey, error)
GetSitePrimaryAgentKey retrieve the primary agent keys
func (*Client) GetSiteRedactionByID ¶ added in v0.1.1
func (sc *Client) GetSiteRedactionByID(corpName, siteName, id string) (ResponseSiteRedactionBody, error)
GetSiteRedactionByID get a site redaction by id
func (*Client) GetSiteRuleByID ¶ added in v0.1.1
func (sc *Client) GetSiteRuleByID(corpName, siteName, id string) (ResponseSiteRuleBody, error)
GetSiteRuleByID get a site rule by id
func (*Client) GetSiteSignalTagByID ¶ added in v0.1.1
func (sc *Client) GetSiteSignalTagByID(corpName, siteName, id string) (ResponseSignalTagBody, error)
GetSiteSignalTagByID get site signal by id
func (*Client) GetSiteTemplateRuleByID ¶ added in v0.1.1
func (sc *Client) GetSiteTemplateRuleByID(corpName, siteName, id string) (SiteTemplate, error)
GetSiteTemplateRuleByID retrieves a site template rule
func (*Client) GetTimeseries ¶
GetTimeseries gets timeseries request info.
func (*Client) InviteSiteMember ¶
func (sc *Client) InviteSiteMember(corpName, siteName, email string, body SiteMemberBody) (SiteMemberResponse, error)
InviteSiteMember invites a new user to a site by email.
func (*Client) InviteUser ¶
func (sc *Client) InviteUser(corpName, email string, invite CorpUserInvite) (CorpUser, error)
InviteUser invites a user by email to a corp.
Example ¶
email := testcreds.email password := testcreds.token sc, err := NewClient(email, password) if err != nil { log.Fatal(err) } invite := NewCorpUserInvite(RoleCorpUser, []SiteMembership{ NewSiteMembership(testcreds.site, RoleSiteOwner), }) _, err = sc.InviteUser(testcreds.corp, "test@test.net", invite) if err != nil { log.Fatal(err) }
Output:
func (*Client) ListAgents ¶
ListAgents lists agents for a given corp and site.
func (*Client) ListBlacklistIPs ¶
ListBlacklistIPs lists blacklisted IP addresses.
func (*Client) ListCloudWAFCertificates ¶ added in v0.1.6
func (sc *Client) ListCloudWAFCertificates(corpName string) ([]CloudWAFCertificate, error)
ListCloudWAFCertificates lists Cloud WAF certificates.
func (*Client) ListCloudWAFInstances ¶ added in v0.1.5
func (sc *Client) ListCloudWAFInstances(corpName string) ([]CloudWAFInstance, error)
ListCloudWAFInstances lists Cloud WAF instances.
func (*Client) ListCorpActivity ¶
func (sc *Client) ListCorpActivity(corpName string, limit, page int) ([]ActivityEvent, error)
ListCorpActivity lists activity events for a given corp.
func (*Client) ListCorpUsers ¶
ListCorpUsers lists corp users.
func (*Client) ListCustomAlerts ¶
func (sc *Client) ListCustomAlerts(corpName, siteName string) ([]CustomAlert, error)
ListCustomAlerts lists custom alerts for a given corp and site.
func (*Client) ListEvents ¶
ListEvents lists events for a given site.
func (*Client) ListHeaderLinks ¶
func (sc *Client) ListHeaderLinks(corpName, siteName string) ([]HeaderLink, error)
ListHeaderLinks lists header links.
func (*Client) ListIntegrations ¶
func (sc *Client) ListIntegrations(corpName, siteName string) ([]Integration, error)
ListIntegrations lists integrations.
func (*Client) ListParams ¶
ListParams lists whitelisted parameters.
func (*Client) ListRedactions ¶
ListRedactions lists redactions.
func (*Client) ListSiteActivity ¶
func (sc *Client) ListSiteActivity(corpName, siteName string, limit, page int) ([]ActivityEvent, error)
ListSiteActivity lists activity events for a given site.
func (*Client) ListSiteMembers ¶
func (sc *Client) ListSiteMembers(corpName, siteName string) ([]SiteMember, error)
ListSiteMembers lists site members.
func (*Client) ListSuspiciousIPs ¶
func (sc *Client) ListSuspiciousIPs(corpName, siteName string) ([]SuspiciousIP, error)
ListSuspiciousIPs lists suspicious IPs.
func (*Client) ListTopAttacks ¶
ListTopAttacks lists top attacks.
func (*Client) ListWhitelistIPs ¶
ListWhitelistIPs lists whitelisted IP addresses.
func (*Client) RestartCloudWAFInstance ¶ added in v0.1.5
RestartCloudWAFInstance restarts a Cloud WAF instance by id.
func (*Client) SearchRequests ¶
func (sc *Client) SearchRequests(corpName, siteName string, query url.Values) (totalCount int, next string, requests []Request, err error)
SearchRequests searches requests.
func (*Client) SetFastlyKey ¶ added in v0.1.9
func (*Client) UpdateCloudWAFCertificate ¶ added in v0.1.6
func (sc *Client) UpdateCloudWAFCertificate(corpName, id string, body UpdateCloudWAFCertificateBody) (CloudWAFCertificate, error)
UpdateCloudWAFCertificate updates a Cloud WAF certificate by id.
func (*Client) UpdateCloudWAFInstance ¶ added in v0.1.5
func (sc *Client) UpdateCloudWAFInstance(corpName, id string, body CloudWAFInstanceBody) error
UpdateCloudWAFInstance updates a Cloud WAF instance by id.
func (*Client) UpdateCorp ¶
func (sc *Client) UpdateCorp(corpName string, body UpdateCorpBody) (Corp, error)
UpdateCorp updates a corp by name.
func (*Client) UpdateCorpIntegration ¶ added in v0.1.1
func (sc *Client) UpdateCorpIntegration(corpName, id string, body UpdateIntegrationBody) error
UpdateCorpIntegration updates an integration by id.
func (*Client) UpdateCorpListByID ¶ added in v0.1.1
func (sc *Client) UpdateCorpListByID(corpName string, id string, body UpdateListBody) (ResponseListBody, error)
UpdateCorpListByID updates a corp list
func (*Client) UpdateCorpRuleByID ¶ added in v0.1.1
func (sc *Client) UpdateCorpRuleByID(corpName, id string, body CreateCorpRuleBody) (ResponseCorpRuleBody, error)
UpdateCorpRuleByID updates a rule and returns a response
func (*Client) UpdateCorpSignalTagByID ¶ added in v0.1.1
func (sc *Client) UpdateCorpSignalTagByID(corpName string, id string, body UpdateSignalTagBody) (ResponseSignalTagBody, error)
UpdateCorpSignalTagByID update corp signal
func (*Client) UpdateCustomAlert ¶
func (sc *Client) UpdateCustomAlert(corpName, siteName, id string, body CustomAlertBody) (CustomAlert, error)
UpdateCustomAlert updates a custom alert by id.
func (*Client) UpdateEdgeDeploymentBackends ¶ added in v0.1.9
UpdateEdgeDeploymentBackends checks if any changes were made to the Fastly service's backends and updates the Edge Deployment if necessary.
func (*Client) UpdateIntegration ¶
func (sc *Client) UpdateIntegration(corpName, siteName, id string, body UpdateIntegrationBody) error
UpdateIntegration updates an integration by id.
func (*Client) UpdateRedaction ¶
func (sc *Client) UpdateRedaction(corpName, siteName, id string, body UpdateRedactionBody) (Redaction, error)
UpdateRedaction updates a redaction by id.
func (*Client) UpdateSite ¶
func (sc *Client) UpdateSite(corpName, siteName string, body UpdateSiteBody) (Site, error)
UpdateSite updates a site by name.
func (*Client) UpdateSiteListByID ¶ added in v0.1.1
func (sc *Client) UpdateSiteListByID(corpName, siteName string, id string, body UpdateListBody) (ResponseListBody, error)
UpdateSiteListByID updates a site list and returns a response
func (*Client) UpdateSiteMonitor ¶ added in v0.1.1
func (sc *Client) UpdateSiteMonitor(corpName, siteName, id string, body UpdateSiteMonitorBody) error
UpdateSiteMonitor updates a monitor in place
func (*Client) UpdateSiteRedactionByID ¶ added in v0.1.1
func (sc *Client) UpdateSiteRedactionByID(corpName, siteName string, id string, body CreateSiteRedactionBody) (ResponseSiteRedactionBody, error)
UpdateSiteRedactionByID updates a site redaction and returns a response
func (*Client) UpdateSiteRuleByID ¶ added in v0.1.1
func (sc *Client) UpdateSiteRuleByID(corpName, siteName, id string, body CreateSiteRuleBody) (ResponseSiteRuleBody, error)
UpdateSiteRuleByID updates a rule and returns a response
func (*Client) UpdateSiteSignalTagByID ¶ added in v0.1.1
func (sc *Client) UpdateSiteSignalTagByID(corpName, siteName, id string, body UpdateSignalTagBody) (ResponseSignalTagBody, error)
UpdateSiteSignalTagByID update site signal
func (*Client) UpdateSiteTemplateRuleByID ¶ added in v0.1.1
func (sc *Client) UpdateSiteTemplateRuleByID(corpName, siteName, id string, body SiteTemplateRuleBody) (SiteTemplate, error)
UpdateSiteTemplateRuleByID updates a site template rule
func (*Client) UploadCloudWAFCertificate ¶ added in v0.1.6
func (sc *Client) UploadCloudWAFCertificate(corpName string, body UploadCloudWAFCertificateBody) (ResponseCloudWAFCertificateBody, error)
UploadCloudWAFCertificate uploads a Cloud WAF certificate and private key.
type ClientIPRules ¶ added in v0.1.13
type ClientIPRules []struct { Header string `json:"header"` }
type ClientIdentifier ¶ added in v0.1.5
type ClientIdentifier struct { Key string `json:"key,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type"` }
ClientIdentifier contains the client identifier fields for site rules of type rate_limit
type CloudWAFCertificate ¶ added in v0.1.6
type CloudWAFCertificateBase ¶ added in v0.1.6
type CloudWAFCertificateBase struct { Name string `json:"name"` CertificateBody string `json:"certificateBody"` CertificateChain string `json:"certificateChain"` }
CloudWAFCertificate contains the data for a Cloud WAF Certificate read API call.
type CloudWAFInstance ¶ added in v0.1.5
type CloudWAFInstance struct { CloudWAFInstanceBody ID string `json:"id"` Deployment CloudWAFInstanceDeployment `json:"deployment"` CreatedBy string `json:"createdBy"` Created string `json:"created"` UpdatedBy string `json:"updatedBy"` }
CloudWAFInstance contains the data for a Cloud WAF Instance read API call.
type CloudWAFInstanceBody ¶ added in v0.1.5
type CloudWAFInstanceBody struct { Name string `json:"name"` Description string `json:"description"` Region string `json:"region"` TLSMinVersion string `json:"tlsMinVersion"` UseUploadedCertificates bool `json:"useUploadedCertificates"` WorkspaceConfigs []CloudWAFInstanceWorkspaceConfig `json:"workspaceConfigs"` }
CloudWAFInstanceBody is the body for adding or updating a Cloud WAF instance.
type CloudWAFInstanceDeployment ¶ added in v0.1.5
type CloudWAFInstanceDeployment struct { Status string `json:"status"` Message string `json:"message"` EgressIPs []CloudWAFInstanceEgressIP `json:"egressIPs"` DNSEntry string `json:"dnsEntry"` }
CloudWAFInstanceDeployment contains the data for a Cloud WAF instance eeployment.
type CloudWAFInstanceEgressIP ¶ added in v0.1.5
type CloudWAFInstanceEgressIP struct { IP string `json:"ip"` Status string `json:"status"` UpdatedAt string `json:"updatedAt"` }
CloudWAFInstanceEgressIP contains the data for a Cloud WAF instance egress IP.
type CloudWAFInstanceWorkspaceConfig ¶ added in v0.1.5
type CloudWAFInstanceWorkspaceConfig struct { SiteName string `json:"siteName"` InstanceLocation string `json:"instanceLocation"` ClientIPHeader string `json:"clientIPHeader"` ListenerProtocols []string `json:"listenerProtocols"` Routes []CloudWAFInstanceWorkspaceRoute `json:"routes"` }
CloudWAFInstanceWorkspaceConfig contains the data for a Cloud WAF instance workspace config.
type CloudWAFInstanceWorkspaceRoute ¶ added in v0.1.5
type CloudWAFInstanceWorkspaceRoute struct { // ID is the route's ID after being created. It should not be populated during // create but should be populated during update. ID string `json:"id"` CertificateIDs []string `json:"certificateIds"` Origin string `json:"origin"` Domains []string `json:"domains"` ConnectionPooling bool `json:"connectionPooling"` PassHostHeader bool `json:"passHostHeader"` TLSHostOverride bool `json:"tlsHostOverride"` TLSInsecureSkipVerify bool `json:"tlsInsecureSkipVerify"` TrustProxyHeaders bool `json:"trustProxyHeaders"` }
CloudWAFInstanceWorkspaceRoute contains the data for a Cloud WAF instance workspace route.
type Condition ¶ added in v0.1.1
type Condition struct { Type string `json:"type,omitempty"` //(group, single) GroupOperator string `json:"groupOperator,omitempty"` //type: group - Conditions that must be matched when evaluating the request (all, any) Field string `json:"field,omitempty"` //type: single - (scheme, method, path, useragent, domain, ip, responseCode, agentname, paramname, paramvalue, country, name, valueString, valueIp, signalType) Operator string `json:"operator,omitempty"` //type: single - (equals, doesNotEqual, contains, doesNotContain, like, notLike, exists, doesNotExist, inList, notInList) Value string `json:"value,omitempty"` //type: single - See request fields (https://docs.signalsciences.net/using-signal-sciences/features/rules/#request-fields) Conditions []Condition `json:"conditions,omitempty"` }
Condition contains rule condition
type ConfiguredDetectionField ¶ added in v0.1.1
type ConfiguredDetectionField struct { Name string `json:"name,omitempty"` Value interface{} `json:"value"` }
ConfiguredDetectionField configuration for detection field in UpdateDetectionBody
type Corp ¶
type Corp struct { Name string DisplayName string SmallIconURI string Created time.Time SiteLimit int Sites map[string]string AuthType string MFAEnforced bool SessionMaxAgeDashboard int }
Corp contains details for a corp.
type CorpUser ¶
type CorpUser struct { Name string Email string Memberships map[string]string Role string Status string MFAEnabled bool AuthStatus string Created time.Time }
CorpUser contains details for a corp user.
type CorpUserInvite ¶
type CorpUserInvite struct { Role Role `json:"role"` Memberships inviteMemberships `json:"memberships"` }
CorpUserInvite is the request struct for inviting a user to a corp.
func NewCorpUserInvite ¶
func NewCorpUserInvite(corpRole Role, memberships []SiteMembership) CorpUserInvite
NewCorpUserInvite creates a new invitation struct for inviting a user to a corp.
type CreateCorpRuleBody ¶ added in v0.1.1
type CreateCorpRuleBody struct { SiteNames []string `json:"siteNames,omitempty"` //Sites with the rule available. Rules with a global corpScope will return '[]'. Type string `json:"type,omitempty"` //(request, signal) CorpScope string `json:"corpScope,omitempty"` //Whether the rule is applied to all sites or to specific sites. (global, specificSites) Enabled bool `json:"enabled,omitempty"` GroupOperator string `json:"groupOperator,omitempty"` //type: group - Conditions that must be matched when evaluating the request (all, any) Signal string `json:"signal,omitempty"` //The signal id of the signal being excluded Reason string `json:"reason,omitempty"` //Description of the rule Expiration string `json:"expiration,omitempty"` //Date the rule will automatically be disabled. If rule is always enabled, will return empty string Conditions []Condition `json:"conditions,omitempty"` Actions []Action `json:"actions,omitempty"` }
CreateCorpRuleBody contains the rule of a Corp
type CreateListBody ¶ added in v0.1.1
type CreateListBody struct { Name string `json:"name,omitempty"` //Descriptive list name Type string `json:"type,omitempty"` //List types (string, ip, country, wildcard, signal) Description string `json:"description,omitempty"` //Optional list description Entries []string `json:"entries,omitempty"` //List entries }
CreateListBody Create List Request
type CreateOrUpdateEdgeDeploymentServiceBody ¶ added in v0.1.14
type CreateSignalTagBody ¶ added in v0.1.1
type CreateSignalTagBody struct { ShortName string `json:"shortName,omitempty"` //The display name of the signal tag Description string `json:"description,omitempty"` //Optional signal tag description }
CreateSignalTagBody create a signal tag
type CreateSiteBody ¶ added in v0.1.1
type CreateSiteBody struct { Name string `json:"name,omitempty"` //Identifying name of the site DisplayName string `json:"displayName,omitempty"` //Display name of the site AgentLevel string `json:"agentLevel,omitempty"` //Agent action level - 'block', 'log' or 'off' AgentAnonMode string `json:"agentAnonMode"` //Agent IP anonymization mode - 'EU' or ” BlockHTTPCode int `json:"blockHTTPCode,omitempty"` //HTTP response code to send when traffic is being blocked BlockDurationSeconds int `json:"blockDurationSeconds,omitempty"` //Duration to block an IP in seconds ClientIPRules ClientIPRules `json:"clientIPRules"` //The specified header to assign client IPs to requests. }
CreateSiteBody is the structure required to create a Site.
type CreateSiteRedactionBody ¶ added in v0.1.1
type CreateSiteRedactionBody struct { Field string `json:"field,omitempty"` //Field name RedactionType int `json:"redactionType"` //Type of redaction (0: Request Parameter, 1: Request Header, 2: Response Header) }
CreateSiteRedactionBody Create redaction Request
type CreateSiteRuleBody ¶ added in v0.1.1
type CreateSiteRuleBody struct { Type string `json:"type,omitempty"` //(signal, request, rateLimit) GroupOperator string `json:"groupOperator,omitempty"` //type: group - Conditions that must be matched when evaluating the request (all, any) Enabled bool `json:"enabled,omitempty"` Reason string `json:"reason,omitempty"` //Description of the rule Signal string `json:"signal,omitempty"` //The signal id of the signal being excluded. Null unless type==request Expiration string `json:"expiration,omitempty"` //Date the rule will automatically be disabled. If rule is always enabled, will return empty string Conditions []Condition `json:"conditions,omitempty"` Actions []Action `json:"actions,omitempty"` RateLimit *RateLimit `json:"rateLimit,omitempty"` //Null unless type==rateLimit RequestLogging string `json:"requestlogging,omitempty"` }
CreateSiteRuleBody contains the rule for the site
type CustomAlert ¶
type CustomAlert struct { ID string `json:"id,omitempty"` //Site-specific unique ID of the alert SiteID string `json:"siteID,omitempty"` TagName string `json:"tagName,omitempty"` //The name of the tag whose occurrences the alert is watching. Must match an existing tag LongName string `json:"longName,omitempty"` //A human readable description of the alert. Must be between 3 and 25 characters. Interval int `json:"interval"` //The number of minutes of past traffic to examine. Must be 1, 10 or 60. Threshold int `json:"threshold"` //The number of occurrences of the tag in the interval needed to trigger the alert. BlockDurationSeconds int `json:"blockDurationSeconds,omitempty"` //The number of seconds this alert is active. empty means default value Enabled bool `json:"enabled"` //A flag to toggle this alert. Action string `json:"action,omitempty"` //A flag that describes what happens when the alert is triggered. 'info' creates an incident in the dashboard. 'flagged' creates an incident and blocks traffic for 24 hours. Type string `json:"type,omitempty"` //Type of alert (siteAlert, template, rateLimit, siteMetric) SkipNotifications bool `json:"skipNotifications"` //A flag to disable external notifications - slack, webhooks, emails, etc. FieldName string `json:"fieldName,omitempty"` CreatedBy string `json:"createdBy,omitempty"` //The email of the user that created the alert Created time.Time `json:"created,omitempty"` //RFC3339 date time Operator string `json:"operator,omitempty"` }
CustomAlert is the body for creating a custom alert.
type CustomAlertBody ¶
type CustomAlertBody struct { TagName string `json:"tagName"` LongName string `json:"longName"` Interval int `json:"interval"` Threshold int `json:"threshold"` Enabled bool `json:"enabled"` Action string `json:"action"` SkipNotifications bool `json:"skipNotifications"` BlockDurationSeconds int `json:"blockDurationSeconds,omitempty"` }
CustomAlertBody is the body for creating a custom alert.
type Detection ¶ added in v0.1.1
type Detection struct { DetectionUpdateBody Created *time.Time `json:"created,omitempty"` CreatedBy string `json:"created_by,omitempty"` }
Detection basic struct for Detection
type DetectionUpdateBody ¶ added in v0.1.1
type DetectionUpdateBody struct { ID string `json:"id,omitempty"` Name string `json:"name"` // name of template Enabled bool `json:"enabled"` Fields []ConfiguredDetectionField `json:"fields"` }
DetectionUpdateBody body to update a detection
type Entries ¶ added in v0.1.1
type Entries struct { Additions []string `json:"additions,omitempty"` //List additions Deletions []string `json:"deletions,omitempty"` // List deletions }
Entries List entries
type Event ¶
type Event struct { ID string Timestamp time.Time Source string RemoteCountryCode string RemoteHostname string UserAgents []string Action string Type string Reasons map[string]int RequestCount int TagCount int Window int Expires time.Time ExpiredBy string }
Event is a request event.
type HeaderLink ¶
type HeaderLink struct { ID string Type string Name string LinkName string Link string CreatedBy string Created time.Time }
HeaderLink contains the data for a response or request header link
type HeaderLinkBody ¶
type HeaderLinkBody struct { Type string `json:"type"` Name string `json:"name"` LinkName string `json:"linkName"` Link string `json:"link"` }
HeaderLinkBody is the body for creating a header link.
type Integration ¶
type Integration struct { ID string Name string Type string URL string Events []string Active bool Note string CreatedBy string Created time.Time }
Integration contains the data for an integration
type IntegrationBody ¶
type IntegrationBody struct { URL string `json:"url"` Type string `json:"type"` Events []string `json:"events"` }
IntegrationBody is the body for adding an integration.
type ListIP ¶
type ListIP struct { ID string Source string Expires time.Time `json:"omitempty"` Note string CreatedBy string Created time.Time }
ListIP is a whitelisted or blacklisted IP address.
type ListIPBody ¶
type ListIPBody struct { Source string `json:"source"` Note string `json:"note"` Expires time.Time `json:"expires,omitempty"` }
ListIPBody is the body for adding an IP to the whitelist or blacklist.
func (ListIPBody) MarshalJSON ¶
func (b ListIPBody) MarshalJSON() ([]byte, error)
MarshalJSON is a custom JSON marshal method for ListIPBody so that Expires can be formatted as RFC3339
type OverviewSite ¶
type OverviewSite struct { Name string DisplayName string TotalCount int BlockedCount int FlaggedCount int AttackCount int FlaggedIPCount int TopAttackTypes []topAttackType TopAttackSources []topAttackSource }
OverviewSite is a site in the overview report.
type Param ¶
type Param struct { ID string Name string Type string Note string CreatedBy string Created time.Time }
Param is a whitelisted parameter.
type PrimaryAgentKey ¶ added in v0.1.2
PrimaryAgentKey contains the secret and access keys used by the agents
type RateLimit ¶ added in v0.1.1
type RateLimit struct { Threshold int `json:"threshold"` Interval int `json:"interval"` // interval in minutes, 1 or 10 Duration int `json:"duration"` // duration in seconds ClientIdentifiers []ClientIdentifier `json:"clientIdentifiers"` }
RateLimit holds all the data that is specific to rate limit rules
type Redaction ¶
type Redaction struct { ID string Field string RedactionType int CreatedBy string Created time.Time }
Redaction contains the data for a privacy redaction
type RedactionBody ¶
RedactionBody is the body for adding a redaction. Type of redaction (0: Request Parameter, 1: Request Header, 2: Response Header)
type Request ¶
type Request struct { ID string `json:"id"` ServerHostname string `json:"serverHostname"` RemoteIP string `json:"remoteIP"` RemoteHostname string `json:"remoteHostname"` RemoteCountryCode string `json:"remoteCountryCode"` UserAgent string `json:"userAgent"` Timestamp time.Time `json:"timestamp"` Method string `json:"method"` ServerName string `json:"serverName"` Protocol string `json:"protocol"` TLSProtocol string `json:"tlsProtocol"` TLSCipher string `json:"tlsCipher"` Scheme string `json:"scheme"` HeadersIn [][]string `json:"headersIn"` Path string `json:"path"` URI string `json:"uri"` ResponseCode int `json:"responseCode"` ResponseSize int `json:"responseSize"` ResponseMillis int `json:"responseMillis"` HeadersOut [][]string `json:"headersOut"` AgentResponseCode int `json:"agentResponseCode"` Tags []RequestTag `json:"tags"` }
Request contains the data for a request
type RequestTag ¶
type RequestTag struct { Type string `json:"type"` Location string `json:"location"` Value string `json:"value"` Detector string `json:"detector"` }
RequestTag is a tag in a request
type ResponseCloudWAFCertificateBody ¶ added in v0.1.6
type ResponseCloudWAFCertificateBody struct {
ID string `json:"id"`
}
type ResponseCorpRuleBody ¶ added in v0.1.1
type ResponseCorpRuleBody struct { CreateCorpRuleBody ID string `json:"id"` CreatedBy string `json:"createdby"` //Email address of the user that created the item Created time.Time `json:"created"` //Created RFC3339 date time Updated time.Time `json:"updated"` //Last updated RFC3339 date time }
ResponseCorpRuleBody contains the response from creating the rule
type ResponseCorpRuleBodyList ¶ added in v0.1.1
type ResponseCorpRuleBodyList struct { TotalCount int `json:"totalCount"` Data []ResponseCorpRuleBody `json:"data"` //ResponseCorpRuleBody }
ResponseCorpRuleBodyList list
type ResponseListBody ¶ added in v0.1.1
type ResponseListBody struct { CreateListBody ID string `json:"id"` //internal ID CreatedBy string `json:"createdby"` //Email address of the user that created the item Created time.Time `json:"created"` //Created RFC3339 date time Updated time.Time `json:"updated"` //Last updated RFC3339 date time }
ResponseListBody contains the response from creating the list
type ResponseListBodyList ¶ added in v0.1.1
type ResponseListBodyList struct { // TotalCount int `json:"totalCount"` Data []ResponseListBody `json:"data"` //Site List data }
ResponseListBodyList contains the returned list
type ResponseSignalTagBody ¶ added in v0.1.1
type ResponseSignalTagBody struct { CreateSignalTagBody TagName string `json:"tagName,omitempty"` //The identifier for the signal tag LongName string `json:"longName,omitempty"` //The display name of the signal tag - deprecated Configurable bool `json:"configurable,omitempty"` Informational bool `json:"informational,omitempty"` NeedsResponse bool `json:"needsResponse,omitempty"` CreatedBy string `json:"createdBy,omitempty"` //Email address of the user that created the resource Created time.Time `json:"created,omitempty"` //Created RFC3339 date time }
ResponseSignalTagBody response singnal tag
type ResponseSignalTagBodyList ¶ added in v0.1.1
type ResponseSignalTagBodyList struct {
Data []ResponseSignalTagBody `json:"data"` //ResponseSignalTagBody
}
ResponseSignalTagBodyList response list
type ResponseSiteRedactionBody ¶ added in v0.1.1
type ResponseSiteRedactionBody struct { CreateSiteRedactionBody ID string `json:"id"` //internal ID CreatedBy string `json:"createdby"` //Email address of the user that created the item Created time.Time `json:"created"` //Created RFC3339 date time Updated time.Time `json:"updated"` //Last updated RFC3339 date time }
ResponseSiteRedactionBody redaction response
type ResponseSiteRedactionBodyList ¶ added in v0.1.1
type ResponseSiteRedactionBodyList struct { // TotalCount int `json:"totalCount"` Data []ResponseSiteRedactionBody `json:"data"` //Site Redaction data }
ResponseSiteRedactionBodyList redaction response list
type ResponseSiteRuleBody ¶ added in v0.1.1
type ResponseSiteRuleBody struct { CreateSiteRuleBody ID string `json:"id"` //internal ID CreatedBy string `json:"createdby"` //Email address of the user that created the item Created time.Time `json:"created"` //Created RFC3339 date time Updated time.Time `json:"updated"` //Last updated RFC3339 date time }
ResponseSiteRuleBody contains the response from creating the rule
type ResponseSiteRuleBodyList ¶ added in v0.1.1
type ResponseSiteRuleBodyList struct { TotalCount int `json:"totalCount"` Data []ResponseSiteRuleBody `json:"data"` }
ResponseSiteRuleBodyList contains the returned rules
type Site ¶
type Site struct { Name string DisplayName string AgentLevel string BlockHTTPCode int BlockDurationSeconds int Created time.Time Whitelist map[string]string Blacklist map[string]string Events map[string]string Requests map[string]string Redactions map[string]string SuspiciousIPs map[string]string Monitors map[string]string Pathwhitelist map[string]string Paramwhitelist map[string]string Integrations map[string]string HeaderLinks map[string]string Agents map[string]string Alerts map[string]string AnalyticsEvents map[string]string TopAttacks map[string]string Members map[string]string AgentAnonMode string ClientIPRules ClientIPRules }
Site contains details for a site.
type SiteMember ¶
type SiteMember struct { User SiteMemberUser Role Role }
SiteMember contains the data for a site member
type SiteMemberBody ¶
type SiteMemberBody struct {
Role Role `json:"role"`
}
SiteMemberBody is the body for inviting a user to a site.
type SiteMemberResponse ¶
SiteMemberResponse is the response for inviting a user to a site.
type SiteMemberUser ¶
SiteMemberUser is the embedded user object in the site members response.
type SiteMembership ¶
type SiteMembership struct { Site site `json:"site"` Role Role `json:"role"` }
SiteMembership contains the data needed for inviting a member to a site.
func NewSiteMembership ¶
func NewSiteMembership(name string, role Role) SiteMembership
NewSiteMembership returns a new site membership object for the given site name and role.
type SiteMonitor ¶
SiteMonitor is a monitor URL for a site.
type SiteMonitorResp ¶ added in v0.1.1
type SiteMonitorResp struct {
Data []SiteMonitor
}
SiteMonitorResp is the response from GET site monitor
type SiteTemplate ¶ added in v0.1.1
type SiteTemplate struct { Name string `json:"name,omitempty"` Detections []Detection `json:"detections"` Alerts []Alert `json:"alerts"` }
SiteTemplate basic struct for a site template
type SiteTemplateRuleBody ¶ added in v0.1.1
type SiteTemplateRuleBody struct { DetectionAdds []Detection `json:"detectionAdds"` DetectionUpdates []Detection `json:"detectionUpdates"` DetectionDeletes []Detection `json:"detectionDeletes"` AlertAdds []Alert `json:"alertAdds"` AlertUpdates []Alert `json:"alertUpdates"` AlertDeletes []Alert `json:"alertDeletes"` }
SiteTemplateRuleBody needed to update a site template rule
type SuspiciousIP ¶
type SuspiciousIP struct { Source string Percent int RemoteCountryCode string `json:"remoteCountryCode"` RemoteHostname string `json:"remoteHostname"` TagName string `json:"tagName"` ShortName string `json:"shortName"` IntervalStart time.Time `json:"interval_start"` Timestamp time.Time }
SuspiciousIP is a suspicious IP.
type Timeseries ¶
type Timeseries struct { Type string From int Until int Inc int Data []int SummaryCount int TotalPoints int }
Timeseries contains timeseries request info.
type UpdateCloudWAFCertificateBody ¶ added in v0.1.6
type UpdateCloudWAFCertificateBody struct {
Name string `json:"name"`
}
type UpdateCorpBody ¶
type UpdateCorpBody struct { DisplayName string `json:"displayName,omitempty"` SmallIconURI string `json:"smallIconURI,omitempty"` SessionMaxAgeDashboard int `json:"sessionMaxAgeDashboard,omitempty"` }
UpdateCorpBody is the body for the UpdateCorp method.
type UpdateIntegrationBody ¶
type UpdateIntegrationBody struct { URL string `json:"url,omitempty"` Events []string `json:"events,omitempty"` }
UpdateIntegrationBody is the body for updating an integration.
type UpdateListBody ¶ added in v0.1.1
type UpdateListBody struct { Description string `json:"description,omitempty"` //Optional list description Entries Entries `json:"entries,omitempty"` //List entries }
UpdateListBody update list
type UpdateRedactionBody ¶
type UpdateRedactionBody struct { Field string `json:"field,omitempty"` RedactionType int `json:"redactionType,omitempty"` }
UpdateRedactionBody is the body for updating an integration.
type UpdateSignalTagBody ¶ added in v0.1.1
type UpdateSignalTagBody struct {
Description string `json:"description,omitempty"` //Optional signal tag description
}
UpdateSignalTagBody update a signal tag
type UpdateSiteBody ¶
type UpdateSiteBody struct { DisplayName string `json:"displayName,omitempty"` AgentLevel string `json:"agentLevel,omitempty"` BlockDurationSeconds int `json:"blockDurationSeconds,omitempty"` BlockHTTPCode int `json:"blockHTTPCode,omitempty"` AgentAnonMode string `json:"agentAnonMode"` ClientIPRules ClientIPRules `json:"clientIPRules"` }
UpdateSiteBody is the body for the update site method.
type UpdateSiteMonitorBody ¶ added in v0.1.1
type UpdateSiteMonitorBody struct { ID string `json:"id"` }
UpdateSiteMonitorBody is the body to update a site monitor
type UploadCloudWAFCertificateBody ¶ added in v0.1.6
type UploadCloudWAFCertificateBody struct { CloudWAFCertificateBase PrivateKey string }