contrast

package
v1.370.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusReported = "REPORTED"
	Critical       = "CRITICAL"
	High           = "HIGH"
	Medium         = "MEDIUM"
	AuditAll       = "Audit All"
	Optional       = "Optional"
)

Variables

This section is empty.

Functions

func CreateAndPersistToolRecord

func CreateAndPersistToolRecord(utils piperutils.FileUtils, appInfo *ApplicationInfo, modulePath string) (string, error)

func WriteJSONReport

func WriteJSONReport(jsonReport ContrastAudit, modulePath string) ([]piperutils.Path, error)

Types

type ApplicationInfo

type ApplicationInfo struct {
	Url    string
	Id     string
	Name   string
	Server string
}

type ApplicationResponse

type ApplicationResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Path        string `json:"path"`
	Language    string `json:"language"`
	Importance  string `json:"importance"`
}

type Contrast

type Contrast interface {
	GetVulnerabilities() error
	GetAppInfo(appUIUrl, server string)
}

type ContrastAudit

type ContrastAudit struct {
	ToolName       string             `json:"toolName"`
	ApplicationUrl string             `json:"applicationUrl"`
	ScanResults    []ContrastFindings `json:"findings"`
}

type ContrastFindings

type ContrastFindings struct {
	ClassificationName string `json:"classificationName"`
	Total              int    `json:"total"`
	Audited            int    `json:"audited"`
}

type ContrastHttpClient

type ContrastHttpClient interface {
	ExecuteRequest(url string, params map[string]string, dest interface{}) error
}

type ContrastHttpClientInstance

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

func NewContrastHttpClient

func NewContrastHttpClient(apiKey, auth string) *ContrastHttpClientInstance

func (*ContrastHttpClientInstance) ExecuteRequest

func (c *ContrastHttpClientInstance) ExecuteRequest(url string, params map[string]string, dest interface{}) error

type ContrastInstance

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

func NewContrastInstance

func NewContrastInstance(url, apiKey, auth string) ContrastInstance

func (*ContrastInstance) GetAppInfo

func (contrast *ContrastInstance) GetAppInfo(appUIUrl, server string) (*ApplicationInfo, error)

func (*ContrastInstance) GetVulnerabilities

func (contrast *ContrastInstance) GetVulnerabilities() ([]ContrastFindings, error)

type VulnerabilitiesResponse

type VulnerabilitiesResponse struct {
	Size            int             `json:"size"`
	TotalElements   int             `json:"totalElements"`
	TotalPages      int             `json:"totalPages"`
	Empty           bool            `json:"empty"`
	First           bool            `json:"first"`
	Last            bool            `json:"last"`
	Vulnerabilities []Vulnerability `json:"content"`
}

type Vulnerability

type Vulnerability struct {
	Severity string `json:"severity"`
	Status   string `json:"status"`
}

Jump to

Keyboard shortcuts

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