zap

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 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 AccessControl

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

func (AccessControl) GetScanProgress

func (a AccessControl) GetScanProgress(contextid string) (map[string]interface{}, error)

Gets the Access Control scan progress (percentage integer) for the given context ID.

This component is optional and therefore the API will only work if it is installed

func (AccessControl) GetScanStatus

func (a AccessControl) GetScanStatus(contextid string) (map[string]interface{}, error)

Gets the Access Control scan status (description string) for the given context ID.

This component is optional and therefore the API will only work if it is installed

func (AccessControl) Scan

func (a AccessControl) Scan(contextid string, userid string, scanasunauthuser string, raisealert string, alertrisklevel string) (map[string]interface{}, error)

Starts an Access Control scan with the given context ID and user ID. (Optional parameters: user ID for Unauthenticated user, boolean identifying whether or not Alerts are raised, and the Risk level for the Alerts.) [This assumes the Access Control rules were previously established via ZAP gui and the necessary Context exported/imported.]

This component is optional and therefore the API will only work if it is installed

func (AccessControl) WriteHTMLreport

func (a AccessControl) WriteHTMLreport(contextid string, filename string) (map[string]interface{}, error)

Generates an Access Control report for the given context ID and saves it based on the provided filename (path).

This component is optional and therefore the API will only work if it is installed

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) OptionPartialMatchingEnabled

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

Define if ZAP should detect CSRF tokens by searching for partial matches

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

func (Acsrf) SetOptionPartialMatchingEnabled

func (a Acsrf) SetOptionPartialMatchingEnabled(boolean bool) (map[string]interface{}, error)

Define if ZAP should detect CSRF tokens by searching for partial matches.

type AjaxSpider

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

func (AjaxSpider) AddAllowedResource

func (a AjaxSpider) AddAllowedResource(regex string, enabled string) (map[string]interface{}, error)

Adds an allowed resource.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) AllowedResources

func (a AjaxSpider) AllowedResources() (map[string]interface{}, error)

Gets the allowed resources. The allowed resources are always fetched even if out of scope, allowing to include necessary resources (e.g. scripts) from 3rd-parties.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) FullResults

func (a AjaxSpider) FullResults() (map[string]interface{}, error)

Gets the full crawled content detected by the AJAX Spider. Returns a set of values based on 'inScope' URLs, 'outOfScope' URLs, and 'errors' encountered during the last/current run of the AJAX Spider.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) NumberOfResults

func (a AjaxSpider) NumberOfResults() (map[string]interface{}, error)

Gets the number of resources found.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionBrowserId

func (a AjaxSpider) OptionBrowserId() (map[string]interface{}, error)

Gets the configured browser to use for crawling.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionClickDefaultElems

func (a AjaxSpider) OptionClickDefaultElems() (map[string]interface{}, error)

Gets the configured value for 'Click Default Elements Only', HTML elements such as 'a', 'button', 'input', all associated with some action or links on the page.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionClickElemsOnce

func (a AjaxSpider) OptionClickElemsOnce() (map[string]interface{}, error)

Gets the value configured for the AJAX Spider to know if it should click on the elements only once.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionEventWait

func (a AjaxSpider) OptionEventWait() (map[string]interface{}, error)

Gets the time to wait after an event (in milliseconds). For example: the wait delay after the cursor hovers over an element, in order for a menu to display, etc.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionMaxCrawlDepth

func (a AjaxSpider) OptionMaxCrawlDepth() (map[string]interface{}, error)

Gets the configured value for the max crawl depth.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionMaxCrawlStates

func (a AjaxSpider) OptionMaxCrawlStates() (map[string]interface{}, error)

Gets the configured value for the maximum crawl states allowed.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionMaxDuration

func (a AjaxSpider) OptionMaxDuration() (map[string]interface{}, error)

Gets the configured max duration of the crawl, the value is in minutes.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionNumberOfBrowsers

func (a AjaxSpider) OptionNumberOfBrowsers() (map[string]interface{}, error)

Gets the configured number of browsers to be used.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionRandomInputs

func (a AjaxSpider) OptionRandomInputs() (map[string]interface{}, error)

Gets if the AJAX Spider will use random values in form fields when crawling, if set to true.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) OptionReloadWait

func (a AjaxSpider) OptionReloadWait() (map[string]interface{}, error)

Gets the configured time to wait after reloading the page, this value is in milliseconds.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) RemoveAllowedResource

func (a AjaxSpider) RemoveAllowedResource(regex string) (map[string]interface{}, error)

Removes an allowed resource.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) Results

func (a AjaxSpider) Results(start string, count string) (map[string]interface{}, error)

Gets the current results of the crawler.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) Scan

func (a AjaxSpider) Scan(url string, inscope string, contextname string, subtreeonly string) (map[string]interface{}, error)

Runs the AJAX Spider against a given target.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) ScanAsUser

func (a AjaxSpider) ScanAsUser(contextname string, username string, url string, subtreeonly string) (map[string]interface{}, error)

Runs the AJAX Spider from the perspective of a User of the web application.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetEnabledAllowedResource

func (a AjaxSpider) SetEnabledAllowedResource(regex string, enabled string) (map[string]interface{}, error)

Sets whether or not an allowed resource is enabled.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionBrowserId

func (a AjaxSpider) SetOptionBrowserId(str string) (map[string]interface{}, error)

Sets the configuration of the AJAX Spider to use one of the supported browsers.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionClickDefaultElems

func (a AjaxSpider) SetOptionClickDefaultElems(boolean bool) (map[string]interface{}, error)

Sets whether or not the the AJAX Spider will only click on the default HTML elements.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionClickElemsOnce

func (a AjaxSpider) SetOptionClickElemsOnce(boolean bool) (map[string]interface{}, error)

When enabled, the crawler attempts to interact with each element (e.g., by clicking) only once.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionEventWait

func (a AjaxSpider) SetOptionEventWait(i int) (map[string]interface{}, error)

Sets the time to wait after an event (in milliseconds). For example: the wait delay after the cursor hovers over an element, in order for a menu to display, etc.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionMaxCrawlDepth

func (a AjaxSpider) SetOptionMaxCrawlDepth(i int) (map[string]interface{}, error)

Sets the maximum depth that the crawler can reach.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionMaxCrawlStates

func (a AjaxSpider) SetOptionMaxCrawlStates(i int) (map[string]interface{}, error)

Sets the maximum number of states that the crawler should crawl.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionMaxDuration

func (a AjaxSpider) SetOptionMaxDuration(i int) (map[string]interface{}, error)

The maximum time that the crawler is allowed to run.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionNumberOfBrowsers

func (a AjaxSpider) SetOptionNumberOfBrowsers(i int) (map[string]interface{}, error)

Sets the number of windows to be used by AJAX Spider.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionRandomInputs

func (a AjaxSpider) SetOptionRandomInputs(boolean bool) (map[string]interface{}, error)

When enabled, inserts random values into form fields.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) SetOptionReloadWait

func (a AjaxSpider) SetOptionReloadWait(i int) (map[string]interface{}, error)

Sets the time to wait after the page is loaded before interacting with it.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) Status

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

Gets the current status of the crawler. Actual values are Stopped and Running.

This component is optional and therefore the API will only work if it is installed

func (AjaxSpider) Stop

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

Stops the AJAX Spider.

This component is optional and therefore the API will only work if it is installed

type Alert

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

func (Alert) AddAlert

func (a Alert) AddAlert(messageid string, name string, riskid string, confidenceid string, description string, param string, attack string, otherinfo string, solution string, references string, evidence string, cweid string, wascid string) (map[string]interface{}, error)

Add an alert associated with the given message ID, with the provided details. (The ID of the created alert is returned.)

func (Alert) Alert

func (a Alert) 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 (Alert) AlertCountsByRisk

func (a Alert) AlertCountsByRisk(url string, recurse string) (map[string]interface{}, error)

Gets a count of the alerts, optionally filtered as per alertsPerRisk

func (Alert) Alerts

func (a Alert) 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 (Alert) AlertsByRisk

func (a Alert) AlertsByRisk(url string, recurse string) (map[string]interface{}, error)

Gets a summary of the alerts, optionally filtered by a 'url'. If 'recurse' is true then all alerts that apply to urls that start with the specified 'url' will be returned, otherwise only those on exactly the same 'url' (ignoring url parameters)

func (Alert) AlertsSummary

func (a Alert) AlertsSummary(baseurl string) (map[string]interface{}, error)

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

func (Alert) DeleteAlert

func (a Alert) DeleteAlert(id string) (map[string]interface{}, error)

Deletes the alert with the given ID.

func (Alert) DeleteAllAlerts

func (a Alert) DeleteAllAlerts() (map[string]interface{}, error)

Deletes all alerts of the current session.

func (Alert) NumberOfAlerts

func (a Alert) NumberOfAlerts(baseurl string, riskid string) (map[string]interface{}, error)

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

func (Alert) UpdateAlert

func (a Alert) UpdateAlert(id string, name string, riskid string, confidenceid string, description string, param string, attack string, otherinfo string, solution string, references string, evidence string, cweid string, wascid string) (map[string]interface{}, error)

Update the alert with the given ID, with the provided details.

func (Alert) UpdateAlertsConfidence

func (a Alert) UpdateAlertsConfidence(ids string, confidenceid string) (map[string]interface{}, error)

Update the confidence of the alerts.

func (Alert) UpdateAlertsRisk

func (a Alert) UpdateAlertsRisk(ids string, riskid string) (map[string]interface{}, error)

Update the risk of the alerts.

type AlertFilter

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

func (AlertFilter) AddAlertFilter

func (a AlertFilter) AddAlertFilter(contextid string, ruleid string, newlevel string, url string, urlisregex string, parameter string, enabled string, parameterisregex string, attack string, attackisregex string, evidence string, evidenceisregex string) (map[string]interface{}, error)

Adds a new alert filter for the context with the given ID.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) AddGlobalAlertFilter

func (a AlertFilter) AddGlobalAlertFilter(ruleid string, newlevel string, url string, urlisregex string, parameter string, enabled string, parameterisregex string, attack string, attackisregex string, evidence string, evidenceisregex string) (map[string]interface{}, error)

Adds a new global alert filter.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) AlertFilterList

func (a AlertFilter) AlertFilterList(contextid string) (map[string]interface{}, error)

Lists the alert filters of the context with the given ID.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) ApplyAll

func (a AlertFilter) ApplyAll() (map[string]interface{}, error)

Applies all currently enabled Global and Context alert filters.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) ApplyContext

func (a AlertFilter) ApplyContext() (map[string]interface{}, error)

Applies all currently enabled Context alert filters.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) ApplyGlobal

func (a AlertFilter) ApplyGlobal() (map[string]interface{}, error)

Applies all currently enabled Global alert filters.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) GlobalAlertFilterList

func (a AlertFilter) GlobalAlertFilterList() (map[string]interface{}, error)

Lists the global alert filters.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) RemoveAlertFilter

func (a AlertFilter) RemoveAlertFilter(contextid string, ruleid string, newlevel string, url string, urlisregex string, parameter string, enabled string, parameterisregex string, attack string, attackisregex string, evidence string, evidenceisregex string) (map[string]interface{}, error)

Removes an alert filter from the context with the given ID.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) RemoveGlobalAlertFilter

func (a AlertFilter) RemoveGlobalAlertFilter(ruleid string, newlevel string, url string, urlisregex string, parameter string, enabled string, parameterisregex string, attack string, attackisregex string, evidence string, evidenceisregex string) (map[string]interface{}, error)

Removes a global alert filter.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) TestAll

func (a AlertFilter) TestAll() (map[string]interface{}, error)

Tests all currently enabled Global and Context alert filters.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) TestContext

func (a AlertFilter) TestContext() (map[string]interface{}, error)

Tests all currently enabled Context alert filters.

This component is optional and therefore the API will only work if it is installed

func (AlertFilter) TestGlobal

func (a AlertFilter) TestGlobal() (map[string]interface{}, error)

Tests all currently enabled Global alert filters.

This component is optional and therefore the API will only work if it is installed

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)

Disables all scanners of the scan policy with the given name, or the default if none given.

func (Ascan) DisableScanners

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

Disables the scanners with the given IDs (comma separated list of IDs) of the scan policy with the given name, or the default if none given.

func (Ascan) EnableAllScanners

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

Enables all scanners of the scan policy with the given name, or the default if none given.

func (Ascan) EnableScanners

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

Enables the scanners with the given IDs (comma separated list of IDs) of the scan policy with the given name, or the default if none given.

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) OptionAddQueryParam

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

Tells whether or not the active scanner should add a query parameter to GET request that don't have parameters to start with.

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) OptionScanNullJsonValues

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

Tells whether or not the active scanner should scan null JSON values.

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)

Gets the scanners, optionally, of the given scan policy and/or scanner policy/category ID.

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) SetOptionAddQueryParam

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

Sets whether or not the active scanner should add a query param to GET requests which do not have parameters to start with.

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) SetOptionScanNullJsonValues

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

Sets whether or not the active scanner should scan null JSON values.

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)

Gets the name of the authentication method for the context with the given ID.

func (Authentication) GetAuthenticationMethodConfigParams

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

Gets the configuration parameters for the authentication method with the given name.

func (Authentication) GetLoggedInIndicator

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

Gets the logged in indicator for the context with the given ID.

func (Authentication) GetLoggedOutIndicator

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

Gets the logged out indicator for the context with the given ID.

func (Authentication) GetSupportedAuthenticationMethods

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

Gets the name of the authentication methods.

func (Authentication) SetAuthenticationMethod

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

Sets the authentication method for the context with the given ID.

func (Authentication) SetLoggedInIndicator

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

Sets the logged in indicator for the context with the given ID.

func (Authentication) SetLoggedOutIndicator

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

Sets the logged out indicator for the context with the given ID.

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 Automation

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

func (Automation) EndDelayJob

func (a Automation) EndDelayJob() (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Automation) PlanProgress

func (a Automation) PlanProgress(planid string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Automation) RunPlan

func (a Automation) RunPlan(filepath string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

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 (i.e. not asynchronously)

func (Autoupdate) InstallLocalAddon

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

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) LocalAddons

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

Returns a list with all local add-ons, installed or not.

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 breakpoint. 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 breakpoints

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 breakpoint

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) AccessControl

func (c *Client) AccessControl() *AccessControl

AccessControl() returns a AccessControl client

func (*Client) Acsrf

func (c *Client) Acsrf() *Acsrf

Acsrf() returns a Acsrf client

func (*Client) AjaxSpider

func (c *Client) AjaxSpider() *AjaxSpider

AjaxSpider() returns a AjaxSpider client

func (*Client) Alert

func (c *Client) Alert() *Alert

Alert() returns a Alert client

func (*Client) AlertFilter

func (c *Client) AlertFilter() *AlertFilter

AlertFilter() returns a AlertFilter 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) Automation

func (c *Client) Automation() *Automation

Automation() returns an Automation client

func (*Client) Autoupdate

func (c *Client) Autoupdate() *Autoupdate

Autoupdate returns an Autoupdate 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) Exportreport

func (c *Client) Exportreport() *Exportreport

Exportreport() returns a Exportreport 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) ImportLogFiles

func (c *Client) ImportLogFiles() *ImportLogFiles

ImportLogFiles() returns a ImportLogFiles client

func (*Client) Importurls

func (c *Client) Importurls() *Importurls

Importurls() returns a Importurls client

func (*Client) LocalProxies

func (c *Client) LocalProxies() *LocalProxies

LocalProxies() returns a LocalProxies client

func (*Client) Network

func (c *Client) Network() *Network

Network() returns a Network client

func (*Client) Openapi

func (c *Client) Openapi() *Openapi

Openapi() returns a Openapi clinet

func (*Client) Params

func (c *Client) Params() *Params

Params() returns a Params client

func (*Client) Pnh

func (c *Client) Pnh() *Pnh

Pnh() returns a Pnh client

func (*Client) Pscan

func (c *Client) Pscan() *Pscan

Pscan() returns a Pscan client

func (*Client) Replacer

func (c *Client) Replacer() *Replacer

Replacer() returns a Replacer client

func (*Client) Reports

func (c *Client) Reports() *Reports

Reports() returns a Reports 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) Retest

func (c *Client) Retest() *Retest

Retest() returns a Retest client

func (*Client) Reveal

func (c *Client) Reveal() *Reveal

Reveal() returns a Reveal client

func (*Client) Revisit

func (c *Client) Revisit() *Revisit

Revisit() returns a Revisit client

func (*Client) RuleConfig

func (c *Client) RuleConfig() *RuleConfig

RuleConfig() returns a RuleConfig client

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) Selenium

func (c *Client) Selenium() *Selenium

Selenium() returns a Selenium client

func (*Client) Soap

func (c *Client) Soap() *Soap

Soap() returns a Soap 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

func (*Client) Wappalyzer

func (c *Client) Wappalyzer() *Wappalyzer

Wappalyzer() returns a Wappalyzer client

func (*Client) Websocket

func (c *Client) Websocket() *Websocket

Websocket() returns a Websocket 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) SetContextCheckingStrategy

func (c Context) SetContextCheckingStrategy(contextname string, checkingstrategy string, pollurl string, polldata string, pollheaders string, pollfrequency string, pollfrequencyunits string) (map[string]interface{}, error)

Set the checking strategy for a context - this defines how ZAP checks that a request is authenticated

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) SetContextRegexs

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

Set the regexs to include and exclude for a context, both supplied as JSON string arrays

func (Context) TechnologyList

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

Lists the names of all built in technologies

func (Context) Urls

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

Lists the URLs accessed through/by ZAP, that belong to the context with the given name.

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) ChildNodes

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

Gets the child nodes underneath the specified URL in the Sites tree

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) DisableClientCertificate

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

Disables the option for use of client certificates.

func (Core) EnableAllProxyChainExcludedDomains

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

Enables all domains excluded from the outgoing proxy.

func (Core) EnablePKCS12ClientCertificate

func (c Core) EnablePKCS12ClientCertificate(filepath string, password string, index string) (map[string]interface{}, error)

Enables use of a PKCS12 client certificate for the certificate with the given file system path, password, and optional index.

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)

Gets the connection time out (in seconds).

func (Core) OptionUseProxyChain

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

func (Core) OptionUseProxyChainAuth

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

func (Core) OptionUseSocksProxy

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

Gets whether or not the SOCKS proxy should be used.

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.

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)

Sets the connection time out (in seconds).

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) SetOptionUseSocksProxy

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

Sets whether or not the SOCKS proxy should be used.

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(name string, overwrite string) (map[string]interface{}, error)

Snapshots the session, optionally with the given name, and overwriting existing files. If no name is specified the name of the current session with a timestamp appended is used. If a relative path is specified it will be resolved against the "session" directory in ZAP "home" dir.

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 Exportreport

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

func (Exportreport) Formats

func (e Exportreport) Formats() (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Exportreport) Generate

func (e Exportreport) Generate(absolutepath string, fileextension string, sourcedetails string, alertseverity string, alertdetails string, scanid string, includepassivealerts string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

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) AddDefaultSessionToken

func (h HttpSessions) AddDefaultSessionToken(sessiontoken string, tokenenabled string) (map[string]interface{}, error)

Adds a default session token with the given name and enabled state.

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) DefaultSessionTokens

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

Gets the default session tokens.

func (HttpSessions) RemoveDefaultSessionToken

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

Removes the default session token 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) SetDefaultSessionTokenEnabled

func (h HttpSessions) SetDefaultSessionTokenEnabled(sessiontoken string, tokenenabled string) (map[string]interface{}, error)

Sets whether or not the default session token with the given name is enabled.

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 ImportLogFiles

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

func (ImportLogFiles) ImportModSecurityLogFromFile

func (i ImportLogFiles) ImportModSecurityLogFromFile(filepath string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (ImportLogFiles) ImportZAPHttpRequestResponsePair

func (i ImportLogFiles) ImportZAPHttpRequestResponsePair(httprequest string, httpresponse string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (ImportLogFiles) ImportZAPLogFromFile

func (i ImportLogFiles) ImportZAPLogFromFile(filepath string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (ImportLogFiles) OtherPostModSecurityAuditEvent

func (i ImportLogFiles) OtherPostModSecurityAuditEvent(auditeventstring string) ([]byte, error)

This component is optional and therefore the API will only work if it is installed

func (ImportLogFiles) PostModSecurityAuditEvent

func (i ImportLogFiles) PostModSecurityAuditEvent(auditeventstring string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

type Importurls

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

func (Importurls) Importurls

func (i Importurls) Importurls(filepath string) (map[string]interface{}, error)

Imports URLs (one per line) from the file with the given file system path.

This component is optional and therefore the API will only work if it is installed

type Interface

type Interface interface {
	AccessControl() *AccessControl
	Acsrf() *Acsrf
	AjaxSpider() *AjaxSpider
	Alert() *Alert
	AlertFilter() *AlertFilter
	Ascan() *Ascan
	Authentication() *Authentication
	Authorization() *Authorization
	Automation() *Automation
	Autoupdate() *Autoupdate
	Break() *Break
	Context() *Context
	Core() *Core
	Exportreport() *Exportreport
	ForcedUser() *ForcedUser
	HttpSessions() *HttpSessions
	ImportLogFiles() *ImportLogFiles
	Importurls() *Importurls
	LocalProxies() *LocalProxies
	Network() *Network
	Openapi() *Openapi
	Params() *Params
	Pnh() *Pnh
	Pscan() *Pscan
	Replacer() *Replacer
	Reports() *Reports
	Retest() *Retest
	Reveal() *Reveal
	Revisit() *Revisit
	RuleConfig() *RuleConfig
	Script() *Script
	Search() *Search
	Selenium() *Selenium
	Soap() *Soap
	Spider() *Spider
	Stats() *Stats
	Users() *Users
	Wappalyzer() *Wappalyzer
	Websocket() *Websocket
}

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 LocalProxies

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

func (LocalProxies) AddAdditionalProxy

func (l LocalProxies) AddAdditionalProxy(address string, port string, behindnat string, alwaysdecodezip string, removeunsupportedencodings string) (map[string]interface{}, error)

Adds an new proxy using the details supplied.

func (LocalProxies) AdditionalProxies

func (l LocalProxies) AdditionalProxies() (map[string]interface{}, error)

Gets all of the additional proxies that have been configured.

func (LocalProxies) RemoveAdditionalProxy

func (l LocalProxies) RemoveAdditionalProxy(address string, port string) (map[string]interface{}, error)

Removes the additional proxy with the specified address and port.

type Network

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

func (Network) AddAlias

func (n Network) AddAlias(name string, enabled string) (map[string]interface{}, error)

Adds an alias for the local servers/proxies.

This component is optional and therefore the API will only work if it is installed

func (Network) AddLocalServer

func (n Network) AddLocalServer(address string, port string, api string, proxy string, behindnat string, decoderesponse string, removeacceptencoding string) (map[string]interface{}, error)

Adds a local server/proxy.

This component is optional and therefore the API will only work if it is installed

func (Network) AddPassThrough

func (n Network) AddPassThrough(authority string, enabled string) (map[string]interface{}, error)

Adds an authority to pass-through the local proxies.

This component is optional and therefore the API will only work if it is installed

func (Network) GenerateRootCaCert

func (n Network) GenerateRootCaCert() (map[string]interface{}, error)

Generates a new Root CA certificate, used to issue server certificates.

This component is optional and therefore the API will only work if it is installed

func (Network) GetAliases

func (n Network) GetAliases() (map[string]interface{}, error)

Gets the aliases used to identify the local servers/proxies.

This component is optional and therefore the API will only work if it is installed

func (Network) GetLocalServers

func (n Network) GetLocalServers() (map[string]interface{}, error)

Gets the local servers/proxies.

This component is optional and therefore the API will only work if it is installed

func (Network) GetPassThroughs

func (n Network) GetPassThroughs() (map[string]interface{}, error)

Gets the authorities that will pass-through the local proxies.

This component is optional and therefore the API will only work if it is installed

func (Network) GetRootCaCertValidity

func (n Network) GetRootCaCertValidity() (map[string]interface{}, error)

Gets the Root CA certificate validity, in days. Used when generating a new Root CA certificate.

This component is optional and therefore the API will only work if it is installed

func (Network) GetServerCertValidity

func (n Network) GetServerCertValidity() (map[string]interface{}, error)

Gets the server certificate validity, in days. Used when generating server certificates.

This component is optional and therefore the API will only work if it is installed

func (Network) ImportRootCaCert

func (n Network) ImportRootCaCert(filepath string) (map[string]interface{}, error)

Imports a Root CA certificate to be used to issue server certificates.

This component is optional and therefore the API will only work if it is installed

func (Network) RemoveAlias

func (n Network) RemoveAlias(name string) (map[string]interface{}, error)

Removes an alias.

This component is optional and therefore the API will only work if it is installed

func (Network) RemoveLocalServer

func (n Network) RemoveLocalServer(address string, port string) (map[string]interface{}, error)

Removes a local server/proxy.

This component is optional and therefore the API will only work if it is installed

func (Network) RemovePassThrough

func (n Network) RemovePassThrough(authority string) (map[string]interface{}, error)

Removes a pass-through.

This component is optional and therefore the API will only work if it is installed

func (Network) RootCaCert

func (n Network) RootCaCert() ([]byte, error)

Gets the Root CA certificate used to issue server certificates. Suitable to import into client applications (e.g. browsers).

This component is optional and therefore the API will only work if it is installed

func (Network) SetAliasEnabled

func (n Network) SetAliasEnabled(name string, enabled string) (map[string]interface{}, error)

Sets whether or not an alias is enabled.

This component is optional and therefore the API will only work if it is installed

func (Network) SetPassThroughEnabled

func (n Network) SetPassThroughEnabled(authority string, enabled string) (map[string]interface{}, error)

Sets whether or not a pass-through is enabled.

This component is optional and therefore the API will only work if it is installed

func (Network) SetRootCaCertValidity

func (n Network) SetRootCaCertValidity(validity string) (map[string]interface{}, error)

Sets the Root CA certificate validity. Used when generating a new Root CA certificate.

This component is optional and therefore the API will only work if it is installed

func (Network) SetServerCertValidity

func (n Network) SetServerCertValidity(validity string) (map[string]interface{}, error)

Sets the server certificate validity. Used when generating server certificates.

This component is optional and therefore the API will only work if it is installed

type Openapi

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

func (Openapi) ImportFile

func (o Openapi) ImportFile(file string, target string, contextid string) (map[string]interface{}, error)

Imports an OpenAPI definition from a local file.

This component is optional and therefore the API will only work if it is installed

func (Openapi) ImportUrl

func (o Openapi) ImportUrl(url string, hostoverride string, contextid string) (map[string]interface{}, error)

Imports an OpenAPI definition from a URL.

This component is optional and therefore the API will only work if it is installed

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 Pnh

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

func (Pnh) Fx_pnhxpi

func (p Pnh) Fx_pnhxpi() ([]byte, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) Manifest

func (p Pnh) Manifest() ([]byte, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) Monitor

func (p Pnh) Monitor(id string, message string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) Oracle

func (p Pnh) Oracle(id string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) Pnh

func (p Pnh) Pnh() ([]byte, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) Service

func (p Pnh) Service() ([]byte, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) StartMonitoring

func (p Pnh) StartMonitoring(url string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Pnh) StopMonitoring

func (p Pnh) StopMonitoring(id string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

type Pscan

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

func (Pscan) CurrentRule

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

Show information about the passive scan rule currently being run (if any).

func (Pscan) DisableAllScanners

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

Disables all passive scanners

func (Pscan) DisableAllTags

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

Disables all passive scan tags.

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) EnableAllTags

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

Enables all passive scan tags.

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) MaxAlertsPerRule

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

Gets the maximum number of alerts a passive scan rule should raise.

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) SetMaxAlertsPerRule

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

Sets the maximum number of alerts a passive scan rule should raise.

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 Replacer

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

func (Replacer) AddRule

func (r Replacer) AddRule(description string, enabled string, matchtype string, matchregex string, matchstring string, replacement string, initiators string) (map[string]interface{}, error)

Adds a replacer rule. For the parameters: desc is a user friendly description, enabled is true or false, matchType is one of [REQ_HEADER, REQ_HEADER_STR, REQ_BODY_STR, RESP_HEADER, RESP_HEADER_STR, RESP_BODY_STR], matchRegex should be true if the matchString should be treated as a regex otherwise false, matchString is the string that will be matched against, replacement is the replacement string, initiators may be blank (for all initiators) or a comma separated list of integers as defined in <a href="https://github.com/zaproxy/zaproxy/blob/main/zap/src/main/java/org/parosproxy/paros/network/HttpSender.java">HttpSender</a>

This component is optional and therefore the API will only work if it is installed

func (Replacer) RemoveRule

func (r Replacer) RemoveRule(description string) (map[string]interface{}, error)

Removes the rule with the given description

This component is optional and therefore the API will only work if it is installed

func (Replacer) Rules

func (r Replacer) Rules() (map[string]interface{}, error)

Returns full details of all of the rules

This component is optional and therefore the API will only work if it is installed

func (Replacer) SetEnabled

func (r Replacer) SetEnabled(description string, bool string) (map[string]interface{}, error)

Enables or disables the rule with the given description based on the bool parameter

This component is optional and therefore the API will only work if it is installed

type Reports

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

func (Reports) Generate

func (r Reports) Generate(title string, template string, theme string, description string, contexts string, sites string, sections string, includedconfidences string, includedrisks string, reportfilename string, reportfilenamepattern string, reportdir string, display string) (map[string]interface{}, error)

Generate a report with the supplied parameters.

This component is optional and therefore the API will only work if it is installed

func (Reports) TemplateDetails

func (r Reports) TemplateDetails(template string) (map[string]interface{}, error)

View details of the specified template.

This component is optional and therefore the API will only work if it is installed

func (Reports) Templates

func (r Reports) Templates() (map[string]interface{}, error)

View available templates.

This component is optional and therefore the API will only work if it is installed

type Retest

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

func (Retest) Retest

func (r Retest) Retest(alertids string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

type Reveal

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

func (Reveal) Reveal

func (r Reveal) Reveal() (map[string]interface{}, error)

Tells if shows hidden fields and enables disabled fields

This component is optional and therefore the API will only work if it is installed

func (Reveal) SetReveal

func (r Reveal) SetReveal(reveal string) (map[string]interface{}, error)

Sets if shows hidden fields and enables disabled fields

This component is optional and therefore the API will only work if it is installed

type Revisit

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

func (Revisit) RevisitList

func (r Revisit) RevisitList() (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Revisit) RevisitSiteOff

func (r Revisit) RevisitSiteOff(site string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Revisit) RevisitSiteOn

func (r Revisit) RevisitSiteOn(site string, starttime string, endtime string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

type RuleConfig

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

func (RuleConfig) AllRuleConfigs

func (r RuleConfig) AllRuleConfigs() (map[string]interface{}, error)

Show all of the rule configurations

func (RuleConfig) ResetAllRuleConfigValues

func (r RuleConfig) ResetAllRuleConfigValues() (map[string]interface{}, error)

Reset all of the rule configurations

func (RuleConfig) ResetRuleConfigValue

func (r RuleConfig) ResetRuleConfigValue(key string) (map[string]interface{}, error)

Reset the specified rule configuration, which must already exist

func (RuleConfig) RuleConfigValue

func (r RuleConfig) RuleConfigValue(key string) (map[string]interface{}, error)

Show the specified rule configuration

func (RuleConfig) SetRuleConfigValue

func (r RuleConfig) SetRuleConfigValue(key string, value string) (map[string]interface{}, error)

Set the specified rule configuration, which must already exist

type Script

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

func (Script) ClearGlobalCustomVar

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

Clears a global custom variable.

func (Script) ClearGlobalVar

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

Clears the global variable with the given key.

func (Script) ClearGlobalVars

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

Clears the global variables.

func (Script) ClearScriptCustomVar

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

Clears a script custom variable.

func (Script) ClearScriptVar

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

Clears the variable with the given key of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.

func (Script) ClearScriptVars

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

Clears the variables of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.

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) GlobalCustomVar

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

Gets the value (string representation) of a global custom variable. Returns an API error (DOES_NOT_EXIST) if no value was previously set.

func (Script) GlobalCustomVars

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

Gets all the global custom variables (key/value pairs, the value is the string representation).

func (Script) GlobalVar

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

Gets the value of the global variable with the given key. Returns an API error (DOES_NOT_EXIST) if no value was previously set.

func (Script) GlobalVars

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

Gets all the global variables (key/value pairs).

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) ListTypes

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

Lists the script types available.

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 given name

func (Script) ScriptCustomVar

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

Gets the value (string representation) of a custom variable. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists or if no value was previously set.

func (Script) ScriptCustomVars

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

Gets all the custom variables (key/value pairs, the value is the string representation) of a script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.

func (Script) ScriptVar

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

Gets the value of the variable with the given key for the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists or if no value was previously set.

func (Script) ScriptVars

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

Gets all the variables (key/value pairs) of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.

func (Script) SetGlobalVar

func (s Script) SetGlobalVar(varkey string, varvalue string) (map[string]interface{}, error)

Sets the value of the global variable with the given key.

func (Script) SetScriptVar

func (s Script) SetScriptVar(scriptname string, varkey string, varvalue string) (map[string]interface{}, error)

Sets the value of the variable with the given key of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.

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)

Returns the HTTP messages, in HAR format, that match the given regular expression in the header(s) optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) HarByRequestRegex

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

Returns the HTTP messages, in HAR format, that match the given regular expression in the request optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) HarByResponseRegex

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

Returns the HTTP messages, in HAR format, that match the given regular expression in the response optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) HarByUrlRegex

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

Returns the HTTP messages, in HAR format, that match the given regular expression in the URL optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) MessagesByHeaderRegex

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

Returns the HTTP messages that match the given regular expression in the header(s) optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) MessagesByRequestRegex

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

Returns the HTTP messages that match the given regular expression in the request optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) MessagesByResponseRegex

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

Returns the HTTP messages that match the given regular expression in the response optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) MessagesByUrlRegex

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

Returns the HTTP messages that match the given regular expression in the URL optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) UrlsByHeaderRegex

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

Returns the URLs of the HTTP messages that match the given regular expression in the header(s) optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) UrlsByRequestRegex

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

Returns the URLs of the HTTP messages that match the given regular expression in the request optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) UrlsByResponseRegex

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

Returns the URLs of the HTTP messages that match the given regular expression in the response optionally filtered by URL and paginated with 'start' position and 'count' of messages.

func (Search) UrlsByUrlRegex

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

Returns the URLs of the HTTP messages that match the given regular expression in the URL optionally filtered by URL and paginated with 'start' position and 'count' of messages.

type Selenium

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

func (Selenium) OptionBrowserExtensions

func (s Selenium) OptionBrowserExtensions() (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Selenium) OptionChromeDriverPath

func (s Selenium) OptionChromeDriverPath() (map[string]interface{}, error)

Returns the current path to ChromeDriver

This component is optional and therefore the API will only work if it is installed

func (Selenium) OptionFirefoxBinaryPath

func (s Selenium) OptionFirefoxBinaryPath() (map[string]interface{}, error)

Returns the current path to Firefox binary

This component is optional and therefore the API will only work if it is installed

func (Selenium) OptionFirefoxDriverPath

func (s Selenium) OptionFirefoxDriverPath() (map[string]interface{}, error)

Returns the current path to Firefox driver (geckodriver)

This component is optional and therefore the API will only work if it is installed

func (Selenium) OptionIeDriverPath

func (s Selenium) OptionIeDriverPath() (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Selenium) OptionLastDirectory

func (s Selenium) OptionLastDirectory() (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Selenium) OptionPhantomJsBinaryPath

func (s Selenium) OptionPhantomJsBinaryPath() (map[string]interface{}, error)

Returns the current path to PhantomJS binary

This component is optional and therefore the API will only work if it is installed

func (Selenium) SetOptionChromeDriverPath

func (s Selenium) SetOptionChromeDriverPath(str string) (map[string]interface{}, error)

Sets the current path to ChromeDriver

This component is optional and therefore the API will only work if it is installed

func (Selenium) SetOptionFirefoxBinaryPath

func (s Selenium) SetOptionFirefoxBinaryPath(str string) (map[string]interface{}, error)

Sets the current path to Firefox binary

This component is optional and therefore the API will only work if it is installed

func (Selenium) SetOptionFirefoxDriverPath

func (s Selenium) SetOptionFirefoxDriverPath(str string) (map[string]interface{}, error)

Sets the current path to Firefox driver (geckodriver)

This component is optional and therefore the API will only work if it is installed

func (Selenium) SetOptionIeDriverPath

func (s Selenium) SetOptionIeDriverPath(str string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Selenium) SetOptionLastDirectory

func (s Selenium) SetOptionLastDirectory(str string) (map[string]interface{}, error)

This component is optional and therefore the API will only work if it is installed

func (Selenium) SetOptionPhantomJsBinaryPath

func (s Selenium) SetOptionPhantomJsBinaryPath(str string) (map[string]interface{}, error)

Sets the current path to PhantomJS binary

This component is optional and therefore the API will only work if it is installed

type SessionManagement

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

func (SessionManagement) GetSessionManagementMethod

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

Gets the name of the session management method for the context with the given ID.

func (SessionManagement) GetSessionManagementMethodConfigParams

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

Gets the configuration parameters for the session management method with the given name.

func (SessionManagement) GetSupportedSessionManagementMethods

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

Gets the name of the session management methods.

func (SessionManagement) SetSessionManagementMethod

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

Sets the session management method for the context with the given ID.

type Soap

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

func (Soap) ImportFile

func (s Soap) ImportFile(file string) (map[string]interface{}, error)

Import a WSDL definition from local file.

This component is optional and therefore the API will only work if it is installed

func (Soap) ImportUrl

func (s Soap) ImportUrl(url string) (map[string]interface{}, error)

Import a WSDL definition from a URL.

This component is optional and therefore the API will only work if it is installed

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) 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)

Gets the maximum depth the spider can crawl, 0 if unlimited.

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) 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)

Sets the maximum depth the spider can crawl, 0 for unlimited depth.

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) AuthenticateAsUser

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

Tries to authenticate as the identified user, returning the authentication request and whether it appears to have succeeded.

func (Users) GetAuthenticationCredentials

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

Gets the authentication credentials of the user with given ID that belongs to the context with the given ID.

func (Users) GetAuthenticationCredentialsConfigParams

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

Gets the configuration parameters for the credentials of the context with the given ID.

func (Users) GetAuthenticationSession

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

Gets the authentication session information for the user identified by the Context and User Ids, e.g. cookies and realm credentials.

func (Users) GetAuthenticationState

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

Gets the authentication state information for the user identified by the Context and User Ids.

func (Users) GetUserById

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

Gets the data of the user with the given ID that belongs to the context with the given ID.

func (Users) NewUser

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

Creates a new user with the given name for the context with the given ID.

func (Users) PollAsUser

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

Tries to poll as the identified user, returning the authentication request and whether it appears to have succeeded. This will only work if the polling verification strategy has been configured.

func (Users) RemoveUser

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

Removes the user with the given ID that belongs to the context with the given ID.

func (Users) SetAuthenticationCredentials

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

Sets the authentication credentials for the user with the given ID that belongs to the context with the given ID.

func (Users) SetAuthenticationState

func (u Users) SetAuthenticationState(contextid string, userid string, lastpollresult string, lastpolltimeinms string, requestssincelastpoll string) (map[string]interface{}, error)

Sets fields in the authentication state for the user identified by the Context and User Ids.

func (Users) SetCookie

func (u Users) SetCookie(contextid string, userid string, domain string, name string, value string, path string, secure string) (map[string]interface{}, error)

Sets the specified cookie for the user identified by the Context and User Ids.

func (Users) SetUserEnabled

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

Sets whether or not the user, with the given ID that belongs to the context with the given ID, should be enabled.

func (Users) SetUserName

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

Renames the user with the given ID that belongs to the context with the given ID.

func (Users) UsersList

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

Gets a list of users that belong to the context with the given ID, or all users if none provided.

type Wappalyzer

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

func (Wappalyzer) ListAll

func (w Wappalyzer) ListAll() (map[string]interface{}, error)

Lists all sites and their associated applications (technologies).

This component is optional and therefore the API will only work if it is installed

func (Wappalyzer) ListSite

func (w Wappalyzer) ListSite(site string) (map[string]interface{}, error)

Lists all the applications (technologies) associated with a specific site.

This component is optional and therefore the API will only work if it is installed

func (Wappalyzer) ListSites

func (w Wappalyzer) ListSites() (map[string]interface{}, error)

Lists all the sites recognized by the wappalyzer addon.

This component is optional and therefore the API will only work if it is installed

type Websocket

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

func (Websocket) BreakTextMessage

func (w Websocket) BreakTextMessage() (map[string]interface{}, error)

Returns a text representation of an intercepted websockets message

This component is optional and therefore the API will only work if it is installed

func (Websocket) Channels

func (w Websocket) Channels() (map[string]interface{}, error)

Returns all of the registered web socket channels

This component is optional and therefore the API will only work if it is installed

func (Websocket) Message

func (w Websocket) Message(channelid string, messageid string) (map[string]interface{}, error)

Returns full details of the message specified by the channelId and messageId

This component is optional and therefore the API will only work if it is installed

func (Websocket) Messages

func (w Websocket) Messages(channelid string, start string, count string, payloadpreviewlength string) (map[string]interface{}, error)

Returns a list of all of the messages that meet the given criteria (all optional), where channelId is a channel identifier, start is the offset to start returning messages from (starting from 0), count is the number of messages to return (default no limit) and payloadPreviewLength is the maximum number bytes to return for the payload contents

This component is optional and therefore the API will only work if it is installed

func (Websocket) SendTextMessage

func (w Websocket) SendTextMessage(channelid string, outgoing string, message string) (map[string]interface{}, error)

Sends the specified message on the channel specified by channelId, if outgoing is 'True' then the message will be sent to the server and if it is 'False' then it will be sent to the client

This component is optional and therefore the API will only work if it is installed

func (Websocket) SetBreakTextMessage

func (w Websocket) SetBreakTextMessage(message string, outgoing string) (map[string]interface{}, error)

Sets the text message for an intercepted websockets message

This component is optional and therefore the API will only work if it is installed

Jump to

Keyboard shortcuts

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