escape

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package escape provides the API client for the Escape Platform

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug is a flag to enable debug mode for the API client

Functions

func BulkDeleteAssets added in v1.1.0

func BulkDeleteAssets(ctx context.Context, where v3.BulkUpdateAssetsRequestWhere) error

BulkDeleteAssets deletes multiple assets matching a filter

func BulkUpdateAssets added in v1.1.0

BulkUpdateAssets updates multiple assets matching a filter

func BulkUpdateIssues added in v1.1.0

BulkUpdateIssues updates multiple issues matching a filter

func CancelScan added in v0.3.0

func CancelScan(ctx context.Context, scanID string) error

CancelScan cancels a scan

func CommentAsset added in v1.1.0

func CommentAsset(ctx context.Context, assetID, comment string) error

CommentAsset adds a comment to an asset

func CommentIssue added in v1.1.0

func CommentIssue(ctx context.Context, issueID string, comment string) error

CommentIssue adds a comment to an issue

func CreateAsset added in v0.3.0

func CreateAsset(ctx context.Context, data []byte, assetType string) (interface{}, error)

CreateAsset creates an asset

func CreateCustomRule added in v0.3.8

func CreateCustomRule(ctx context.Context, data []byte) (*v3.CreateCustomRule200Response, error)

CreateCustomRule creates a custom rule from raw JSON

func CreateIntegration added in v1.1.0

func CreateIntegration(ctx context.Context, kind string, body []byte) (map[string]interface{}, error)

CreateIntegration creates an integration of a given kind from raw JSON bytes.

func CreateLocation

func CreateLocation(ctx context.Context, name, sshPublicKey string) (string, error)

CreateLocation creates a location

func CreateProfileGraphql added in v0.3.0

func CreateProfileGraphql(ctx context.Context, data []byte) (interface{}, error)

CreateProfileGraphql creates a profile for a GraphQL application

func CreateProfilePentestGraphql added in v1.1.0

func CreateProfilePentestGraphql(ctx context.Context, data []byte) (interface{}, error)

CreateProfilePentestGraphql creates an AI Pentest profile for a GraphQL application

func CreateProfilePentestRest added in v1.1.0

func CreateProfilePentestRest(ctx context.Context, data []byte) (interface{}, error)

CreateProfilePentestRest creates an AI Pentest profile for a REST application

func CreateProfilePentestWebapp added in v1.1.0

func CreateProfilePentestWebapp(ctx context.Context, data []byte) (interface{}, error)

CreateProfilePentestWebapp creates an AI Pentest profile for a web application

func CreateProfileRest added in v0.3.0

func CreateProfileRest(ctx context.Context, data []byte) (interface{}, error)

CreateProfileRest creates a profile for a REST application

func CreateProfileWebapp added in v0.3.0

func CreateProfileWebapp(ctx context.Context, data []byte) (interface{}, error)

CreateProfileWebapp creates a profile for a web application

func CreateProject added in v1.1.0

func CreateProject(ctx context.Context, body []byte) (*v3.CreateProject200Response, error)

CreateProject creates a new project from raw JSON bytes

func CreateRole added in v1.1.0

func CreateRole(ctx context.Context, body []byte) (*v3.CreateRole200Response, error)

CreateRole creates a new role from raw JSON bytes

func CreateRoleBindings added in v1.1.0

func CreateRoleBindings(ctx context.Context, roleID, userID string) ([]v3.CreateRoleBindings200ResponseInner, error)

CreateRoleBindings creates role bindings associating users to roles

func CreateTag added in v0.3.0

func CreateTag(ctx context.Context, name string, color string) (*v3.CreateTag200Response, error)

CreateTag creates a tag

func CreateWorkflow added in v1.1.0

func CreateWorkflow(ctx context.Context, body []byte) (*v3.CreateWorkflow200Response, error)

CreateWorkflow creates a new workflow from raw JSON bytes

func DeleteAsset added in v0.3.0

func DeleteAsset(ctx context.Context, id string) error

DeleteAsset deletes an asset by ID

func DeleteCustomRule added in v0.3.8

func DeleteCustomRule(ctx context.Context, id string) (*v3.DeleteCustomRule200Response, error)

DeleteCustomRule deletes a custom rule

func DeleteIntegration

func DeleteIntegration(ctx context.Context, kind, integrationID string) error

DeleteIntegration deletes an integration by kind and ID.

func DeleteLocation

func DeleteLocation(ctx context.Context, id string) error

DeleteLocation deletes a location

func DeleteProfile added in v0.3.10

func DeleteProfile(ctx context.Context, profileID string) error

DeleteProfile deletes a profile by ID

func DeleteProject added in v1.1.0

func DeleteProject(ctx context.Context, projectID string) error

DeleteProject deletes a project by ID.

func DeleteRole added in v1.1.0

func DeleteRole(ctx context.Context, roleID string) error

DeleteRole deletes a role by ID.

func DeleteRoleBinding added in v1.1.0

func DeleteRoleBinding(ctx context.Context, bindingID string) error

DeleteRoleBinding deletes a role binding by ID

func DeleteTag added in v0.6.0

func DeleteTag(ctx context.Context, id string) error

DeleteTag deletes a tag

func DeleteWorkflow added in v1.1.0

func DeleteWorkflow(ctx context.Context, workflowID string) error

DeleteWorkflow deletes a workflow by ID

func GetAsset added in v0.3.0

func GetAsset(ctx context.Context, id string) (*v3.AssetDetailed1, error)

GetAsset gets an asset by ID

func GetAuthentication added in v1.1.0

func GetAuthentication(ctx context.Context, authenticationID string) (*v3.GetAuthentication200Response, error)

GetAuthentication gets a profile authentication check by ID.

func GetCustomRule added in v0.3.4

func GetCustomRule(ctx context.Context, id string) (*v3.CreateCustomRule200Response, error)

GetCustomRule gets a custom rule

func GetEvent added in v0.3.0

func GetEvent(ctx context.Context, eventID string) (*v3.GetEvent200Response, error)

GetEvent gets an event

func GetIntegration

func GetIntegration(ctx context.Context, kind, integrationID string) (map[string]interface{}, error)

GetIntegration gets an integration by kind and ID.

func GetIssue added in v0.3.0

func GetIssue(ctx context.Context, issueID string) (*v3.GetIssue200Response, error)

GetIssue gets an issue by ID

func GetJob added in v1.1.0

func GetJob(ctx context.Context, jobID string) (*v3.GetJob200Response, error)

GetJob gets the status and result of an async job

func GetLocation

func GetLocation(ctx context.Context, id string) (*v3.CreateLocation200Response, error)

GetLocation gets a location by ID

func GetMe added in v1.1.0

func GetMe(ctx context.Context) (*v3.GetMe200Response, error)

GetMe returns the current authenticated user and organization context

func GetProfile added in v0.3.0

func GetProfile(ctx context.Context, profileID string) (*v3.GetProfile200Response, error)

GetProfile gets a profile by ID

func GetProject added in v1.1.0

func GetProject(ctx context.Context, projectID string) (*v3.CreateProject200Response, error)

GetProject gets a project by ID

func GetRole added in v1.1.0

func GetRole(ctx context.Context, roleID string) (*v3.CreateRole200Response, error)

GetRole gets a role by ID

func GetScan

func GetScan(ctx context.Context, scanID string) (*v3.StartScan200Response, error)

GetScan returns a scan by its ID

func GetScanIssues

func GetScanIssues(ctx context.Context, scanID string) ([]v3.IssueSummarized, error)

GetScanIssues returns issues found in a scan

func GetStatistics added in v1.1.0

func GetStatistics(ctx context.Context) (*v3.GetStatistics200Response, error)

GetStatistics returns organization-level statistics

func GetTag added in v1.1.0

func GetTag(ctx context.Context, id string) (*v3.CreateTag200Response, error)

GetTag gets a tag by ID

func GetUploadSignedURL added in v0.3.10

func GetUploadSignedURL(ctx context.Context) (*v3.CreateUploadSignedUrl200Response, error)

GetUploadSignedURL gets a signed url

func GetUser added in v1.1.0

func GetUser(ctx context.Context, userID string) (*v3.GetUser200Response, error)

GetUser gets a user by ID

func GetWorkflow added in v1.1.0

func GetWorkflow(ctx context.Context, workflowID string) (*v3.CreateWorkflow200Response, error)

GetWorkflow gets a workflow by ID

func IgnoreScan added in v0.3.0

func IgnoreScan(ctx context.Context, scanID string) error

IgnoreScan ignore a scan

func InviteUsers added in v1.1.0

func InviteUsers(ctx context.Context, emails []string, roleID string) ([]v3.ListUsers200ResponseInner, error)

InviteUsers invites one or more users by email address.

func ListAssetActivities added in v1.1.0

func ListAssetActivities(ctx context.Context, assetID string) ([]v3.ActivitySummarized, error)

ListAssetActivities lists activities for an asset

func ListAssets added in v0.3.0

func ListAssets(ctx context.Context, next string, filters *ListAssetsFilters) ([]v3.AssetSummarized, *string, error)

ListAssets lists all assets

func ListAuditLogs added in v0.3.0

func ListAuditLogs(ctx context.Context, next string, filters *ListAuditLogsFilters) ([]v3.AuditLogSummarized, *string, error)

ListAuditLogs lists audit logs

func ListCustomRules added in v0.3.4

func ListCustomRules(ctx context.Context) ([]v3.CustomRuleSummarized, error)

ListCustomRules lists all custom rules

func ListEvents added in v0.3.0

func ListEvents(ctx context.Context, next string, filters *ListEventsFilters) ([]v3.EventSummarized, *string, error)

ListEvents lists events

func ListIntegrations

func ListIntegrations(ctx context.Context, kind, next string, filters *ListIntegrationsFilters) ([]map[string]interface{}, *string, error)

ListIntegrations lists integrations of a given kind with optional filters.

func ListIssueActivities added in v0.3.0

func ListIssueActivities(ctx context.Context, issueID string) ([]v3.ActivitySummarized, error)

ListIssueActivities lists the activities of an issue

func ListIssues added in v0.3.0

func ListIssues(ctx context.Context, next string, filters *ListIssuesFilters, sortType string, sortDirection string) ([]v3.IssueSummarized, *string, error)

ListIssues lists all issues.

func ListLocations

func ListLocations(ctx context.Context, next string, filters *ListLocationsFilters) ([]v3.LocationSummarized, *string, error)

ListLocations lists all locations

func ListProblems added in v0.5.0

func ListProblems(ctx context.Context, next string, filters *ListProblemsFilters) ([]v3.ProfileScanProblemsRow, *string, error)

ListProblems lists all scan problems

func ListProfiles added in v0.3.0

func ListProfiles(ctx context.Context, next string, filters *ListProfilesFilters) ([]v3.ProfileSummarized, *string, error)

ListProfiles lists all profiles

func ListProjects added in v1.1.0

ListProjects lists all projects with optional search filter

func ListRoles added in v1.1.0

func ListRoles(ctx context.Context) ([]v3.ListRoles200ResponseInner, error)

ListRoles lists all roles in the organization

func ListScanTargets added in v1.1.0

func ListScanTargets(ctx context.Context, scanID string, next string, targetTypes string, size int) ([]v3.TargetDetailed, *string, error)

ListScanTargets lists all targets discovered during a scan

func ListScans

func ListScans(ctx context.Context, next string, filters *ListScansFilters) ([]v3.ScanSummarized2, *string, error)

ListScans lists all scans for an application

func ListTags added in v0.3.0

func ListTags(ctx context.Context) ([]v3.TagDetail, error)

ListTags lists all tags

func ListUsers added in v1.1.0

func ListUsers(ctx context.Context, search string) ([]v3.ListUsers200ResponseInner, error)

ListUsers lists all users in the organization. Search is applied client-side because the public API does not expose a search filter.

func ListWorkflows added in v1.1.0

func ListWorkflows(ctx context.Context, next string, filters *ListWorkflowsFilters) ([]v3.WorkflowSummarized, *string, error)

ListWorkflows lists all workflows with optional filters

func NotifyIssueOwners added in v1.1.0

func NotifyIssueOwners(ctx context.Context, issueID, scanID string) (bool, error)

NotifyIssueOwners sends a notification to asset owners about an issue

func ParseJSONOrYAML

func ParseJSONOrYAML[T parsable](body []byte, v T) (T, error)

ParseJSONOrYAML parses a JSON or YAML data into the requested struct It returns an error if the data is neither JSON nor YAML

func StartAuthentication added in v1.1.0

func StartAuthentication(ctx context.Context, body []byte) (*v3.StartAuthentication200Response, error)

StartAuthentication starts a profile authentication check from raw JSON bytes.

func StartScan

func StartScan(
	ctx context.Context,
	profileID string,
	commitHash string,
	commitLink string,
	commitBranch string,
	commitAuthor string,
	commitAuthorProfilePictureLink string,
	configurationOverride map[string]interface{},
	additionalProperties map[string]interface{},
	initiator v3.ENUMPROPERTIESDATAITEMSPROPERTIESINITIATORSITEMS,
) (*v3.StartScan200Response, error)

StartScan starts a scan for an application

func TriggerAsmScans added in v1.1.0

func TriggerAsmScans(ctx context.Context, where *v3.TriggerAsmScansRequestWhere) error

TriggerAsmScans triggers ASM scans on assets matching an optional filter

func TriggerExport added in v1.1.0

func TriggerExport(ctx context.Context, blocks []string, scanID string) (*v3.TriggerExport200Response, error)

TriggerExport triggers an async PDF/report export job

func UpdateAsset added in v0.3.0

func UpdateAsset(
	ctx context.Context,
	id string,
	assetDescription *string,
	assetFramework *v3.ENUMPROPERTIESFRAMEWORK,
	assetOwners *[]string,
	assetStatus *v3.ENUMPROPERTIESDATAITEMSPROPERTIESEXTRAASSETSITEMSPROPERTIESSTATUS,
	assetTagIDs *[]string,
) error

UpdateAsset updates an asset by ID

func UpdateCustomRule added in v0.3.8

func UpdateCustomRule(ctx context.Context, id string, data []byte) (*v3.CreateCustomRule200Response, error)

UpdateCustomRule updates a custom rule from raw JSON

func UpdateIntegration added in v1.1.0

func UpdateIntegration(ctx context.Context, kind, integrationID string, body []byte) (map[string]interface{}, error)

UpdateIntegration updates an integration by kind and ID from raw JSON bytes.

func UpdateIssue added in v0.3.0

func UpdateIssue(ctx context.Context, issueID string, status v3.ENUMPROPERTIESDATAITEMSPROPERTIESSTATUS, comment string) (bool, error)

UpdateIssue updates an issue status with an optional comment

func UpdateLocation

func UpdateLocation(ctx context.Context, id string, name, sshPublicKey *string, enabled *bool) error

UpdateLocation updates a location. Only non-nil fields are sent.

func UpdateProfile added in v1.0.0

func UpdateProfile(ctx context.Context, profileID string, data []byte) (*v3.GetProfile200Response, error)

UpdateProfile updates profile metadata (name, description, cron, extra assets)

func UpdateProfileConfiguration added in v1.0.0

func UpdateProfileConfiguration(ctx context.Context, profileID string, data []byte) (map[string]interface{}, error)

UpdateProfileConfiguration updates profile configuration (auth, scope, frontend_dast, etc.)

func UpdateProfileSchema added in v1.0.0

func UpdateProfileSchema(ctx context.Context, profileID string, schemaID string) (*v3.GetProfile200Response, error)

UpdateProfileSchema updates the schema attached to a profile

func UpdateProject added in v1.1.0

func UpdateProject(ctx context.Context, projectID string, body []byte) (*v3.CreateProject200Response, error)

UpdateProject updates a project by ID from raw JSON bytes

func UpdateRole added in v1.1.0

func UpdateRole(ctx context.Context, roleID string, body []byte) (*v3.CreateRole200Response, error)

UpdateRole updates a role by ID from raw JSON bytes

func UpdateTag added in v1.1.0

func UpdateTag(ctx context.Context, id string, name *string, color *string) (*v3.CreateTag200Response, error)

UpdateTag updates a tag name and/or color

func UpdateWorkflow added in v1.1.0

func UpdateWorkflow(ctx context.Context, workflowID string, body []byte) (*v3.CreateWorkflow200Response, error)

UpdateWorkflow updates a workflow by ID from raw JSON bytes

func UploadSchema added in v0.3.10

func UploadSchema(ctx context.Context, url string, data []byte) error

UploadSchema uploads a file to the signed url

func UpsertKubernetesIntegration added in v0.6.3

UpsertKubernetesIntegration creates a Kubernetes integration if it doesn't exist

func UpsertLocation

func UpsertLocation(ctx context.Context, name, sshPublicKey string) (string, error)

UpsertLocation Creates or updates a location

func WatchScan

func WatchScan(ctx context.Context, scanID string) (chan *v3.StartScan200Response, error)

WatchScan watches scans status and logs

Types

type IssueFunnelStep added in v1.1.0

type IssueFunnelStep struct {
	Category string  `json:"category"`
	Step     string  `json:"step"`
	Count    float32 `json:"count"`
}

IssueFunnelStep is a stable CLI DTO for the issue funnel endpoint.

func GetIssueFunnel added in v1.1.0

func GetIssueFunnel(ctx context.Context, projectIDs []string) ([]IssueFunnelStep, error)

GetIssueFunnel returns the issue funnel breakdown

type IssueTrendPoint added in v1.1.0

type IssueTrendPoint struct {
	Date   string  `json:"date"`
	HIGH   float32 `json:"HIGH"`
	MEDIUM float32 `json:"MEDIUM"`
	LOW    float32 `json:"LOW"`
	INFO   float32 `json:"INFO"`
}

IssueTrendPoint is a stable CLI DTO for the issue trends endpoint.

func GetIssueTrends added in v1.1.0

func GetIssueTrends(ctx context.Context, after, before, interval string, applicationIDs, projectIDs []string) ([]IssueTrendPoint, error)

GetIssueTrends returns severity trends over time

type ListAssetsFilters added in v0.3.2

type ListAssetsFilters struct {
	AssetTypes      []string
	AssetStatuses   []string
	Search          string
	ManuallyCreated bool
	SortType        string
	SortDirection   string
}

ListAssetsFilters holds optional filters for listing assets

type ListAuditLogsFilters added in v0.3.2

type ListAuditLogsFilters struct {
	DateFrom      string
	DateTo        string
	ActionType    string
	Actor         string
	Search        string
	SortType      string
	SortDirection string
}

ListAuditLogsFilters holds optional filters for listing audit logs

type ListEventsFilters added in v0.3.2

type ListEventsFilters struct {
	Search         string
	ScanIDs        []string
	AssetIDs       []string
	IssueIDs       []string
	Levels         []string
	Stages         []string
	HasAttachments bool
	Attachments    []string
	SortType       string
	SortDirection  string
}

ListEventsFilters holds optional filters for listing events

type ListIntegrationsFilters added in v1.1.0

type ListIntegrationsFilters struct {
	ProjectIDs  []string
	IDs         []string
	LocationIDs []string
	Search      string
}

ListIntegrationsFilters holds optional filters for listing integrations.

type ListIssuesFilters added in v0.3.0

type ListIssuesFilters struct {
	Status       []string
	Severities   []string
	ProfileIDs   []string
	AssetIDs     []string
	Domains      []string
	IssueIDs     []string
	ScanIDs      []string
	TagsIDs      []string
	Search       string
	JiraTicket   string
	Risks        []string
	AssetClasses []string
	ScannerKinds []string
	Names        []string
}

ListIssuesFilters holds optional filters for listing issues

type ListKubernetesIntegrationsFilters added in v0.6.3

type ListKubernetesIntegrationsFilters struct {
	ProjectIDs  []string
	LocationIDs string
	Search      string
}

ListKubernetesIntegrationsFilters holds optional filters for listing Kubernetes integrations

type ListLocationsFilters added in v0.3.2

type ListLocationsFilters struct {
	Search        string
	Enabled       bool
	LocationTypes []string
	SortType      string
	SortDirection string
}

ListLocationsFilters holds optional filters for listing locations

type ListProblemsFilters added in v0.5.0

type ListProblemsFilters struct {
	AssetIDs   []string
	Domains    []string
	IssueIDs   []string
	TagsIDs    []string
	Search     string
	Initiators []string
	Kinds      []string
	Risks      []string
}

ListProblemsFilters holds optional filters for listing problems

type ListProfilesFilters added in v0.3.2

type ListProfilesFilters struct {
	AssetIDs      []string
	Domains       []string
	IssueIDs      []string
	TagsIDs       []string
	Search        string
	Initiators    []string
	Kinds         []string
	Risks         []string
	SortType      string
	SortDirection string
}

ListProfilesFilters holds optional filters for listing profiles

type ListProjectsFilters added in v1.1.0

type ListProjectsFilters struct {
	Search string
}

ListProjectsFilters holds optional filters for listing projects

type ListScansFilters added in v0.3.2

type ListScansFilters struct {
	After         string
	Before        string
	AssetIDs      *[]string
	ProfileIDs    *[]string
	ProjectIDs    *[]string
	Ignored       string
	Initiator     *[]string
	Kinds         *[]string
	Status        *[]string
	SortType      string
	SortDirection string
}

ListScansFilters holds optional filters for listing scans

type ListWorkflowsFilters added in v1.1.0

type ListWorkflowsFilters struct {
	Triggers       []string
	Search         string
	ProjectIDs     []string
	IntegrationIDs []string
	WorkflowIDs    []string
}

ListWorkflowsFilters holds optional filters for listing workflows

Jump to

Keyboard shortcuts

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