findings

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "findings"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [5]string{"List findings", "Get finding", "List events by finding", "Get finding MTTR", "Patch finding"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewGetFindingEndpoint

func NewGetFindingEndpoint(s Service) goa.Endpoint

NewGetFindingEndpoint returns an endpoint function that calls the method "Get finding" of service "findings".

func NewGetFindingMTTREndpoint

func NewGetFindingMTTREndpoint(s Service) goa.Endpoint

NewGetFindingMTTREndpoint returns an endpoint function that calls the method "Get finding MTTR" of service "findings".

func NewListEventsByFindingEndpoint

func NewListEventsByFindingEndpoint(s Service) goa.Endpoint

NewListEventsByFindingEndpoint returns an endpoint function that calls the method "List events by finding" of service "findings".

func NewListFindingsEndpoint

func NewListFindingsEndpoint(s Service) goa.Endpoint

NewListFindingsEndpoint returns an endpoint function that calls the method "List findings" of service "findings".

func NewPatchFindingEndpoint

func NewPatchFindingEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint

NewPatchFindingEndpoint returns an endpoint function that calls the method "Patch finding" of service "findings".

func NewViewedEventCollection

func NewViewedEventCollection(res EventCollection, view string) findingsviews.EventCollection

NewViewedEventCollection initializes viewed result type EventCollection from result type EventCollection using the given view.

func NewViewedFinding

func NewViewedFinding(res *Finding, view string) *findingsviews.Finding

NewViewedFinding initializes viewed result type Finding from result type Finding using the given view.

func NewViewedFindingCollection

func NewViewedFindingCollection(res FindingCollection, view string) findingsviews.FindingCollection

NewViewedFindingCollection initializes viewed result type FindingCollection from result type FindingCollection using the given view.

func NewViewedMttr

func NewViewedMttr(res *Mttr, view string) *findingsviews.Mttr

NewViewedMttr initializes viewed result type Mttr from result type Mttr using the given view.

Types

type Auther

type Auther interface {
	// APIKeyAuth implements the authorization logic for the APIKey security scheme.
	APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	ListFindingsEndpoint        goa.Endpoint
	GetFindingEndpoint          goa.Endpoint
	ListEventsByFindingEndpoint goa.Endpoint
	GetFindingMTTREndpoint      goa.Endpoint
	PatchFindingEndpoint        goa.Endpoint
}

Client is the "findings" service client.

func NewClient

func NewClient(listFindings, getFinding, listEventsByFinding, getFindingMTTR, patchFinding goa.Endpoint) *Client

NewClient initializes a "findings" service client given the endpoints.

func (*Client) GetFinding

func (c *Client) GetFinding(ctx context.Context, p *GetFindingPayload) (res *Finding, err error)

GetFinding calls the "Get finding" endpoint of the "findings" service.

func (*Client) GetFindingMTTR

func (c *Client) GetFindingMTTR(ctx context.Context, p *GetFindingMTTRPayload) (res *Mttr, err error)

GetFindingMTTR calls the "Get finding MTTR" endpoint of the "findings" service.

func (*Client) ListEventsByFinding

func (c *Client) ListEventsByFinding(ctx context.Context, p *ListEventsByFindingPayload) (res EventCollection, err error)

ListEventsByFinding calls the "List events by finding" endpoint of the "findings" service.

func (*Client) ListFindings

func (c *Client) ListFindings(ctx context.Context, p *ListFindingsPayload) (res FindingCollection, err error)

ListFindings calls the "List findings" endpoint of the "findings" service.

func (*Client) PatchFinding

func (c *Client) PatchFinding(ctx context.Context, p *PatchFindingPayload) (res *Finding, err error)

PatchFinding calls the "Patch finding" endpoint of the "findings" service.

type Endpoints

type Endpoints struct {
	ListFindings        goa.Endpoint
	GetFinding          goa.Endpoint
	ListEventsByFinding goa.Endpoint
	GetFindingMTTR      goa.Endpoint
	PatchFinding        goa.Endpoint
}

Endpoints wraps the "findings" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "findings" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "findings" service endpoints.

type Event

type Event struct {
	// Finding event ID
	ID *string
	// Finding ID
	FindingID *string
	// Source ID
	SourceID *string
	// Finding severity score
	Score *float32
	// Event time
	Time *string
}

type EventCollection

type EventCollection []*Event

EventCollection is the result type of the findings service List events by finding method.

func NewEventCollection

func NewEventCollection(vres findingsviews.EventCollection) EventCollection

NewEventCollection initializes result type EventCollection from viewed result type EventCollection.

type Finding

type Finding struct {
	// Finding ID
	ID *string
	// Issue
	Issue *Issue
	// Target
	Target *Target
	// Source
	Source *Sourcewithnotarget
	// Finding details
	Details *string
	// Finding impact details
	ImpactDetails *string
	// Finding status. Can be 'OPEN' or 'FIXED'.
	Status *string
	// Finding severity score
	Score *float32
	// Other resources associated with the finding
	Resources []*ResourceGroup
}

Finding is the result type of the findings service Get finding method.

func NewFinding

func NewFinding(vres *findingsviews.Finding) *Finding

NewFinding initializes result type Finding from viewed result type Finding.

type FindingCollection

type FindingCollection []*Finding

FindingCollection is the result type of the findings service List findings method.

func NewFindingCollection

func NewFindingCollection(vres findingsviews.FindingCollection) FindingCollection

NewFindingCollection initializes result type FindingCollection from viewed result type FindingCollection.

type GetFindingMTTRPayload

type GetFindingMTTRPayload struct {
	// Finding ID
	ID *string
}

GetFindingMTTRPayload is the payload type of the findings service Get finding MTTR method.

type GetFindingPayload

type GetFindingPayload struct {
	// Finding ID
	ID *string
}

GetFindingPayload is the payload type of the findings service Get finding method.

type Issue

type Issue struct {
	// Issue ID
	ID *string
	// Issue summary
	Summary *string
	// Common Weakness Enumeration ID
	CweID *int
	// Issue description
	Description *string
	// Recommendations to fix the issue
	Recommendations []string
	// Documentation reference for the issue
	ReferenceLinks []string
	// Labels associated with the issue
	Labels []string
}

type ListEventsByFindingPayload

type ListEventsByFindingPayload struct {
	// Finding ID
	ID *string
	// Number of page requested
	Page *int
	// Number of results per page
	Size *int
}

ListEventsByFindingPayload is the payload type of the findings service List events by finding method.

type ListFindingsPayload

type ListFindingsPayload struct {
	// Targets team filter
	Team *string
	// Targets multiple teams filter, separated by commas
	Teams *string
	// Finding status filter. Can be 'OPEN' or 'FIXED'.
	Status *string
	// Minimum issues score filter
	MinScore *int
	// Maximum issues score filter
	MaxScore *int
	// Allows to get a list of findings for a specific date (YYYY-MM-DD). This
	// filter has preference over minDate and maxDate.
	AtDate *string
	// Minimum date filter (YYYY-MM-DD). This filter only applies when used in
	// conjunction with status filter.
	MinDate *string
	// Maximum date filter (YYYY-MM-DD). This filter only applies when used in
	// conjunction with status filter.
	MaxDate *string
	// Sorting criteria. Supported fields: score, -score (for descending order)
	SortBy *string
	// Number of page requested
	Page *int
	// Number of results per page
	Size *int
	// Findings identifier filter
	Identifier *string
	// Exact match in identifier filter
	Identifiermatch *bool
	// A list of asset identifiers
	Identifiers *string
	// List of issue labels to filter by
	Labels *string
}

ListFindingsPayload is the payload type of the findings service List findings method.

type Mttr

type Mttr struct {
	Mttr *int
}

Mttr is the result type of the findings service Get finding MTTR method.

func NewMttr

func NewMttr(vres *findingsviews.Mttr) *Mttr

NewMttr initializes result type Mttr from viewed result type Mttr.

type PatchFindingPayload

type PatchFindingPayload struct {
	Authorization *string
	// Finding ID
	ID *string
	// Status
	Status *string
}

PatchFindingPayload is the payload type of the findings service Patch finding method.

type ResourceGroup

type ResourceGroup struct {
	// Name of the resource group
	Name *string
	// Column names of the resource group in the order that should be rendered
	Attributes []string
	// List containing the resource rows as hashmap
	Resources []map[string]string
}

type Service

type Service interface {
	// This method allows to list findings by using different filters.
	// When querying for open findings in a specific time range, it returns every
	// finding that has been found in that time, regardless if that finding has
	// also been fixed in that span of time.
	// When querying for fixed findings in a specific time range, it returns every
	// finding that has been fixed in that time and it's fixed at the end of that
	// time range, so a finding that is fixed and then reopened in that range of
	// time will not be returned.
	ListFindings(context.Context, *ListFindingsPayload) (res FindingCollection, err error)
	// GetFinding implements Get finding.
	GetFinding(context.Context, *GetFindingPayload) (res *Finding, err error)
	// ListEventsByFinding implements List events by finding.
	ListEventsByFinding(context.Context, *ListEventsByFindingPayload) (res EventCollection, err error)
	// GetFindingMTTR implements Get finding MTTR.
	GetFindingMTTR(context.Context, *GetFindingMTTRPayload) (res *Mttr, err error)
	// PatchFinding implements Patch finding.
	PatchFinding(context.Context, *PatchFindingPayload) (res *Finding, err error)
}

Findings endpoint.

type Sourcewithnotarget

type Sourcewithnotarget struct {
	// Source ID
	ID *string
	// Source name
	Name *string
	// Source component
	Component *string
	// Source instance
	Instance *string
	// Source options
	Options *string
	// Time on which the source scanned the target
	Time *string
}

type Target

type Target struct {
	// Target ID
	ID *string
	// Target identifier
	Identifier *string
	// List of teams associated with target
	Teams []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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