endpoint

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Endpoints
	Healthcheck = "Healthcheck"

	FindJob = "FindJob"

	ListUsers        = "ListUsers"
	CreateUser       = "CreateUser"
	UpdateUser       = "UpdateUser"
	FindUser         = "FindUser"
	DeleteUser       = "DeleteUser"
	FindProfile      = "FindProfile"
	GenerateAPIToken = "GenerateAPIToken"

	CreateTeam      = "CreateTeam"
	UpdateTeam      = "UpdateTeam"
	FindTeam        = "FindTeam"
	ListTeams       = "ListTeams"
	DeleteTeam      = "DeleteTeam"
	FindTeamsByUser = "FindTeamsByUser"

	ListTeamMembers  = "ListTeamMembers"
	FindTeamMember   = "FindTeamMember"
	CreateTeamMember = "CreateTeamMember"
	UpdateTeamMember = "UpdateTeamMember"
	DeleteTeamMember = "DeleteTeamMember"

	ListRecipients   = "ListRecipients"
	UpdateRecipients = "UpdateRecipients"

	ListAssets             = "ListAssets"
	CreateAsset            = "CreateAsset"
	CreateAssetMultiStatus = "CreateAssetMultiStatus"
	MergeDiscoveredAssets  = "MergeDiscoveredAssets"
	FindAsset              = "FindAsset"
	UpdateAsset            = "UpdateAsset"
	DeleteAsset            = "DeleteAsset"

	ListAssetAnnotations   = "ListAssetAnnotations"
	CreateAssetAnnotations = "CreateAssetAnnotations"
	UpdateAssetAnnotations = "UpdateAssetAnnotations"
	PutAssetAnnotations    = "PutAssetAnnotations"
	DeleteAssetAnnotations = "DeleteAssetAnnotations"

	CreateGroup = "CreateGroup"
	ListGroups  = "ListGroups"
	UpdateGroup = "UpdateGroup"
	DeleteGroup = "DeleteGroup"
	FindGroup   = "FindGroup"

	GroupAsset     = "GroupAsset"
	UngroupAsset   = "UngroupAsset"
	ListAssetGroup = "ListAssetGroup"

	ListPrograms  = "ListPrograms"
	CreateProgram = "CreateProgram"
	FindProgram   = "FindProgram"
	UpdateProgram = "UpdateProgram"
	DeleteProgram = "DeleteProgram"

	CreateSchedule        = "CreateSchedule"
	DeleteSchedule        = "DeleteSchedule"
	ScheduleGlobalProgram = "ScheduleGlobalProgram"

	ListPolicies = "ListPolicies"
	CreatePolicy = "CreatePolicy"
	FindPolicy   = "FindPolicy"
	UpdatePolicy = "UpdatePolicy"
	DeletePolicy = "DeletePolicy"

	ListChecktypeSetting   = "ListChecktypeSetting"
	CreateChecktypeSetting = "CreateChecktypeSetting"
	FindChecktypeSetting   = "FindChecktypeSetting"
	UpdateChecktypeSetting = "UpdateChecktypeSetting"
	DeleteChecktypeSetting = "DeleteChecktypeSetting"

	ListProgramScans = "ListProgramScans"
	CreateScan       = "CreateScan"
	FindScan         = "FindScan"
	AbortScan        = "AbortScan"

	FindReport      = "FindReport"
	CreateReport    = "CreateReport"
	SendReport      = "SendReport"
	FindReportEmail = "FindReportEmail"

	SendDigestReport = "SendDigestReport"

	StatsCoverage              = "StatsCoverage"
	ListFindings               = "ListFindings"
	ListFindingsIssues         = "ListFindingsIssues"
	ListFindingsByIssue        = "ListFindingsByIssue"
	ListFindingsTargets        = "ListFindingsTargets"
	ListFindingsByTarget       = "ListFindingsByTarget"
	FindFinding                = "FindFinding"
	CreateFindingOverwrite     = "CreateFindingOverwrite"
	ListFindingOverwrites      = "ListFindingOverwrites"
	ListFindingsLabels         = "ListFindingsLabels"
	StatsMTTR                  = "StatsMTTR"
	StatsExposure              = "StatsExposure"
	StatsCurrentExposure       = "StatsCurrentExposure"
	StatsOpen                  = "StatsOpen"
	StatsFixed                 = "StatsFixed"
	GlobalStatsMTTR            = "GlobalStatsMTTR"
	GlobalStatsExposure        = "GlobalStatsExposure"
	GlobalStatsCurrentExposure = "GlobalStatsCurrentExposure"
	GlobalStatsOpen            = "GlobalStatsOpen"
	GlobalStatsFixed           = "GlobalStatsFixed"
	GlobalStatsAssets          = "GlobalStatsAssets"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Accepted

type Accepted struct {
	Data interface{}
}

func (Accepted) MarshalJSON

func (c Accepted) MarshalJSON() ([]byte, error)

func (Accepted) StatusCode

func (c Accepted) StatusCode() int

type AssetAnnotationDeleteRequest

type AssetAnnotationDeleteRequest struct {
	TeamID      string   `json:"team_id" urlvar:"team_id"`
	AssetID     string   `json:"asset_id" urlvar:"asset_id"`
	Annotations []string `json:"annotations"`
}

type AssetAnnotationRequest

type AssetAnnotationRequest struct {
	TeamID      string                  `json:"team_id" urlvar:"team_id"`
	AssetID     string                  `json:"asset_id" urlvar:"asset_id"`
	Annotations api.AssetAnnotationsMap `json:"annotations"`
}

type AssetRequest

type AssetRequest struct {
	ID                string     `json:"id" urlvar:"asset_id"`
	TeamID            string     `json:"team_id" urlvar:"team_id"`
	Type              string     `json:"type" validate:"required"`
	Identifier        string     `json:"identifier" validate:"required" urlquery:"identifier"`
	Options           *string    `json:"options,omitempty"`
	EnvironmentalCVSS *string    `json:"environmental_cvss,omitempty"`
	ROLFP             *api.ROLFP `json:"rolfp"`
	Scannable         *bool      `json:"scannable,omitempty"`
}

func (AssetRequest) NewAsset

func (ar AssetRequest) NewAsset() *api.Asset

type AssetWithAnnotationsRequest

type AssetWithAnnotationsRequest struct {
	AssetRequest

	Annotations api.AssetAnnotationsMap `json:"annotations"`
}

type AssetsGroupRequest

type AssetsGroupRequest struct {
	ID      string `json:"id" urlvar:"group_id"`
	TeamID  string `json:"team_id" urlvar:"team_id"`
	Name    string `json:"name"`
	Options string `json:"options"`
}

type AssetsListRequest

type AssetsListRequest struct {
	TeamID      string                  `json:"team_id" urlvar:"team_id"`
	Assets      []AssetRequest          `json:"assets"`
	Groups      []string                `json:"groups"`
	Annotations api.AssetAnnotationsMap `json:"annotations"`
}

type ChecktypeSettingRequest

type ChecktypeSettingRequest struct {
	ID            string  `json:"id" urlvar:"setting_id"`
	TeamID        string  `json:"team_id" urlvar:"team_id"`
	PolicyID      string  `json:"policy_id" urlvar:"policy_id"`
	CheckTypeName string  `json:"checktype_name"`
	Options       *string `json:"options"`
}

type Created

type Created struct {
	Data interface{}
}

func (Created) MarshalJSON

func (c Created) MarshalJSON() ([]byte, error)

func (Created) StatusCode

func (c Created) StatusCode() int

type DiscoveredAssetsRequest

type DiscoveredAssetsRequest struct {
	TeamID    string                        `json:"team_id" urlvar:"team_id"`
	Assets    []AssetWithAnnotationsRequest `json:"assets"`
	GroupName string                        `json:"group_name"`
}

type EmptyRequest

type EmptyRequest struct{}

type Endpoints

type Endpoints map[string]endpoint.Endpoint

Endpoints contains all available endpoints for this api

func MakeEndpoints

func MakeEndpoints(s api.VulcanitoService, logger log.Logger) Endpoints

MakeEndpoints initialize endpoints using the given service

type FindingOverwriteRequest

type FindingOverwriteRequest struct {
	FindingID string `json:"finding_id" urlvar:"finding_id"`
	TeamID    string `json:"team_id" urlvar:"team_id"`
	Status    string `json:"status"`
	Notes     string `json:"notes"`
}

type FindingsByIssueRequest

type FindingsByIssueRequest struct {
	TeamID      string  `json:"team_id" urlvar:"team_id"`
	Status      string  `urlquery:"status"`
	MinScore    float64 `urlquery:"minScore"`
	MaxScore    float64 `urlquery:"maxScore"`
	AtDate      string  `urlquery:"atDate"`
	MinDate     string  `urlquery:"minDate"`
	MaxDate     string  `urlquery:"maxDate"`
	SortBy      string  `urlquery:"sortBy"`
	Page        int     `urlquery:"page"`
	Size        int     `urlquery:"size"`
	IssueID     string  `json:"issue_id" urlvar:"issue_id"`
	Identifiers string  `urlquery:"identifiers"`
	Labels      string  `urlquery:"labels"`
}

type FindingsByTargetRequest

type FindingsByTargetRequest struct {
	TeamID      string  `json:"team_id" urlvar:"team_id"`
	Status      string  `urlquery:"status"`
	MinScore    float64 `urlquery:"minScore"`
	MaxScore    float64 `urlquery:"maxScore"`
	AtDate      string  `urlquery:"atDate"`
	MinDate     string  `urlquery:"minDate"`
	MaxDate     string  `urlquery:"maxDate"`
	SortBy      string  `urlquery:"sortBy"`
	Page        int     `urlquery:"page"`
	Size        int     `urlquery:"size"`
	TargetID    string  `json:"target_id" urlvar:"target_id"`
	Identifiers string  `urlquery:"identifiers"`
	Labels      string  `urlquery:"labels"`
}

type FindingsRequest

type FindingsRequest struct {
	ID          string  `json:"id" urlvar:"finding_id"`
	TeamID      string  `json:"team_id" urlvar:"team_id"`
	Status      string  `urlquery:"status"`
	MinScore    float64 `urlquery:"minScore"`
	MaxScore    float64 `urlquery:"maxScore"`
	AtDate      string  `urlquery:"atDate"`
	MinDate     string  `urlquery:"minDate"`
	MaxDate     string  `urlquery:"maxDate"`
	SortBy      string  `urlquery:"sortBy"`
	Page        int     `urlquery:"page"`
	Size        int     `urlquery:"size"`
	Identifier  string  `urlquery:"identifier"`
	IssueID     string  `urlquery:"issueID"`
	TargetID    string  `urlquery:"targetID"`
	Identifiers string  `urlquery:"identifiers"`
	Labels      string  `urlquery:"labels"`
}

type Forbidden

type Forbidden struct {
	Data interface{}
}

func (Forbidden) MarshalJSON

func (c Forbidden) MarshalJSON() ([]byte, error)

func (Forbidden) StatusCode

func (c Forbidden) StatusCode() int

type GlobalStatsRequest added in v1.1.0

type GlobalStatsRequest struct {
	Tags string `urlquery:"tags"`
	StatsRequest
}

type GroupAssetRequest

type GroupAssetRequest struct {
	GroupID string `json:"group_id" urlvar:"group_id"`
	AssetID string `json:"asset_id" urlvar:"asset_id"`
	TeamID  string `urlvar:"team_id"`
}

type HTTPResponse

type HTTPResponse interface {
	StatusCode() int
}

type HealthcheckJSONRequest

type HealthcheckJSONRequest struct {
}

type JobRequest

type JobRequest struct {
	ID string `json:"job_id" urlvar:"job_id"`
}

JobRequest defines the information required to retrieve a job.

type ListGroupsRequest

type ListGroupsRequest struct {
	TeamID string `json:"team_id" urlvar:"team_id"`
	Name   string `json:"name" urlquery:"name"`
}

type ListProgramScansRequest

type ListProgramScansRequest struct {
	TeamID    string `urlvar:"team_id"`
	ProgramID string `urlvar:"program_id"`
}

ListProgramScansRequest holds the information passed to the ListProgramScans endpoint.

type MultiStatus

type MultiStatus struct {
	Data interface{}
}

func (MultiStatus) MarshalJSON

func (m MultiStatus) MarshalJSON() ([]byte, error)

func (MultiStatus) StatusCode

func (makeCreateAssetMultiStatusEndpoint MultiStatus) StatusCode() int

type NoContent

type NoContent struct {
	Data interface{}
}

func (NoContent) MarshalJSON

func (c NoContent) MarshalJSON() ([]byte, error)

func (NoContent) StatusCode

func (c NoContent) StatusCode() int

type Ok

type Ok struct {
	Data interface{}
}

func (Ok) MarshalJSON

func (c Ok) MarshalJSON() ([]byte, error)

func (Ok) StatusCode

func (c Ok) StatusCode() int

type PolicyRequest

type PolicyRequest struct {
	ID     string `json:"id" urlvar:"policy_id"`
	TeamID string `json:"team_id" urlvar:"team_id"`
	Name   string `json:"name"`
	Global *bool  `json:"global"`
}

type ProgramPolicyGroups

type ProgramPolicyGroups []ProgramsPolicyGroup

ProgramPolicyGroups stores a slice with the list os pairs policyid groupid for a program.

func (ProgramPolicyGroups) ToAPI

ToAPI returns the represetantion needed by vulcanito service for the slice of tuples of policies-groups associated to a program

type ProgramRequest

type ProgramRequest struct {
	ID           string               `json:"id" urlvar:"program_id"`
	Name         string               `json:"name"`
	PolicyGroups *ProgramPolicyGroups `json:"policy_groups"`
	Autosend     *bool                `json:"autosend"`
	Disabled     *bool                `json:"disabled"`
	TeamID       string               `json:"team_id" urlvar:"team_id"`
}

type ProgramsPolicyGroup

type ProgramsPolicyGroup struct {
	PolicyID string `json:"policy_id" validate:"required"`
	GroupID  string `json:"group_id" validate:"required"`
}

ProgramsPolicyGroup holds the tuples (PolicyID,GroupID) that defines a a set of checktypes to be executed against a set of assets in a program.

type RecipientsData

type RecipientsData struct {
	TeamID string   `json:"team_id" urlvar:"team_id"`
	Emails []string `json:"emails"`
}

type ReportRequest

type ReportRequest struct {
	ID     string `json:"id" urlvar:"scan_id"`
	TeamID string `json:"team_id" urlvar:"team_id"`
	ScanID string `json:"scan_id" urlvar:"scan_id"`
}

type ScanRequest

type ScanRequest struct {
	ID            string     `json:"id" urlvar:"scan_id"`
	TeamID        string     `json:"team_id" urlvar:"team_id"`
	ProgramID     string     `json:"program_id"`
	ScheduledTime *time.Time `json:"scheduled_time"`
	EndTime       *time.Time `json:"end_time"`
}

type ScheduleGlobalRequest

type ScheduleGlobalRequest struct {
	ID   string `json:"id" urlvar:"program_id"`
	Cron string `json:"cron"`
}

ScheduleGlobalRequest holds the payload required for the endpoint that schedules global programs.

type ScheduleRequest

type ScheduleRequest struct {
	ID     string `json:"id" urlvar:"program_id"`
	TeamID string `json:"team_id" urlvar:"team_id"`
	Cron   string `json:"cron"`
}

ScheduleRequest holds the payload required for the endpoint that schedules a program.

type SendDigestReportRequest

type SendDigestReportRequest struct {
	TeamID    string `json:"team_id" urlvar:"team_id"`
	StartDate string `json:"start_date"`
	EndDate   string `json:"end_date"`
}

type ServerDown

type ServerDown struct {
	Data interface{}
}

func (ServerDown) MarshalJSON

func (c ServerDown) MarshalJSON() ([]byte, error)

func (ServerDown) StatusCode

func (c ServerDown) StatusCode() int

type StatsCoverageRequest

type StatsCoverageRequest struct {
	TeamID string `json:"team_id" urlvar:"team_id"`
}

type StatsRequest

type StatsRequest struct {
	TeamID      string  `json:"team_id" urlvar:"team_id"`
	Teams       string  `urlquery:"teams"`
	MinDate     string  `urlquery:"minDate"`
	MaxDate     string  `urlquery:"maxDate"`
	AtDate      string  `urlquery:"atDate"`
	MinScore    float64 `urlquery:"minScore"`
	MaxScore    float64 `urlquery:"maxScore"`
	Identifiers string  `urlquery:"identifiers"`
	Labels      string  `urlquery:"labels"`
}

type TeamMemberRequest

type TeamMemberRequest struct {
	TeamID string `json:"team_id" urlvar:"team_id"`
	UserID string `json:"user_id" urlvar:"user_id"`
	Email  string `json:"email"`
	Role   string `json:"role"`
}

type TeamRequest

type TeamRequest struct {
	ID          string `urlvar:"team_id"`
	Name        string `json:"name"`
	Tag         string `json:"tag" urlquery:"tag"`
	Description string `json:"description"`
}

type TeamUpdateRequest

type TeamUpdateRequest struct {
	ID          string  `urlvar:"team_id"`
	Name        *string `json:"name"`
	Tag         *string `json:"tag"`
	Description *string `json:"description"`
}

type UserRequest

type UserRequest struct {
	ID        string `json:"user_id" urlvar:"user_id"`
	FirstName string `json:"firstname"`
	LastName  string `json:"lastname"`
	Email     string `json:"email"`
	Active    *bool  `json:"active"`
	Admin     *bool  `json:"admin"`
	Observer  *bool  `json:"observer"`
}

Jump to

Keyboard shortcuts

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