zap

package
v0.0.0-...-8f284f1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

TODO: auto generate this file

Index

Constants

View Source
const (
	DefaultBase           = "http://zap/JSON/"
	DefaultBaseOther      = "http://zap/OTHER/"
	DefaultHTTPSBase      = "https://zap/JSON/"
	DefaultHTTPSBaseOther = "https://zap/OTHER/"
	DefaultProxy          = "tcp://127.0.0.1:8080"
	ZAP_API_KEY_PARAM     = "apikey"
	ZAP_API_KEY_HEADER    = "X-ZAP-API-Key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Acsrf

type Acsrf struct {
	// contains filtered or unexported fields
}

func (Acsrf) AddOptionToken

func (a Acsrf) AddOptionToken(str string) (map[string]interface{}, error)

Adds an anti-CSRF token with the given name, enabled by default

func (Acsrf) GenForm

func (a Acsrf) GenForm(hrefid string) ([]byte, error)

Generate a form for testing lack of anti-CSRF tokens - typically invoked via ZAP

func (Acsrf) OptionTokensNames

func (a Acsrf) OptionTokensNames() (map[string]interface{}, error)

Lists the names of all anti-CSRF tokens

func (Acsrf) RemoveOptionToken

func (a Acsrf) RemoveOptionToken(str string) (map[string]interface{}, error)

Removes the anti-CSRF token with the given name

type Ascan

type Ascan struct {
	// contains filtered or unexported fields
}

func (Ascan) AddExcludedParam

func (a Ascan) AddExcludedParam(name string, t string, url string) (map[string]interface{}, error)

Adds a new parameter excluded from the scan, using the specified name. Optionally sets if the new entry applies to a specific URL (default, all URLs) and sets the ID of the type of the parameter (default, ID of any type). The type IDs can be obtained with the view excludedParamTypes.

func (Ascan) AddScanPolicy

func (a Ascan) AddScanPolicy(scanpolicyname string, alertthreshold string, attackstrength string) (map[string]interface{}, error)

func (Ascan) AlertsIds

func (a Ascan) AlertsIds(scanid string) (map[string]interface{}, error)

Gets the IDs of the alerts raised during the scan with the given ID. An alert can be obtained with 'alert' core view.

func (Ascan) AttackModeQueue

func (a Ascan) AttackModeQueue() (map[string]interface{}, error)

func (Ascan) ClearExcludedFromScan

func (a Ascan) ClearExcludedFromScan() (map[string]interface{}, error)

Clears the regexes of URLs excluded from the active scans.

func (Ascan) DisableAllScanners

func (a Ascan) DisableAllScanners(scanpolicyname string) (map[string]interface{}, error)

func (Ascan) DisableScanners

func (a Ascan) DisableScanners(ids string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) EnableAllScanners

func (a Ascan) EnableAllScanners(scanpolicyname string) (map[string]interface{}, error)

func (Ascan) EnableScanners

func (a Ascan) EnableScanners(ids string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) ExcludeFromScan

func (a Ascan) ExcludeFromScan(regex string) (map[string]interface{}, error)

Adds a regex of URLs that should be excluded from the active scans.

func (Ascan) ExcludedFromScan

func (a Ascan) ExcludedFromScan() (map[string]interface{}, error)

Gets the regexes of URLs excluded from the active scans.

func (Ascan) ExcludedParamTypes

func (a Ascan) ExcludedParamTypes() (map[string]interface{}, error)

Gets all the types of excluded parameters. For each type the following are shown: the ID and the name.

func (Ascan) ExcludedParams

func (a Ascan) ExcludedParams() (map[string]interface{}, error)

Gets all the parameters that are excluded. For each parameter the following are shown: the name, the URL, and the parameter type.

func (Ascan) ImportScanPolicy

func (a Ascan) ImportScanPolicy(path string) (map[string]interface{}, error)

Imports a Scan Policy using the given file system path.

func (Ascan) MessagesIds

func (a Ascan) MessagesIds(scanid string) (map[string]interface{}, error)

Gets the IDs of the messages sent during the scan with the given ID. A message can be obtained with 'message' core view.

func (Ascan) ModifyExcludedParam

func (a Ascan) ModifyExcludedParam(idx string, name string, t string, url string) (map[string]interface{}, error)

Modifies a parameter excluded from the scan. Allows to modify the name, the URL and the type of parameter. The parameter is selected with its index, which can be obtained with the view excludedParams.

func (Ascan) OptionAllowAttackOnStart

func (a Ascan) OptionAllowAttackOnStart() (map[string]interface{}, error)

func (Ascan) OptionAttackPolicy

func (a Ascan) OptionAttackPolicy() (map[string]interface{}, error)

func (Ascan) OptionDefaultPolicy

func (a Ascan) OptionDefaultPolicy() (map[string]interface{}, error)

func (Ascan) OptionDelayInMs

func (a Ascan) OptionDelayInMs() (map[string]interface{}, error)

func (Ascan) OptionExcludedParamList

func (a Ascan) OptionExcludedParamList() (map[string]interface{}, error)

Use view excludedParams instead.

func (Ascan) OptionHandleAntiCSRFTokens

func (a Ascan) OptionHandleAntiCSRFTokens() (map[string]interface{}, error)

func (Ascan) OptionHostPerScan

func (a Ascan) OptionHostPerScan() (map[string]interface{}, error)

func (Ascan) OptionInjectPluginIdInHeader

func (a Ascan) OptionInjectPluginIdInHeader() (map[string]interface{}, error)

Tells whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID, with the ID of the scanner that's sending the requests.

func (Ascan) OptionMaxChartTimeInMins

func (a Ascan) OptionMaxChartTimeInMins() (map[string]interface{}, error)

func (Ascan) OptionMaxResultsToList

func (a Ascan) OptionMaxResultsToList() (map[string]interface{}, error)

func (Ascan) OptionMaxRuleDurationInMins

func (a Ascan) OptionMaxRuleDurationInMins() (map[string]interface{}, error)

func (Ascan) OptionMaxScanDurationInMins

func (a Ascan) OptionMaxScanDurationInMins() (map[string]interface{}, error)

func (Ascan) OptionMaxScansInUI

func (a Ascan) OptionMaxScansInUI() (map[string]interface{}, error)

func (Ascan) OptionPromptInAttackMode

func (a Ascan) OptionPromptInAttackMode() (map[string]interface{}, error)

func (Ascan) OptionPromptToClearFinishedScans

func (a Ascan) OptionPromptToClearFinishedScans() (map[string]interface{}, error)

func (Ascan) OptionRescanInAttackMode

func (a Ascan) OptionRescanInAttackMode() (map[string]interface{}, error)

func (Ascan) OptionScanHeadersAllRequests

func (a Ascan) OptionScanHeadersAllRequests() (map[string]interface{}, error)

Tells whether or not the HTTP Headers of all requests should be scanned. Not just requests that send parameters, through the query or request body.

func (Ascan) OptionShowAdvancedDialog

func (a Ascan) OptionShowAdvancedDialog() (map[string]interface{}, error)

func (Ascan) OptionTargetParamsEnabledRPC

func (a Ascan) OptionTargetParamsEnabledRPC() (map[string]interface{}, error)

func (Ascan) OptionTargetParamsInjectable

func (a Ascan) OptionTargetParamsInjectable() (map[string]interface{}, error)

func (Ascan) OptionThreadPerHost

func (a Ascan) OptionThreadPerHost() (map[string]interface{}, error)

func (Ascan) Pause

func (a Ascan) Pause(scanid string) (map[string]interface{}, error)

func (Ascan) PauseAllScans

func (a Ascan) PauseAllScans() (map[string]interface{}, error)

func (Ascan) Policies

func (a Ascan) Policies(scanpolicyname string, policyid string) (map[string]interface{}, error)

func (Ascan) RemoveAllScans

func (a Ascan) RemoveAllScans() (map[string]interface{}, error)

func (Ascan) RemoveExcludedParam

func (a Ascan) RemoveExcludedParam(idx string) (map[string]interface{}, error)

Removes a parameter excluded from the scan, with the given index. The index can be obtained with the view excludedParams.

func (Ascan) RemoveScan

func (a Ascan) RemoveScan(scanid string) (map[string]interface{}, error)

func (Ascan) RemoveScanPolicy

func (a Ascan) RemoveScanPolicy(scanpolicyname string) (map[string]interface{}, error)

func (Ascan) Resume

func (a Ascan) Resume(scanid string) (map[string]interface{}, error)

func (Ascan) ResumeAllScans

func (a Ascan) ResumeAllScans() (map[string]interface{}, error)

func (Ascan) Scan

func (a Ascan) Scan(url string, recurse string, inscopeonly string, scanpolicyname string, method string, postdata string, contextid string) (map[string]interface{}, error)

Runs the active scanner against the given URL and/or Context. Optionally, the 'recurse' parameter can be used to scan URLs under the given URL, the parameter 'inScopeOnly' can be used to constrain the scan to URLs that are in scope (ignored if a Context is specified), the parameter 'scanPolicyName' allows to specify the scan policy (if none is given it uses the default scan policy), the parameters 'method' and 'postData' allow to select a given request in conjunction with the given URL.

func (Ascan) ScanAsUser

func (a Ascan) ScanAsUser(url string, contextid string, userid string, recurse string, scanpolicyname string, method string, postdata string) (map[string]interface{}, error)

Active Scans from the perspective of a User, obtained using the given Context ID and User ID. See 'scan' action for more details.

func (Ascan) ScanPolicyNames

func (a Ascan) ScanPolicyNames() (map[string]interface{}, error)

func (Ascan) ScanProgress

func (a Ascan) ScanProgress(scanid string) (map[string]interface{}, error)

func (Ascan) Scanners

func (a Ascan) Scanners(scanpolicyname string, policyid string) (map[string]interface{}, error)

func (Ascan) Scans

func (a Ascan) Scans() (map[string]interface{}, error)

func (Ascan) SetEnabledPolicies

func (a Ascan) SetEnabledPolicies(ids string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) SetOptionAllowAttackOnStart

func (a Ascan) SetOptionAllowAttackOnStart(boolean bool) (map[string]interface{}, error)

func (Ascan) SetOptionAttackPolicy

func (a Ascan) SetOptionAttackPolicy(str string) (map[string]interface{}, error)

func (Ascan) SetOptionDefaultPolicy

func (a Ascan) SetOptionDefaultPolicy(str string) (map[string]interface{}, error)

func (Ascan) SetOptionDelayInMs

func (a Ascan) SetOptionDelayInMs(i int) (map[string]interface{}, error)

func (Ascan) SetOptionHandleAntiCSRFTokens

func (a Ascan) SetOptionHandleAntiCSRFTokens(boolean bool) (map[string]interface{}, error)

func (Ascan) SetOptionHostPerScan

func (a Ascan) SetOptionHostPerScan(i int) (map[string]interface{}, error)

func (Ascan) SetOptionInjectPluginIdInHeader

func (a Ascan) SetOptionInjectPluginIdInHeader(boolean bool) (map[string]interface{}, error)

Sets whether or not the active scanner should inject the HTTP request header X-ZAP-Scan-ID, with the ID of the scanner that's sending the requests.

func (Ascan) SetOptionMaxChartTimeInMins

func (a Ascan) SetOptionMaxChartTimeInMins(i int) (map[string]interface{}, error)

func (Ascan) SetOptionMaxResultsToList

func (a Ascan) SetOptionMaxResultsToList(i int) (map[string]interface{}, error)

func (Ascan) SetOptionMaxRuleDurationInMins

func (a Ascan) SetOptionMaxRuleDurationInMins(i int) (map[string]interface{}, error)

func (Ascan) SetOptionMaxScanDurationInMins

func (a Ascan) SetOptionMaxScanDurationInMins(i int) (map[string]interface{}, error)

func (Ascan) SetOptionMaxScansInUI

func (a Ascan) SetOptionMaxScansInUI(i int) (map[string]interface{}, error)

func (Ascan) SetOptionPromptInAttackMode

func (a Ascan) SetOptionPromptInAttackMode(boolean bool) (map[string]interface{}, error)

func (Ascan) SetOptionPromptToClearFinishedScans

func (a Ascan) SetOptionPromptToClearFinishedScans(boolean bool) (map[string]interface{}, error)

func (Ascan) SetOptionRescanInAttackMode

func (a Ascan) SetOptionRescanInAttackMode(boolean bool) (map[string]interface{}, error)

func (Ascan) SetOptionScanHeadersAllRequests

func (a Ascan) SetOptionScanHeadersAllRequests(boolean bool) (map[string]interface{}, error)

Sets whether or not the HTTP Headers of all requests should be scanned. Not just requests that send parameters, through the query or request body.

func (Ascan) SetOptionShowAdvancedDialog

func (a Ascan) SetOptionShowAdvancedDialog(boolean bool) (map[string]interface{}, error)

func (Ascan) SetOptionTargetParamsEnabledRPC

func (a Ascan) SetOptionTargetParamsEnabledRPC(i int) (map[string]interface{}, error)

func (Ascan) SetOptionTargetParamsInjectable

func (a Ascan) SetOptionTargetParamsInjectable(i int) (map[string]interface{}, error)

func (Ascan) SetOptionThreadPerHost

func (a Ascan) SetOptionThreadPerHost(i int) (map[string]interface{}, error)

func (Ascan) SetPolicyAlertThreshold

func (a Ascan) SetPolicyAlertThreshold(id string, alertthreshold string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) SetPolicyAttackStrength

func (a Ascan) SetPolicyAttackStrength(id string, attackstrength string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) SetScannerAlertThreshold

func (a Ascan) SetScannerAlertThreshold(id string, alertthreshold string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) SetScannerAttackStrength

func (a Ascan) SetScannerAttackStrength(id string, attackstrength string, scanpolicyname string) (map[string]interface{}, error)

func (Ascan) SkipScanner

func (a Ascan) SkipScanner(scanid string, scannerid string) (map[string]interface{}, error)

Skips the scanner using the given IDs of the scan and the scanner.

func (Ascan) Status

func (a Ascan) Status(scanid string) (map[string]interface{}, error)

func (Ascan) Stop

func (a Ascan) Stop(scanid string) (map[string]interface{}, error)

func (Ascan) StopAllScans

func (a Ascan) StopAllScans() (map[string]interface{}, error)

func (Ascan) UpdateScanPolicy

func (a Ascan) UpdateScanPolicy(scanpolicyname string, alertthreshold string, attackstrength string) (map[string]interface{}, error)

type Authentication

type Authentication struct {
	// contains filtered or unexported fields
}

func (Authentication) GetAuthenticationMethod

func (a Authentication) GetAuthenticationMethod(contextid string) (map[string]interface{}, error)

func (Authentication) GetAuthenticationMethodConfigParams

func (a Authentication) GetAuthenticationMethodConfigParams(authmethodname string) (map[string]interface{}, error)

func (Authentication) GetLoggedInIndicator

func (a Authentication) GetLoggedInIndicator(contextid string) (map[string]interface{}, error)

func (Authentication) GetLoggedOutIndicator

func (a Authentication) GetLoggedOutIndicator(contextid string) (map[string]interface{}, error)

func (Authentication) GetSupportedAuthenticationMethods

func (a Authentication) GetSupportedAuthenticationMethods() (map[string]interface{}, error)

func (Authentication) SetAuthenticationMethod

func (a Authentication) SetAuthenticationMethod(contextid string, authmethodname string, authmethodconfigparams string) (map[string]interface{}, error)

func (Authentication) SetLoggedInIndicator

func (a Authentication) SetLoggedInIndicator(contextid string, loggedinindicatorregex string) (map[string]interface{}, error)

func (Authentication) SetLoggedOutIndicator

func (a Authentication) SetLoggedOutIndicator(contextid string, loggedoutindicatorregex string) (map[string]interface{}, error)

type Authorization

type Authorization struct {
	// contains filtered or unexported fields
}

func (Authorization) GetAuthorizationDetectionMethod

func (a Authorization) GetAuthorizationDetectionMethod(contextid string) (map[string]interface{}, error)

Obtains all the configuration of the authorization detection method that is currently set for a context.

func (Authorization) SetBasicAuthorizationDetectionMethod

func (a Authorization) SetBasicAuthorizationDetectionMethod(contextid string, headerregex string, bodyregex string, statuscode string, logicaloperator string) (map[string]interface{}, error)

Sets the authorization detection method for a context as one that identifies un-authorized messages based on: the message's status code or a regex pattern in the response's header or body. Also, whether all conditions must match or just some can be specified via the logicalOperator parameter, which accepts two values: "AND" (default), "OR".

type Autoupdate

type Autoupdate struct {
	// contains filtered or unexported fields
}

func (Autoupdate) DownloadLatestRelease

func (a Autoupdate) DownloadLatestRelease() (map[string]interface{}, error)

Downloads the latest release, if any

func (Autoupdate) InstallAddon

func (a Autoupdate) InstallAddon(id string) (map[string]interface{}, error)

Installs or updates the specified add-on, returning when complete (ie not asynchronously)

func (Autoupdate) InstalledAddons

func (a Autoupdate) InstalledAddons() (map[string]interface{}, error)

Return a list of all of the installed add-ons

func (Autoupdate) IsLatestVersion

func (a Autoupdate) IsLatestVersion() (map[string]interface{}, error)

Returns 'true' if ZAP is on the latest version

func (Autoupdate) LatestVersionNumber

func (a Autoupdate) LatestVersionNumber() (map[string]interface{}, error)

Returns the latest version number

func (Autoupdate) MarketplaceAddons

func (a Autoupdate) MarketplaceAddons() (map[string]interface{}, error)

Return a list of all of the add-ons on the ZAP Marketplace (this information is read once and then cached)

func (Autoupdate) NewAddons

func (a Autoupdate) NewAddons() (map[string]interface{}, error)

Return a list of any add-ons that have been added to the Marketplace since the last check for updates

func (Autoupdate) OptionAddonDirectories

func (a Autoupdate) OptionAddonDirectories() (map[string]interface{}, error)

func (Autoupdate) OptionCheckAddonUpdates

func (a Autoupdate) OptionCheckAddonUpdates() (map[string]interface{}, error)

func (Autoupdate) OptionCheckOnStart

func (a Autoupdate) OptionCheckOnStart() (map[string]interface{}, error)

func (Autoupdate) OptionDayLastChecked

func (a Autoupdate) OptionDayLastChecked() (map[string]interface{}, error)

func (Autoupdate) OptionDayLastInstallWarned

func (a Autoupdate) OptionDayLastInstallWarned() (map[string]interface{}, error)

func (Autoupdate) OptionDayLastUpdateWarned

func (a Autoupdate) OptionDayLastUpdateWarned() (map[string]interface{}, error)

func (Autoupdate) OptionDownloadDirectory

func (a Autoupdate) OptionDownloadDirectory() (map[string]interface{}, error)

func (Autoupdate) OptionDownloadNewRelease

func (a Autoupdate) OptionDownloadNewRelease() (map[string]interface{}, error)

func (Autoupdate) OptionInstallAddonUpdates

func (a Autoupdate) OptionInstallAddonUpdates() (map[string]interface{}, error)

func (Autoupdate) OptionInstallScannerRules

func (a Autoupdate) OptionInstallScannerRules() (map[string]interface{}, error)

func (Autoupdate) OptionReportAlphaAddons

func (a Autoupdate) OptionReportAlphaAddons() (map[string]interface{}, error)

func (Autoupdate) OptionReportBetaAddons

func (a Autoupdate) OptionReportBetaAddons() (map[string]interface{}, error)

func (Autoupdate) OptionReportReleaseAddons

func (a Autoupdate) OptionReportReleaseAddons() (map[string]interface{}, error)

func (Autoupdate) SetOptionCheckAddonUpdates

func (a Autoupdate) SetOptionCheckAddonUpdates(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionCheckOnStart

func (a Autoupdate) SetOptionCheckOnStart(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionDownloadNewRelease

func (a Autoupdate) SetOptionDownloadNewRelease(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionInstallAddonUpdates

func (a Autoupdate) SetOptionInstallAddonUpdates(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionInstallScannerRules

func (a Autoupdate) SetOptionInstallScannerRules(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionReportAlphaAddons

func (a Autoupdate) SetOptionReportAlphaAddons(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionReportBetaAddons

func (a Autoupdate) SetOptionReportBetaAddons(boolean bool) (map[string]interface{}, error)

func (Autoupdate) SetOptionReportReleaseAddons

func (a Autoupdate) SetOptionReportReleaseAddons(boolean bool) (map[string]interface{}, error)

func (Autoupdate) UninstallAddon

func (a Autoupdate) UninstallAddon(id string) (map[string]interface{}, error)

Uninstalls the specified add-on

func (Autoupdate) UpdatedAddons

func (a Autoupdate) UpdatedAddons() (map[string]interface{}, error)

Return a list of any add-ons that have been changed in the Marketplace since the last check for updates

type Break

type Break struct {
	// contains filtered or unexported fields
}

func (Break) AddHttpBreakpoint

func (b Break) AddHttpBreakpoint(str string, location string, match string, inverse string, ignorecase string) (map[string]interface{}, error)

Adds a custom HTTP breakpont. The string is the string to match. Location may be one of: url, request_header, request_body, response_header or response_body. Match may be: contains or regex. Inverse (match) may be true or false. Lastly, ignorecase (when matching the string) may be true or false.

func (Break) Brk

func (b Break) Brk(t string, state string, scope string) (map[string]interface{}, error)

Controls the global break functionality. The type may be one of: http-all, http-request or http-response. The state may be true (for turning break on for the specified type) or false (for turning break off). Scope is not currently used.

func (Break) Cont

func (b Break) Cont() (map[string]interface{}, error)

Submits the currently intercepted message and unsets the global request/response break points

func (Break) Drop

func (b Break) Drop() (map[string]interface{}, error)

Drops the currently intercepted message

func (Break) HttpMessage

func (b Break) HttpMessage() (map[string]interface{}, error)

Returns the HTTP message currently intercepted (if any)

func (Break) IsBreakAll

func (b Break) IsBreakAll() (map[string]interface{}, error)

Returns True if ZAP will break on both requests and responses

func (Break) IsBreakRequest

func (b Break) IsBreakRequest() (map[string]interface{}, error)

Returns True if ZAP will break on requests

func (Break) IsBreakResponse

func (b Break) IsBreakResponse() (map[string]interface{}, error)

Returns True if ZAP will break on responses

func (Break) RemoveHttpBreakpoint

func (b Break) RemoveHttpBreakpoint(str string, location string, match string, inverse string, ignorecase string) (map[string]interface{}, error)

Removes the specified break point

func (Break) SetHttpMessage

func (b Break) SetHttpMessage(httpheader string, httpbody string) (map[string]interface{}, error)

Overwrites the currently intercepted message with the data provided

func (Break) Step

func (b Break) Step() (map[string]interface{}, error)

Submits the currently intercepted message, the next request or response will automatically be intercepted

type Client

type Client struct {
	*Config
	// contains filtered or unexported fields
}

Client is a ZAP client that allows you to access ZAP API

func (*Client) Acsrf

func (c *Client) Acsrf() *Acsrf

Acsrf() returns a Acsrf client

func (*Client) Ascan

func (c *Client) Ascan() *Ascan

Ascan() returns a Ascan client

func (*Client) Authentication

func (c *Client) Authentication() *Authentication

Authentication() returns a Authentication client

func (*Client) Authorization

func (c *Client) Authorization() *Authorization

Authorization() returns a Authorization client

func (*Client) Autoupdate

func (c *Client) Autoupdate() *Autoupdate

Autoupdate() returns a Auotupdate client

func (*Client) Break

func (c *Client) Break() *Break

Break() returns a Break client

func (*Client) Context

func (c *Client) Context() *Context

Context() returns a Context client

func (*Client) Core

func (c *Client) Core() *Core

Core() returns a Core client

func (*Client) ForcedUser

func (c *Client) ForcedUser() *ForcedUser

ForcedUser() returns a ForcedUser client

func (*Client) HttpSessions

func (c *Client) HttpSessions() *HttpSessions

HttpSessions() returns a HttpSessions client

func (*Client) Params

func (c *Client) Params() *Params

Params() returns a Params client

func (*Client) Pscan

func (c *Client) Pscan() *Pscan

Pscan() returns a Pscan client

func (*Client) Request

func (c *Client) Request(path string, queryParams map[string]string) (map[string]interface{}, error)

Request sends HTTP request to zap base("http://zap/JSON/") API group

func (*Client) RequestOther

func (c *Client) RequestOther(path string, queryParams map[string]string) ([]byte, error)

RequestOther sends HTTP request to zap other("http://zap/OTHER/") API group

func (*Client) Script

func (c *Client) Script() *Script

Script() returns a Script client

func (*Client) Search

func (c *Client) Search() *Search

Search() returns a Search client

func (*Client) Spider

func (c *Client) Spider() *Spider

Spider() returns a Spider client

func (*Client) Stats

func (c *Client) Stats() *Stats

Stats() returns a Stats client

func (*Client) Users

func (c *Client) Users() *Users

Users() returns a Users client

type Config

type Config struct {
	Base      string
	BaseOther string
	Proxy     string
	APIKey    string
	TLSConfig tls.Config
}

Config defines the config of ZAP client

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (Context) Context

func (c Context) Context(contextname string) (map[string]interface{}, error)

List the information about the named context

func (Context) ContextList

func (c Context) ContextList() (map[string]interface{}, error)

List context names of current session

func (Context) ExcludeAllContextTechnologies

func (c Context) ExcludeAllContextTechnologies(contextname string) (map[string]interface{}, error)

Excludes all built in technologies from a context

func (Context) ExcludeContextTechnologies

func (c Context) ExcludeContextTechnologies(contextname string, technologynames string) (map[string]interface{}, error)

Excludes technologies with the given names, separated by a comma, from a context

func (Context) ExcludeFromContext

func (c Context) ExcludeFromContext(contextname string, regex string) (map[string]interface{}, error)

Add exclude regex to context

func (Context) ExcludeRegexs

func (c Context) ExcludeRegexs(contextname string) (map[string]interface{}, error)

List excluded regexs for context

func (Context) ExcludedTechnologyList

func (c Context) ExcludedTechnologyList(contextname string) (map[string]interface{}, error)

Lists the names of all technologies excluded from a context

func (Context) ExportContext

func (c Context) ExportContext(contextname string, contextfile string) (map[string]interface{}, error)

Exports the context with the given name to a file. If a relative file path is specified it will be resolved against the "contexts" directory in ZAP "home" dir.

func (Context) ImportContext

func (c Context) ImportContext(contextfile string) (map[string]interface{}, error)

Imports a context from a file. If a relative file path is specified it will be resolved against the "contexts" directory in ZAP "home" dir.

func (Context) IncludeAllContextTechnologies

func (c Context) IncludeAllContextTechnologies(contextname string) (map[string]interface{}, error)

Includes all built in technologies in to a context

func (Context) IncludeContextTechnologies

func (c Context) IncludeContextTechnologies(contextname string, technologynames string) (map[string]interface{}, error)

Includes technologies with the given names, separated by a comma, to a context

func (Context) IncludeInContext

func (c Context) IncludeInContext(contextname string, regex string) (map[string]interface{}, error)

Add include regex to context

func (Context) IncludeRegexs

func (c Context) IncludeRegexs(contextname string) (map[string]interface{}, error)

List included regexs for context

func (Context) IncludedTechnologyList

func (c Context) IncludedTechnologyList(contextname string) (map[string]interface{}, error)

Lists the names of all technologies included in a context

func (Context) NewContext

func (c Context) NewContext(contextname string) (map[string]interface{}, error)

Creates a new context with the given name in the current session

func (Context) RemoveContext

func (c Context) RemoveContext(contextname string) (map[string]interface{}, error)

Removes a context in the current session

func (Context) SetContextInScope

func (c Context) SetContextInScope(contextname string, booleaninscope string) (map[string]interface{}, error)

Sets a context to in scope (contexts are in scope by default)

func (Context) TechnologyList

func (c Context) TechnologyList() (map[string]interface{}, error)

Lists the names of all built in technologies

type Core

type Core struct {
	// contains filtered or unexported fields
}

func (Core) AccessUrl

func (c Core) AccessUrl(url string, followredirects string) (map[string]interface{}, error)

Convenient and simple action to access a URL, optionally following redirections. Returns the request sent and response received and followed redirections, if any. Other actions are available which offer more control on what is sent, like, 'sendRequest' or 'sendHarRequest'.

func (Core) AddProxyChainExcludedDomain

func (c Core) AddProxyChainExcludedDomain(value string, isregex string, isenabled string) (map[string]interface{}, error)

Adds a domain to be excluded from the outgoing proxy, using the specified value. Optionally sets if the new entry is enabled (default, true) and whether or not the new value is specified as a regex (default, false).

func (Core) Alert

func (c Core) Alert(id string) (map[string]interface{}, error)

Gets the alert with the given ID, the corresponding HTTP message can be obtained with the 'messageId' field and 'message' API method

func (Core) Alerts

func (c Core) Alerts(baseurl string, start string, count string, riskid string) (map[string]interface{}, error)

Gets the alerts raised by ZAP, optionally filtering by URL or riskId, and paginating with 'start' position and 'count' of alerts

func (Core) AlertsSummary

func (c Core) AlertsSummary(baseurl string) (map[string]interface{}, error)

Gets number of alerts grouped by each risk level, optionally filtering by URL

func (Core) ClearExcludedFromProxy

func (c Core) ClearExcludedFromProxy() (map[string]interface{}, error)

Clears the regexes of URLs excluded from the local proxies.

func (Core) DeleteAlert

func (c Core) DeleteAlert(id string) (map[string]interface{}, error)

Deletes the alert with the given ID.

func (Core) DeleteAllAlerts

func (c Core) DeleteAllAlerts() (map[string]interface{}, error)

Deletes all alerts of the current session.

func (Core) DeleteSiteNode

func (c Core) DeleteSiteNode(url string, method string, postdata string) (map[string]interface{}, error)

Deletes the site node found in the Sites Tree on the basis of the URL, HTTP method, and post data (if applicable and specified).

func (Core) DisableAllProxyChainExcludedDomains

func (c Core) DisableAllProxyChainExcludedDomains() (map[string]interface{}, error)

Disables all domains excluded from the outgoing proxy.

func (Core) EnableAllProxyChainExcludedDomains

func (c Core) EnableAllProxyChainExcludedDomains() (map[string]interface{}, error)

Enables all domains excluded from the outgoing proxy.

func (Core) ExcludeFromProxy

func (c Core) ExcludeFromProxy(regex string) (map[string]interface{}, error)

Adds a regex of URLs that should be excluded from the local proxies.

func (Core) ExcludedFromProxy

func (c Core) ExcludedFromProxy() (map[string]interface{}, error)

Gets the regular expressions, applied to URLs, to exclude from the local proxies.

func (Core) GenerateRootCA

func (c Core) GenerateRootCA() (map[string]interface{}, error)

Generates a new Root CA certificate for the local proxies.

func (Core) HomeDirectory

func (c Core) HomeDirectory() (map[string]interface{}, error)

func (Core) Hosts

func (c Core) Hosts() (map[string]interface{}, error)

Gets the name of the hosts accessed through/by ZAP

func (Core) Htmlreport

func (c Core) Htmlreport() ([]byte, error)

Generates a report in HTML format

func (Core) Jsonreport

func (c Core) Jsonreport() ([]byte, error)

Generates a report in JSON format

func (Core) LoadSession

func (c Core) LoadSession(name string) (map[string]interface{}, error)

Loads the session with the given name. If a relative path is specified it will be resolved against the "session" directory in ZAP "home" dir.

func (Core) Mdreport

func (c Core) Mdreport() ([]byte, error)

Generates a report in Markdown format

func (Core) Message

func (c Core) Message(id string) (map[string]interface{}, error)

Gets the HTTP message with the given ID. Returns the ID, request/response headers and bodies, cookies, note, type, RTT, and timestamp.

func (Core) MessageHar

func (c Core) MessageHar(id string) ([]byte, error)

Gets the message with the given ID in HAR format

func (Core) Messages

func (c Core) Messages(baseurl string, start string, count string) (map[string]interface{}, error)

Gets the HTTP messages sent by ZAP, request and response, optionally filtered by URL and paginated with 'start' position and 'count' of messages

func (Core) MessagesById

func (c Core) MessagesById(ids string) (map[string]interface{}, error)

Gets the HTTP messages with the given IDs.

func (Core) MessagesHar

func (c Core) MessagesHar(baseurl string, start string, count string) ([]byte, error)

Gets the HTTP messages sent through/by ZAP, in HAR format, optionally filtered by URL and paginated with 'start' position and 'count' of messages

func (Core) MessagesHarById

func (c Core) MessagesHarById(ids string) ([]byte, error)

Gets the HTTP messages with the given IDs, in HAR format.

func (Core) Mode

func (c Core) Mode() (map[string]interface{}, error)

Gets the mode

func (Core) ModifyProxyChainExcludedDomain

func (c Core) ModifyProxyChainExcludedDomain(idx string, value string, isregex string, isenabled string) (map[string]interface{}, error)

Modifies a domain excluded from the outgoing proxy. Allows to modify the value, if enabled or if a regex. The domain is selected with its index, which can be obtained with the view proxyChainExcludedDomains.

func (Core) NewSession

func (c Core) NewSession(name string, overwrite string) (map[string]interface{}, error)

Creates a new session, optionally overwriting existing files. If a relative path is specified it will be resolved against the "session" directory in ZAP "home" dir.

func (Core) NumberOfAlerts

func (c Core) NumberOfAlerts(baseurl string, riskid string) (map[string]interface{}, error)

Gets the number of alerts, optionally filtering by URL or riskId

func (Core) NumberOfMessages

func (c Core) NumberOfMessages(baseurl string) (map[string]interface{}, error)

Gets the number of messages, optionally filtering by URL

func (Core) OptionAlertOverridesFilePath

func (c Core) OptionAlertOverridesFilePath() (map[string]interface{}, error)

Gets the path to the file with alert overrides.

func (Core) OptionDefaultUserAgent

func (c Core) OptionDefaultUserAgent() (map[string]interface{}, error)

Gets the user agent that ZAP should use when creating HTTP messages (for example, spider messages or CONNECT requests to outgoing proxy).

func (Core) OptionDnsTtlSuccessfulQueries

func (c Core) OptionDnsTtlSuccessfulQueries() (map[string]interface{}, error)

Gets the TTL (in seconds) of successful DNS queries.

func (Core) OptionHttpState

func (c Core) OptionHttpState() (map[string]interface{}, error)

func (Core) OptionHttpStateEnabled

func (c Core) OptionHttpStateEnabled() (map[string]interface{}, error)

func (Core) OptionMaximumAlertInstances

func (c Core) OptionMaximumAlertInstances() (map[string]interface{}, error)

Gets the maximum number of alert instances to include in a report.

func (Core) OptionMergeRelatedAlerts

func (c Core) OptionMergeRelatedAlerts() (map[string]interface{}, error)

Gets whether or not related alerts will be merged in any reports generated.

func (Core) OptionProxyChainName

func (c Core) OptionProxyChainName() (map[string]interface{}, error)

func (Core) OptionProxyChainPassword

func (c Core) OptionProxyChainPassword() (map[string]interface{}, error)

func (Core) OptionProxyChainPort

func (c Core) OptionProxyChainPort() (map[string]interface{}, error)

func (Core) OptionProxyChainPrompt

func (c Core) OptionProxyChainPrompt() (map[string]interface{}, error)

func (Core) OptionProxyChainRealm

func (c Core) OptionProxyChainRealm() (map[string]interface{}, error)

func (Core) OptionProxyChainSkipName

func (c Core) OptionProxyChainSkipName() (map[string]interface{}, error)

Use view proxyChainExcludedDomains instead.

func (Core) OptionProxyChainUserName

func (c Core) OptionProxyChainUserName() (map[string]interface{}, error)

func (Core) OptionProxyExcludedDomains

func (c Core) OptionProxyExcludedDomains() (map[string]interface{}, error)

Use view proxyChainExcludedDomains instead.

func (Core) OptionProxyExcludedDomainsEnabled

func (c Core) OptionProxyExcludedDomainsEnabled() (map[string]interface{}, error)

Use view proxyChainExcludedDomains instead.

func (Core) OptionSingleCookieRequestHeader

func (c Core) OptionSingleCookieRequestHeader() (map[string]interface{}, error)

func (Core) OptionTimeoutInSecs

func (c Core) OptionTimeoutInSecs() (map[string]interface{}, error)

func (Core) OptionUseProxyChain

func (c Core) OptionUseProxyChain() (map[string]interface{}, error)

func (Core) OptionUseProxyChainAuth

func (c Core) OptionUseProxyChainAuth() (map[string]interface{}, error)

func (Core) ProxyChainExcludedDomains

func (c Core) ProxyChainExcludedDomains() (map[string]interface{}, error)

Gets all the domains that are excluded from the outgoing proxy. For each domain the following are shown: the index, the value (domain), if enabled, and if specified as a regex.

func (Core) Proxypac

func (c Core) Proxypac() ([]byte, error)

func (Core) RemoveProxyChainExcludedDomain

func (c Core) RemoveProxyChainExcludedDomain(idx string) (map[string]interface{}, error)

Removes a domain excluded from the outgoing proxy, with the given index. The index can be obtained with the view proxyChainExcludedDomains.

func (Core) Rootcert

func (c Core) Rootcert() ([]byte, error)

Gets the Root CA certificate used by the local proxies.

func (Core) RunGarbageCollection

func (c Core) RunGarbageCollection() (map[string]interface{}, error)

func (Core) SaveSession

func (c Core) SaveSession(name string, overwrite string) (map[string]interface{}, error)

Saves the session with the name supplied, optionally overwriting existing files. If a relative path is specified it will be resolved against the "session" directory in ZAP "home" dir.

func (Core) SendHarRequest

func (c Core) SendHarRequest(request string, followredirects string) ([]byte, error)

Sends the first HAR request entry, optionally following redirections. Returns, in HAR format, the request sent and response received and followed redirections, if any. The Mode is enforced when sending the request (and following redirections), custom manual requests are not allowed in 'Safe' mode nor in 'Protected' mode if out of scope.

func (Core) SendRequest

func (c Core) SendRequest(request string, followredirects string) (map[string]interface{}, error)

Sends the HTTP request, optionally following redirections. Returns the request sent and response received and followed redirections, if any. The Mode is enforced when sending the request (and following redirections), custom manual requests are not allowed in 'Safe' mode nor in 'Protected' mode if out of scope.

func (Core) SessionLocation

func (c Core) SessionLocation() (map[string]interface{}, error)

Gets the location of the current session file

func (Core) SetHomeDirectory

func (c Core) SetHomeDirectory(dir string) (map[string]interface{}, error)

func (Core) SetMode

func (c Core) SetMode(mode string) (map[string]interface{}, error)

Sets the mode, which may be one of [safe, protect, standard, attack]

func (Core) SetOptionAlertOverridesFilePath

func (c Core) SetOptionAlertOverridesFilePath(filepath string) (map[string]interface{}, error)

Sets (or clears, if empty) the path to the file with alert overrides.

func (Core) SetOptionDefaultUserAgent

func (c Core) SetOptionDefaultUserAgent(str string) (map[string]interface{}, error)

Sets the user agent that ZAP should use when creating HTTP messages (for example, spider messages or CONNECT requests to outgoing proxy).

func (Core) SetOptionDnsTtlSuccessfulQueries

func (c Core) SetOptionDnsTtlSuccessfulQueries(i int) (map[string]interface{}, error)

Sets the TTL (in seconds) of successful DNS queries (applies after ZAP restart).

func (Core) SetOptionHttpStateEnabled

func (c Core) SetOptionHttpStateEnabled(boolean bool) (map[string]interface{}, error)

func (Core) SetOptionMaximumAlertInstances

func (c Core) SetOptionMaximumAlertInstances(numberofinstances string) (map[string]interface{}, error)

Sets the maximum number of alert instances to include in a report. A value of zero is treated as unlimited.

func (Core) SetOptionMergeRelatedAlerts

func (c Core) SetOptionMergeRelatedAlerts(enabled string) (map[string]interface{}, error)

Sets whether or not related alerts will be merged in any reports generated.

func (Core) SetOptionProxyChainName

func (c Core) SetOptionProxyChainName(str string) (map[string]interface{}, error)

func (Core) SetOptionProxyChainPassword

func (c Core) SetOptionProxyChainPassword(str string) (map[string]interface{}, error)

func (Core) SetOptionProxyChainPort

func (c Core) SetOptionProxyChainPort(i int) (map[string]interface{}, error)

func (Core) SetOptionProxyChainPrompt

func (c Core) SetOptionProxyChainPrompt(boolean bool) (map[string]interface{}, error)

func (Core) SetOptionProxyChainRealm

func (c Core) SetOptionProxyChainRealm(str string) (map[string]interface{}, error)

func (Core) SetOptionProxyChainSkipName

func (c Core) SetOptionProxyChainSkipName(str string) (map[string]interface{}, error)

Use actions [add|modify|remove]ProxyChainExcludedDomain instead.

func (Core) SetOptionProxyChainUserName

func (c Core) SetOptionProxyChainUserName(str string) (map[string]interface{}, error)

func (Core) SetOptionSingleCookieRequestHeader

func (c Core) SetOptionSingleCookieRequestHeader(boolean bool) (map[string]interface{}, error)

func (Core) SetOptionTimeoutInSecs

func (c Core) SetOptionTimeoutInSecs(i int) (map[string]interface{}, error)

func (Core) SetOptionUseProxyChain

func (c Core) SetOptionUseProxyChain(boolean bool) (map[string]interface{}, error)

Sets whether or not the outgoing proxy should be used. The address/hostname of the outgoing proxy must be set to enable this option.

func (Core) SetOptionUseProxyChainAuth

func (c Core) SetOptionUseProxyChainAuth(boolean bool) (map[string]interface{}, error)

func (Core) Setproxy

func (c Core) Setproxy(proxy string) ([]byte, error)

func (Core) Shutdown

func (c Core) Shutdown() (map[string]interface{}, error)

Shuts down ZAP

func (Core) Sites

func (c Core) Sites() (map[string]interface{}, error)

Gets the sites accessed through/by ZAP (scheme and domain)

func (Core) SnapshotSession

func (c Core) SnapshotSession() (map[string]interface{}, error)

func (Core) Urls

func (c Core) Urls(baseurl string) (map[string]interface{}, error)

Gets the URLs accessed through/by ZAP, optionally filtering by (base) URL.

func (Core) Version

func (c Core) Version() (map[string]interface{}, error)

Gets ZAP version

func (Core) Xmlreport

func (c Core) Xmlreport() ([]byte, error)

Generates a report in XML format

func (Core) ZapHomePath

func (c Core) ZapHomePath() (map[string]interface{}, error)

Gets the path to ZAP's home directory.

type ForcedUser

type ForcedUser struct {
	// contains filtered or unexported fields
}

func (ForcedUser) GetForcedUser

func (f ForcedUser) GetForcedUser(contextid string) (map[string]interface{}, error)

Gets the user (ID) set as 'forced user' for the given context (ID)

func (ForcedUser) IsForcedUserModeEnabled

func (f ForcedUser) IsForcedUserModeEnabled() (map[string]interface{}, error)

Returns 'true' if 'forced user' mode is enabled, 'false' otherwise

func (ForcedUser) SetForcedUser

func (f ForcedUser) SetForcedUser(contextid string, userid string) (map[string]interface{}, error)

Sets the user (ID) that should be used in 'forced user' mode for the given context (ID)

func (ForcedUser) SetForcedUserModeEnabled

func (f ForcedUser) SetForcedUserModeEnabled(boolean bool) (map[string]interface{}, error)

Sets if 'forced user' mode should be enabled or not

type HttpSessions

type HttpSessions struct {
	// contains filtered or unexported fields
}

func (HttpSessions) ActiveSession

func (h HttpSessions) ActiveSession(site string) (map[string]interface{}, error)

Gets the name of the active session for the given site.

func (HttpSessions) AddSessionToken

func (h HttpSessions) AddSessionToken(site string, sessiontoken string) (map[string]interface{}, error)

Adds the session token to the given site.

func (HttpSessions) CreateEmptySession

func (h HttpSessions) CreateEmptySession(site string, session string) (map[string]interface{}, error)

Creates an empty session for the given site. Optionally with the given name.

func (HttpSessions) RemoveSession

func (h HttpSessions) RemoveSession(site string, session string) (map[string]interface{}, error)

Removes the session from the given site.

func (HttpSessions) RemoveSessionToken

func (h HttpSessions) RemoveSessionToken(site string, sessiontoken string) (map[string]interface{}, error)

Removes the session token from the given site.

func (HttpSessions) RenameSession

func (h HttpSessions) RenameSession(site string, oldsessionname string, newsessionname string) (map[string]interface{}, error)

Renames the session of the given site.

func (HttpSessions) SessionTokens

func (h HttpSessions) SessionTokens(site string) (map[string]interface{}, error)

Gets the names of the session tokens for the given site.

func (HttpSessions) Sessions

func (h HttpSessions) Sessions(site string, session string) (map[string]interface{}, error)

Gets the sessions for the given site. Optionally returning just the session with the given name.

func (HttpSessions) SetActiveSession

func (h HttpSessions) SetActiveSession(site string, session string) (map[string]interface{}, error)

Sets the given session as active for the given site.

func (HttpSessions) SetSessionTokenValue

func (h HttpSessions) SetSessionTokenValue(site string, session string, sessiontoken string, tokenvalue string) (map[string]interface{}, error)

Sets the value of the session token of the given session for the given site.

func (HttpSessions) Sites

func (h HttpSessions) Sites() (map[string]interface{}, error)

Gets all of the sites that have sessions.

func (HttpSessions) UnsetActiveSession

func (h HttpSessions) UnsetActiveSession(site string) (map[string]interface{}, error)

Unsets the active session of the given site.

type Interface

type Interface interface {
	Acsrf() *Acsrf
	Ascan() *Ascan
	Authentication() *Authentication
	Authorization() *Authorization
	Autoupdate() *Autoupdate
	Break() *Break
	Context() *Context
	Core() *Core
	ForcedUser() *ForcedUser
	HttpSessions() *HttpSessions
	Params() *Params
	Pscan() *Pscan
	Script() *Script
	Search() *Search
	Spider() *Spider
	Stats() *Stats
	Users() *Users
}

Interface defines the interface a ZAP client should implement

func NewClient

func NewClient(cfg *Config) (Interface, error)

NewClient returns a new ZAP client based on the passed in config

type Params

type Params struct {
	// contains filtered or unexported fields
}

func (Params) Params

func (p Params) Params(site string) (map[string]interface{}, error)

Shows the parameters for the specified site, or for all sites if the site is not specified

type Pscan

type Pscan struct {
	// contains filtered or unexported fields
}

func (Pscan) DisableAllScanners

func (p Pscan) DisableAllScanners() (map[string]interface{}, error)

Disables all passive scanners

func (Pscan) DisableScanners

func (p Pscan) DisableScanners(ids string) (map[string]interface{}, error)

Disables all passive scanners with the given IDs (comma separated list of IDs)

func (Pscan) EnableAllScanners

func (p Pscan) EnableAllScanners() (map[string]interface{}, error)

Enables all passive scanners

func (Pscan) EnableScanners

func (p Pscan) EnableScanners(ids string) (map[string]interface{}, error)

Enables all passive scanners with the given IDs (comma separated list of IDs)

func (Pscan) RecordsToScan

func (p Pscan) RecordsToScan() (map[string]interface{}, error)

The number of records the passive scanner still has to scan

func (Pscan) ScanOnlyInScope

func (p Pscan) ScanOnlyInScope() (map[string]interface{}, error)

Tells whether or not the passive scan should be performed only on messages that are in scope.

func (Pscan) Scanners

func (p Pscan) Scanners() (map[string]interface{}, error)

Lists all passive scanners with its ID, name, enabled state and alert threshold.

func (Pscan) SetEnabled

func (p Pscan) SetEnabled(enabled string) (map[string]interface{}, error)

Sets whether or not the passive scanning is enabled (Note: the enabled state is not persisted).

func (Pscan) SetScanOnlyInScope

func (p Pscan) SetScanOnlyInScope(onlyinscope string) (map[string]interface{}, error)

Sets whether or not the passive scan should be performed only on messages that are in scope.

func (Pscan) SetScannerAlertThreshold

func (p Pscan) SetScannerAlertThreshold(id string, alertthreshold string) (map[string]interface{}, error)

Sets the alert threshold of the passive scanner with the given ID, accepted values for alert threshold: OFF, DEFAULT, LOW, MEDIUM and HIGH

type Script

type Script struct {
	// contains filtered or unexported fields
}

func (Script) Disable

func (s Script) Disable(scriptname string) (map[string]interface{}, error)

Disables the script with the given name

func (Script) Enable

func (s Script) Enable(scriptname string) (map[string]interface{}, error)

Enables the script with the given name

func (Script) ListEngines

func (s Script) ListEngines() (map[string]interface{}, error)

Lists the script engines available

func (Script) ListScripts

func (s Script) ListScripts() (map[string]interface{}, error)

Lists the scripts available, with its engine, name, description, type and error state.

func (Script) Load

func (s Script) Load(scriptname string, scripttype string, scriptengine string, filename string, scriptdescription string, charset string) (map[string]interface{}, error)

Loads a script into ZAP from the given local file, with the given name, type and engine, optionally with a description, and a charset name to read the script (the charset name is required if the script is not in UTF-8, for example, in ISO-8859-1).

func (Script) Remove

func (s Script) Remove(scriptname string) (map[string]interface{}, error)

Removes the script with the given name

func (Script) RunStandAloneScript

func (s Script) RunStandAloneScript(scriptname string) (map[string]interface{}, error)

Runs the stand alone script with the give name

type Search struct {
	// contains filtered or unexported fields
}

func (Search) HarByHeaderRegex

func (s Search) HarByHeaderRegex(regex string, baseurl string, start string, count string) ([]byte, error)

func (Search) HarByRequestRegex

func (s Search) HarByRequestRegex(regex string, baseurl string, start string, count string) ([]byte, error)

func (Search) HarByResponseRegex

func (s Search) HarByResponseRegex(regex string, baseurl string, start string, count string) ([]byte, error)

func (Search) HarByUrlRegex

func (s Search) HarByUrlRegex(regex string, baseurl string, start string, count string) ([]byte, error)

func (Search) MessagesByHeaderRegex

func (s Search) MessagesByHeaderRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) MessagesByRequestRegex

func (s Search) MessagesByRequestRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) MessagesByResponseRegex

func (s Search) MessagesByResponseRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) MessagesByUrlRegex

func (s Search) MessagesByUrlRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) UrlsByHeaderRegex

func (s Search) UrlsByHeaderRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) UrlsByRequestRegex

func (s Search) UrlsByRequestRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) UrlsByResponseRegex

func (s Search) UrlsByResponseRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

func (Search) UrlsByUrlRegex

func (s Search) UrlsByUrlRegex(regex string, baseurl string, start string, count string) (map[string]interface{}, error)

type SessionManagement

type SessionManagement struct {
	// contains filtered or unexported fields
}

func (SessionManagement) GetSessionManagementMethod

func (s SessionManagement) GetSessionManagementMethod(contextid string) (map[string]interface{}, error)

func (SessionManagement) GetSessionManagementMethodConfigParams

func (s SessionManagement) GetSessionManagementMethodConfigParams(methodname string) (map[string]interface{}, error)

func (SessionManagement) GetSupportedSessionManagementMethods

func (s SessionManagement) GetSupportedSessionManagementMethods() (map[string]interface{}, error)

func (SessionManagement) SetSessionManagementMethod

func (s SessionManagement) SetSessionManagementMethod(contextid string, methodname string, methodconfigparams string) (map[string]interface{}, error)

type Spider

type Spider struct {
	// contains filtered or unexported fields
}

func (Spider) AddDomainAlwaysInScope

func (s Spider) AddDomainAlwaysInScope(value string, isregex string, isenabled string) (map[string]interface{}, error)

Adds a new domain that's always in scope, using the specified value. Optionally sets if the new entry is enabled (default, true) and whether or not the new value is specified as a regex (default, false).

func (Spider) AddedNodes

func (s Spider) AddedNodes(scanid string) (map[string]interface{}, error)

Returns a list of the names of the nodes added to the Sites tree by the specified scan.

func (Spider) AjaxScanResults

func (s Spider) AjaxScanResults(start string, count string) (map[string]interface{}, error)

func (Spider) AjaxScanStatus

func (s Spider) AjaxScanStatus() (map[string]interface{}, error)

func (Spider) AllUrls

func (s Spider) AllUrls() (map[string]interface{}, error)

Returns a list of unique URLs from the history table based on HTTP messages added by the Spider.

func (Spider) ClearExcludedFromScan

func (s Spider) ClearExcludedFromScan() (map[string]interface{}, error)

Clears the regexes of URLs excluded from the spider scans.

func (Spider) DisableAllDomainsAlwaysInScope

func (s Spider) DisableAllDomainsAlwaysInScope() (map[string]interface{}, error)

Disables all domains that are always in scope.

func (Spider) DomainsAlwaysInScope

func (s Spider) DomainsAlwaysInScope() (map[string]interface{}, error)

Gets all the domains that are always in scope. For each domain the following are shown: the index, the value (domain), if enabled, and if specified as a regex.

func (Spider) EnableAllDomainsAlwaysInScope

func (s Spider) EnableAllDomainsAlwaysInScope() (map[string]interface{}, error)

Enables all domains that are always in scope.

func (Spider) ExcludeFromScan

func (s Spider) ExcludeFromScan(regex string) (map[string]interface{}, error)

Adds a regex of URLs that should be excluded from the spider scans.

func (Spider) ExcludedFromScan

func (s Spider) ExcludedFromScan() (map[string]interface{}, error)

Gets the regexes of URLs excluded from the spider scans.

func (Spider) FullResults

func (s Spider) FullResults(scanid string) (map[string]interface{}, error)

func (Spider) ModifyDomainAlwaysInScope

func (s Spider) ModifyDomainAlwaysInScope(idx string, value string, isregex string, isenabled string) (map[string]interface{}, error)

Modifies a domain that's always in scope. Allows to modify the value, if enabled or if a regex. The domain is selected with its index, which can be obtained with the view domainsAlwaysInScope.

func (Spider) OptionAcceptCookies

func (s Spider) OptionAcceptCookies() (map[string]interface{}, error)

Gets whether or not a spider process should accept cookies while spidering.

func (Spider) OptionDomainsAlwaysInScope

func (s Spider) OptionDomainsAlwaysInScope() (map[string]interface{}, error)

Use view domainsAlwaysInScope instead.

func (Spider) OptionDomainsAlwaysInScopeEnabled

func (s Spider) OptionDomainsAlwaysInScopeEnabled() (map[string]interface{}, error)

Use view domainsAlwaysInScope instead.

func (Spider) OptionHandleODataParametersVisited

func (s Spider) OptionHandleODataParametersVisited() (map[string]interface{}, error)

func (Spider) OptionHandleParameters

func (s Spider) OptionHandleParameters() (map[string]interface{}, error)

func (Spider) OptionMaxChildren

func (s Spider) OptionMaxChildren() (map[string]interface{}, error)

Gets the maximum number of child nodes (per node) that can be crawled, 0 means no limit.

func (Spider) OptionMaxDepth

func (s Spider) OptionMaxDepth() (map[string]interface{}, error)

func (Spider) OptionMaxDuration

func (s Spider) OptionMaxDuration() (map[string]interface{}, error)

func (Spider) OptionMaxParseSizeBytes

func (s Spider) OptionMaxParseSizeBytes() (map[string]interface{}, error)

Gets the maximum size, in bytes, that a response might have to be parsed.

func (Spider) OptionMaxScansInUI

func (s Spider) OptionMaxScansInUI() (map[string]interface{}, error)

func (Spider) OptionParseComments

func (s Spider) OptionParseComments() (map[string]interface{}, error)

func (Spider) OptionParseGit

func (s Spider) OptionParseGit() (map[string]interface{}, error)

func (Spider) OptionParseRobotsTxt

func (s Spider) OptionParseRobotsTxt() (map[string]interface{}, error)

func (Spider) OptionParseSVNEntries

func (s Spider) OptionParseSVNEntries() (map[string]interface{}, error)

func (Spider) OptionParseSitemapXml

func (s Spider) OptionParseSitemapXml() (map[string]interface{}, error)

func (Spider) OptionPostForm

func (s Spider) OptionPostForm() (map[string]interface{}, error)

func (Spider) OptionProcessForm

func (s Spider) OptionProcessForm() (map[string]interface{}, error)

func (Spider) OptionRequestWaitTime

func (s Spider) OptionRequestWaitTime() (map[string]interface{}, error)

func (Spider) OptionScope

func (s Spider) OptionScope() (map[string]interface{}, error)

func (Spider) OptionScopeText

func (s Spider) OptionScopeText() (map[string]interface{}, error)

func (Spider) OptionSendRefererHeader

func (s Spider) OptionSendRefererHeader() (map[string]interface{}, error)

Gets whether or not the 'Referer' header should be sent while spidering.

func (Spider) OptionShowAdvancedDialog

func (s Spider) OptionShowAdvancedDialog() (map[string]interface{}, error)

func (Spider) OptionSkipURLString

func (s Spider) OptionSkipURLString() (map[string]interface{}, error)

func (Spider) OptionThreadCount

func (s Spider) OptionThreadCount() (map[string]interface{}, error)

func (Spider) OptionUserAgent

func (s Spider) OptionUserAgent() (map[string]interface{}, error)

func (Spider) Pause

func (s Spider) Pause(scanid string) (map[string]interface{}, error)

func (Spider) PauseAllScans

func (s Spider) PauseAllScans() (map[string]interface{}, error)

func (Spider) RemoveAllScans

func (s Spider) RemoveAllScans() (map[string]interface{}, error)

func (Spider) RemoveDomainAlwaysInScope

func (s Spider) RemoveDomainAlwaysInScope(idx string) (map[string]interface{}, error)

Removes a domain that's always in scope, with the given index. The index can be obtained with the view domainsAlwaysInScope.

func (Spider) RemoveScan

func (s Spider) RemoveScan(scanid string) (map[string]interface{}, error)

func (Spider) Results

func (s Spider) Results(scanid string) (map[string]interface{}, error)

func (Spider) Resume

func (s Spider) Resume(scanid string) (map[string]interface{}, error)

func (Spider) ResumeAllScans

func (s Spider) ResumeAllScans() (map[string]interface{}, error)

func (Spider) Scan

func (s Spider) Scan(url string, maxchildren string, recurse string, contextname string, subtreeonly string) (map[string]interface{}, error)

Runs the spider against the given URL (or context). Optionally, the 'maxChildren' parameter can be set to limit the number of children scanned, the 'recurse' parameter can be used to prevent the spider from seeding recursively, the parameter 'contextName' can be used to constrain the scan to a Context and the parameter 'subtreeOnly' allows to restrict the spider under a site's subtree (using the specified 'url').

func (Spider) ScanAjax

func (s Spider) ScanAjax(url string, inscope string, contextname string, subtreeonly string) (map[string]interface{}, error)

func (Spider) ScanAjaxAsUser

func (s Spider) ScanAjaxAsUser(contextname string, username string, url string, subtreeonly string) (map[string]interface{}, error)

func (Spider) ScanAsUser

func (s Spider) ScanAsUser(contextid string, userid string, url string, maxchildren string, recurse string, subtreeonly string) (map[string]interface{}, error)

Runs the spider from the perspective of a User, obtained using the given Context ID and User ID. See 'scan' action for more details.

func (Spider) Scans

func (s Spider) Scans() (map[string]interface{}, error)

func (Spider) SetOptionAcceptCookies

func (s Spider) SetOptionAcceptCookies(boolean bool) (map[string]interface{}, error)

Sets whether or not a spider process should accept cookies while spidering.

func (Spider) SetOptionHandleODataParametersVisited

func (s Spider) SetOptionHandleODataParametersVisited(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionHandleParameters

func (s Spider) SetOptionHandleParameters(str string) (map[string]interface{}, error)

func (Spider) SetOptionMaxChildren

func (s Spider) SetOptionMaxChildren(i int) (map[string]interface{}, error)

Sets the maximum number of child nodes (per node) that can be crawled, 0 means no limit.

func (Spider) SetOptionMaxDepth

func (s Spider) SetOptionMaxDepth(i int) (map[string]interface{}, error)

func (Spider) SetOptionMaxDuration

func (s Spider) SetOptionMaxDuration(i int) (map[string]interface{}, error)

func (Spider) SetOptionMaxParseSizeBytes

func (s Spider) SetOptionMaxParseSizeBytes(i int) (map[string]interface{}, error)

Sets the maximum size, in bytes, that a response might have to be parsed. This allows the spider to skip big responses/files.

func (Spider) SetOptionMaxScansInUI

func (s Spider) SetOptionMaxScansInUI(i int) (map[string]interface{}, error)

func (Spider) SetOptionParseComments

func (s Spider) SetOptionParseComments(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionParseGit

func (s Spider) SetOptionParseGit(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionParseRobotsTxt

func (s Spider) SetOptionParseRobotsTxt(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionParseSVNEntries

func (s Spider) SetOptionParseSVNEntries(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionParseSitemapXml

func (s Spider) SetOptionParseSitemapXml(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionPostForm

func (s Spider) SetOptionPostForm(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionProcessForm

func (s Spider) SetOptionProcessForm(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionRequestWaitTime

func (s Spider) SetOptionRequestWaitTime(i int) (map[string]interface{}, error)

func (Spider) SetOptionScopeString

func (s Spider) SetOptionScopeString(str string) (map[string]interface{}, error)

Use actions [add|modify|remove]DomainAlwaysInScope instead.

func (Spider) SetOptionSendRefererHeader

func (s Spider) SetOptionSendRefererHeader(boolean bool) (map[string]interface{}, error)

Sets whether or not the 'Referer' header should be sent while spidering.

func (Spider) SetOptionShowAdvancedDialog

func (s Spider) SetOptionShowAdvancedDialog(boolean bool) (map[string]interface{}, error)

func (Spider) SetOptionSkipURLString

func (s Spider) SetOptionSkipURLString(str string) (map[string]interface{}, error)

func (Spider) SetOptionThreadCount

func (s Spider) SetOptionThreadCount(i int) (map[string]interface{}, error)

func (Spider) SetOptionUserAgent

func (s Spider) SetOptionUserAgent(str string) (map[string]interface{}, error)

func (Spider) Status

func (s Spider) Status(scanid string) (map[string]interface{}, error)

func (Spider) Stop

func (s Spider) Stop(scanid string) (map[string]interface{}, error)

func (Spider) StopAllScans

func (s Spider) StopAllScans() (map[string]interface{}, error)

type Stats

type Stats struct {
	// contains filtered or unexported fields
}

func (Stats) AllSitesStats

func (s Stats) AllSitesStats(keyprefix string) (map[string]interface{}, error)

Gets all of the site based statistics, optionally filtered by a key prefix

func (Stats) ClearStats

func (s Stats) ClearStats(keyprefix string) (map[string]interface{}, error)

Clears all of the statistics

func (Stats) OptionInMemoryEnabled

func (s Stats) OptionInMemoryEnabled() (map[string]interface{}, error)

Returns 'true' if in memory statistics are enabled, otherwise returns 'false'

func (Stats) OptionStatsdEnabled

func (s Stats) OptionStatsdEnabled() (map[string]interface{}, error)

Returns 'true' if a Statsd server has been correctly configured, otherwise returns 'false'

func (Stats) OptionStatsdHost

func (s Stats) OptionStatsdHost() (map[string]interface{}, error)

Gets the Statsd service hostname

func (Stats) OptionStatsdPort

func (s Stats) OptionStatsdPort() (map[string]interface{}, error)

Gets the Statsd service port

func (Stats) OptionStatsdPrefix

func (s Stats) OptionStatsdPrefix() (map[string]interface{}, error)

Gets the prefix to be applied to all stats sent to the configured Statsd service

func (Stats) SetOptionInMemoryEnabled

func (s Stats) SetOptionInMemoryEnabled(boolean bool) (map[string]interface{}, error)

Sets whether in memory statistics are enabled

func (Stats) SetOptionStatsdHost

func (s Stats) SetOptionStatsdHost(str string) (map[string]interface{}, error)

Sets the Statsd service hostname, supply an empty string to stop using a Statsd service

func (Stats) SetOptionStatsdPort

func (s Stats) SetOptionStatsdPort(i int) (map[string]interface{}, error)

Sets the Statsd service port

func (Stats) SetOptionStatsdPrefix

func (s Stats) SetOptionStatsdPrefix(str string) (map[string]interface{}, error)

Sets the prefix to be applied to all stats sent to the configured Statsd service

func (Stats) SiteStats

func (s Stats) SiteStats(site string, keyprefix string) (map[string]interface{}, error)

Gets all of the global statistics, optionally filtered by a key prefix

func (Stats) Stats

func (s Stats) Stats(keyprefix string) (map[string]interface{}, error)

Statistics

type Users

type Users struct {
	// contains filtered or unexported fields
}

func (Users) GetAuthenticationCredentials

func (u Users) GetAuthenticationCredentials(contextid string, userid string) (map[string]interface{}, error)

func (Users) GetAuthenticationCredentialsConfigParams

func (u Users) GetAuthenticationCredentialsConfigParams(contextid string) (map[string]interface{}, error)

func (Users) GetUserById

func (u Users) GetUserById(contextid string, userid string) (map[string]interface{}, error)

func (Users) NewUser

func (u Users) NewUser(contextid string, name string) (map[string]interface{}, error)

func (Users) RemoveUser

func (u Users) RemoveUser(contextid string, userid string) (map[string]interface{}, error)

func (Users) SetAuthenticationCredentials

func (u Users) SetAuthenticationCredentials(contextid string, userid string, authcredentialsconfigparams string) (map[string]interface{}, error)

func (Users) SetUserEnabled

func (u Users) SetUserEnabled(contextid string, userid string, enabled string) (map[string]interface{}, error)

func (Users) SetUserName

func (u Users) SetUserName(contextid string, userid string, name string) (map[string]interface{}, error)

func (Users) UsersList

func (u Users) UsersList(contextid string) (map[string]interface{}, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL