entity

package
v0.0.0-...-8717b9c Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllActivityStatusValues = []string{
	ActivityStatusValuesOpen.String(),
	ActivityStatusValuesClosed.String(),
	ActivityStatusValuesInProgress.String(),
}
View Source
var AllIssueMatchChangeActions = []string{
	IssueMatchChangeActionAdd.String(),
	IssueMatchChangeActionRemove.String(),
}
View Source
var AllIssueTypes = []string{
	IssueTypeVulnerability.String(),
	IssueTypePolicyViolation.String(),
	IssueTypeSecurityEvent.String(),
}

Functions

func GetUserTypeString

func GetUserTypeString(ut UserType) string

Types

type Activity

type Activity struct {
	Metadata
	Id        int64               `json:"id"`
	Status    ActivityStatusValue `json:"status"`
	Service   *Service            `json:"service,omitempty"`
	Issues    []Issue             `json:"issues,omitempty"`
	Evidences []Evidence          `json:"evidences,omitempty"`
}

func (*Activity) GetId

func (a *Activity) GetId() int64

type ActivityAggregations

type ActivityAggregations struct {
}

type ActivityFilter

type ActivityFilter struct {
	Paginated
	Status      []*string `json:"status"`
	ServiceCCRN []*string `json:"service_ccrn"`
	Id          []*int64  `json:"id"`
	ServiceId   []*int64  `json:"service_id"`
	IssueId     []*int64  `json:"issue_id"`
	EvidenceId  []*int64  `json:"evidence_id"`
}

type ActivityHasIssue

type ActivityHasIssue struct {
	Metadata
	ActivityId int64 `json:"activity_id"`
	IssueId    int64 `json:"issue_id"`
}

type ActivityResult

type ActivityResult struct {
	WithCursor
	*ActivityAggregations
	*Activity
}

type ActivityStatusValue

type ActivityStatusValue string
const (
	ActivityStatusValuesOpen       ActivityStatusValue = "open"
	ActivityStatusValuesClosed     ActivityStatusValue = "closed"
	ActivityStatusValuesInProgress ActivityStatusValue = "in_progress"
)

func NewActivityStatusValue

func NewActivityStatusValue(s string) ActivityStatusValue

func (ActivityStatusValue) String

func (e ActivityStatusValue) String() string

type BaseIssueRepository

type BaseIssueRepository struct {
	Metadata
	Id            int64          `json:"id"`
	Name          string         `json:"name"`
	Url           string         `json:"url"`
	IssueVariants []IssueVariant `json:"issue_variants,omitempty"`
	Services      []Service      `json:"services,omitempty"`
}

type BaseService

type BaseService struct {
	Metadata
	Id             int64         `json:"id"`
	CCRN           string        `json:"ccrn"`
	SupportGroup   *SupportGroup `json:"support_group,omitempty"`
	SupportGroupId int64         `db:"service_support_group_id"`
	Owners         []User        `json:"owners,omitempty"`
	Activities     []Activity    `json:"activities,omitempty"`
	Priority       int64         `json:"priority"`
}

type Component

type Component struct {
	Metadata
	Id   int64  `json:"id"`
	CCRN string `json:"ccrn"`
	Type string `json:"type"`
}

type ComponentAggregations

type ComponentAggregations struct {
}

type ComponentFilter

type ComponentFilter struct {
	Paginated
	CCRN               []*string `json:"ccrn"`
	Id                 []*int64  `json:"id"`
	ComponentVersionId []*int64  `json:"component_version_id"`
}

type ComponentInstance

type ComponentInstance struct {
	Metadata
	Id                 int64             `json:"id"`
	CCRN               string            `json:"ccrn"`
	Count              int16             `json:"count"`
	ComponentVersion   *ComponentVersion `json:"component_version,omitempty"`
	ComponentVersionId int64             `db:"componentinstance_component_version_id"`
	Service            *Service          `json:"service,omitempty"`
	ServiceId          int64             `db:"componentinstance_service_id"`
}

type ComponentInstanceAggregations

type ComponentInstanceAggregations struct {
}

type ComponentInstanceFilter

type ComponentInstanceFilter struct {
	Paginated
	IssueMatchId       []*int64  `json:"issue_match_id"`
	ServiceId          []*int64  `json:"service_id"`
	ServiceCcrn        []*string `json:"service_ccrn"`
	ComponentVersionId []*int64  `json:"component_version_id"`
	Id                 []*int64  `json:"id"`
	CCRN               []*string `json:"ccrn"`
	Search             []*string `json:"search"`
}

type ComponentResult

type ComponentResult struct {
	WithCursor
	*ComponentAggregations
	*Component
}

type ComponentVersion

type ComponentVersion struct {
	Metadata
	Id                 int64               `json:"id"`
	Version            string              `json:"version"`
	Component          *Component          `json:"component,omitempty"`
	ComponentId        int64               `db:"componentversion_component_id"`
	ComponentInstances []ComponentInstance `json:"component_instances,omitempty"`
	Issues             []Issue             `json:"issues,omitempty"`
}

type ComponentVersionAggregations

type ComponentVersionAggregations struct {
}

type ComponentVersionFilter

type ComponentVersionFilter struct {
	Paginated
	Id            []*int64  `json:"id"`
	IssueId       []*int64  `json:"issue_id"`
	ComponentCCRN []*string `json:"component_ccrn"`
	ComponentId   []*int64  `json:"component_id"`
	Version       []*string `json:"version"`
}

type ComponentVersionResult

type ComponentVersionResult struct {
	WithCursor
	*ComponentVersion
	*ComponentVersionAggregations
}

type Cursor

type Cursor struct {
	Statement string
	Value     int64
	Limit     int
}

type Cvss

type Cvss struct {
	Vector        string
	Base          *metric.Base
	Temporal      *metric.Temporal
	Environmental *metric.Environmental
}

type Evidence

type Evidence struct {
	Metadata
	Id          int64        `json:"id"`
	Description string       `json:"description"`
	Type        EvidenceType `json:"type"`
	RaaEnd      time.Time    `json:"raa_end"`
	Severity    Severity     `json:"severity"`
	User        *User        `json:"user,omitempty"`
	UserId      int64        `db:"evidence_author_id"`
	Activity    *Activity    `json:"activity,omitempty"`
	ActivityId  int64        `db:"evidence_activity_id"`
}

type EvidenceAggregations

type EvidenceAggregations struct {
}

type EvidenceFilter

type EvidenceFilter struct {
	Paginated
	Id           []*int64 `json:"id"`
	ActivityId   []*int64 `json:"activity_id"`
	IssueMatchId []*int64 `json:"issue_match_id"`
	UserId       []*int64 `json:"user_id"`
}

type EvidenceResult

type EvidenceResult struct {
	WithCursor
	*Evidence
	*EvidenceAggregations
}

type EvidenceType

type EvidenceType string
const (
	EvidenceTypeValuesRiskAccepted       EvidenceType = "risk_accepted"
	EvidenceTypeValuesMitigated          EvidenceType = "mitigated"
	EvidenceTypeValuesSeverityAdjustment EvidenceType = "severity_adjustment"
	EvidenceTypeValuesFalsePositive      EvidenceType = "false_positive"
	EvidenceTypeValuesReOpen             EvidenceType = "reopen"
)

func NewEvidenceTypeValue

func NewEvidenceTypeValue(s string) EvidenceType

func (EvidenceType) String

func (e EvidenceType) String() string

type HasCursor

type HasCursor interface {
	Cursor() *string
}

type Issue

type Issue struct {
	Metadata
	Id                int64              `json:"id"`
	Type              IssueType          `json:"type"`
	PrimaryName       string             `json:"primary_name"`
	Description       string             `json:"description"`
	IssueVariants     []IssueVariant     `json:"issue_variants,omitempty"`
	IssueMatches      []IssueMatch       `json:"issue_matches,omitempty"`
	ComponentVersions []ComponentVersion `json:"component_versions,omitempty"`
	Activity          []Activity         `json:"activity,omitempty"`
}

type IssueAggregations

type IssueAggregations struct {
	Activities                    int64
	IssueMatches                  int64
	AffectedServices              int64
	AffectedComponentInstances    int64
	ComponentVersions             int64
	EarliestTargetRemediationDate time.Time
	EarliestDiscoveryDate         time.Time
}

type IssueCount

type IssueCount struct {
	Count int64     `json:"count"`
	Type  IssueType `json:"type"`
}

type IssueFilter

type IssueFilter struct {
	Paginated
	PrimaryName                     []*string   `json:"primary_name"`
	ServiceCCRN                     []*string   `json:"service_ccrn"`
	Type                            []*string   `json:"type"`
	Id                              []*int64    `json:"id"`
	ActivityId                      []*int64    `json:"activity_id"`
	IssueMatchId                    []*int64    `json:"issue_match_id"`
	ComponentVersionId              []*int64    `json:"component_version_id"`
	IssueVariantId                  []*int64    `json:"issue_variant_id"`
	Search                          []*string   `json:"search"`
	IssueMatchStatus                []*string   `json:"issue_match_status"`
	IssueMatchDiscoveryDate         *TimeFilter `json:"issue_match_discovery_date"`
	IssueMatchTargetRemediationDate *TimeFilter `json:"issue_match_target_remediation_date"`
}

type IssueList

type IssueList struct {
	*List[IssueResult]
	VulnerabilityCount   *int64
	PolicyViolationCount *int64
	SecurityEventCount   *int64
}

type IssueListOptions

type IssueListOptions struct {
	ListOptions
	ShowIssueTypeCounts bool
}

type IssueMatch

type IssueMatch struct {
	Metadata
	Id                    int64                 `json:"id"`
	Status                IssueMatchStatusValue `json:"status"`
	User                  *User                 `json:"user,omitempty"`
	UserId                int64                 `json:"user_id"`
	Severity              Severity              `json:"severity,omitempty"`
	Evidences             []Evidence            `json:"evidence,omitempty"`
	ComponentInstance     *ComponentInstance    `json:"component_instance,omitempty"`
	ComponentInstanceId   int64                 `json:"component_instance_id"`
	Issue                 *Issue                `json:"issue,omitempty"`
	IssueId               int64                 `json:"issue_id"`
	RemediationDate       time.Time             `json:"remediation_date"`
	TargetRemediationDate time.Time             `json:"target_remediation_date"`
}

type IssueMatchChange

type IssueMatchChange struct {
	Metadata
	Id           int64 `json:"id"`
	ActivityId   int64 `json:"activity_id"`
	Activity     *Activity
	IssueMatchId int64 `json:"issue_match_id"`
	IssueMatch   *IssueMatch
	Action       string `json:"action"`
}

type IssueMatchChangeAction

type IssueMatchChangeAction string
const (
	IssueMatchChangeActionAdd    IssueMatchChangeAction = "add"
	IssueMatchChangeActionRemove IssueMatchChangeAction = "remove"
)

func NewIssueMatchChangeAction

func NewIssueMatchChangeAction(s string) IssueMatchChangeAction

func (IssueMatchChangeAction) String

func (e IssueMatchChangeAction) String() string

type IssueMatchChangeFilter

type IssueMatchChangeFilter struct {
	Paginated
	Id           []*int64  `json:"id"`
	ActivityId   []*int64  `json:"activity_id"`
	IssueMatchId []*int64  `json:"issue_match_id"`
	Action       []*string `json:"action"`
}

type IssueMatchChangeResult

type IssueMatchChangeResult struct {
	WithCursor
	*IssueMatchChange
}

type IssueMatchFilter

type IssueMatchFilter struct {
	Paginated
	Id                  []*int64  `json:"id"`
	AffectedServiceCCRN []*string `json:"affected_service_ccrn"`
	SeverityValue       []*string `json:"severity_value"`
	Status              []*string `json:"status"`
	IssueId             []*int64  `json:"issue_id"`
	EvidenceId          []*int64  `json:"evidence_id"`
	ComponentInstanceId []*int64  `json:"component_instance_id"`
	SupportGroupCCRN    []*string `json:"support_group_ccrn"`
	Search              []*string `json:"search"`
	ComponentCCRN       []*string `json:"component_ccrn"`
	PrimaryName         []*string `json:"primary_name"`
	IssueType           []*string `json:"issue_type"`
}

type IssueMatchResult

type IssueMatchResult struct {
	WithCursor
	*IssueMatch
}

type IssueMatchStatusValue

type IssueMatchStatusValue string
const (
	IssueMatchStatusValuesNew           IssueMatchStatusValue = "new"
	IssueMatchStatusValuesRiskAccepted  IssueMatchStatusValue = "risk_accepted"
	IssueMatchStatusValuesFalsePositive IssueMatchStatusValue = "false_positive"
	IssueMatchStatusValuesMitigated     IssueMatchStatusValue = "mitigated"
	IssueMatchStatusValuesNone          IssueMatchStatusValue = "none"
)

func NewIssueMatchStatusValue

func NewIssueMatchStatusValue(s string) IssueMatchStatusValue

func (IssueMatchStatusValue) String

func (e IssueMatchStatusValue) String() string

type IssueRepository

type IssueRepository struct {
	BaseIssueRepository
	IssueRepositoryService
}

type IssueRepositoryAggregations

type IssueRepositoryAggregations struct {
}

type IssueRepositoryFilter

type IssueRepositoryFilter struct {
	Paginated
	Id          []*int64  `json:"id"`
	ServiceId   []*int64  `json:"service_id"`
	Name        []*string `json:"name"`
	ServiceCCRN []*string `json:"service_ccrn"`
}

func NewIssueRepositoryFilter

func NewIssueRepositoryFilter() *IssueRepositoryFilter

type IssueRepositoryResult

type IssueRepositoryResult struct {
	WithCursor
	*IssueRepositoryAggregations
	*IssueRepository
}

type IssueRepositoryService

type IssueRepositoryService struct {
	Metadata
	ServiceId         int64 `json:"service_id"`
	IssueRepositoryId int64 `json:"issue_repository_id"`
	Priority          int64 `json:"priority"`
}

type IssueResult

type IssueResult struct {
	WithCursor
	*IssueAggregations
	*Issue
	*IssueVariant
}

type IssueType

type IssueType string
const (
	IssueTypeVulnerability   IssueType = "Vulnerability"
	IssueTypePolicyViolation IssueType = "PolicyViolation"
	IssueTypeSecurityEvent   IssueType = "SecurityEvent"
)

func NewIssueType

func NewIssueType(s string) IssueType

func (IssueType) String

func (e IssueType) String() string

type IssueTypeCounts

type IssueTypeCounts struct {
	VulnerabilityCount   int64 `json:"vulnerability_count"`
	PolicyViolationCount int64 `json:"policy_violation_count"`
	SecurityEventCount   int64 `json:"security_event_count"`
}

func (*IssueTypeCounts) TotalIssueCount

func (itc *IssueTypeCounts) TotalIssueCount() int64

type IssueVariant

type IssueVariant struct {
	Metadata
	Id                int64            `json:"id"`
	IssueRepositoryId int64            `json:"issue_repository_id"`
	IssueRepository   *IssueRepository `json:"issue_repository"`
	SecondaryName     string           `json:"secondary_name"`
	IssueId           int64            `json:"issue_id"`
	Issue             *Issue           `json:"issue"`
	Severity          Severity         `json:"severity"`
	Description       string           `json:"description"`
}

type IssueVariantAggregations

type IssueVariantAggregations struct {
}

type IssueVariantFilter

type IssueVariantFilter struct {
	Paginated
	Id                []*int64  `json:"id"`
	SecondaryName     []*string `json:"secondary_name"`
	IssueId           []*int64  `json:"issue_id"`
	IssueRepositoryId []*int64  `json:"issue_repository_id"`
	ServiceId         []*int64  `json:"service_id"`
	IssueMatchId      []*int64  `json:"issue_match_id"`
}

func NewIssueVariantFilter

func NewIssueVariantFilter() *IssueVariantFilter

type IssueVariantResult

type IssueVariantResult struct {
	WithCursor
	*IssueVariantAggregations
	*IssueVariant
}

type IssueWithAggregations

type IssueWithAggregations struct {
	IssueAggregations
	Issue
}

type List

type List[T interface{}] struct {
	TotalCount *int64
	PageInfo   *PageInfo
	Elements   []T
}

type ListOptions

type ListOptions struct {
	ShowTotalCount      bool `json:"show_total_count"`
	ShowPageInfo        bool `json:"show_page_info"`
	IncludeAggregations bool `json:"include_aggregations"`
}

func NewListOptions

func NewListOptions() *ListOptions

type Metadata

type Metadata struct {
	CreatedAt time.Time `json:"created_at"`
	CreatedBy int64     `json:"created_by"`
	UpdatedAt time.Time `json:"updated_at"`
	UpdatedBy int64     `json:"updated_by"`
	DeletedAt time.Time `json:"deleted_at,omitempty"`
}

type Page

type Page struct {
	After      *string `json:"after,omitempty"`
	PageNumber *int    `json:"page_number,omitempty"`
	IsCurrent  bool    `json:"is_current,omitempty"`
	PageCount  *int    `json:"page_count,omitempty"`
}

type PageInfo

type PageInfo struct {
	HasNextPage     *bool   `json:"has_next_page,omitempty"`
	HasPreviousPage *bool   `json:"has_previous_page,omitempty"`
	IsValidPage     *bool   `json:"is_valid_page,omitempty"`
	PageNumber      *int    `json:"page_number,omitempty"`
	NextPageAfter   *string `json:"next_page_after,omitempty"`
	StartCursor     *string `json:"deprecated,omitempty"` //@todo remove as deprecated
	EndCursor       *string `json:"end_cursor,omitempty"` //@todo remove as deprecated
	Pages           []Page  `json:"pages,omitempty"`
}

type Paginated

type Paginated struct {
	First *int   `json:"first"`
	After *int64 `json:"from"`
}

func MaxPaginated

func MaxPaginated() Paginated

type ResultList

type ResultList struct {
	TotalCount *int64
	PageInfo   *PageInfo
}

type ScannerRun

type ScannerRun struct {
	RunID     int64     `json:"run_id"`
	UUID      string    `json:"uuid"`
	Tag       string    `json:"tag"`
	StartRun  time.Time `json:"start_run"`
	EndRun    time.Time `json:"end_run"`
	Completed bool      `json:"is_completed"`
}

func (ScannerRun) IsCompleted

func (sc ScannerRun) IsCompleted() bool

type Service

type Service struct {
	BaseService
	IssueRepositoryService
}

type ServiceAggregations

type ServiceAggregations struct {
	ComponentInstances int64
	IssueMatches       int64
}

type ServiceFilter

type ServiceFilter struct {
	Paginated
	SupportGroupCCRN    []*string `json:"support_group_ccrn"`
	Id                  []*int64  `json:"id"`
	CCRN                []*string `json:"ccrn"`
	OwnerName           []*string `json:"owner_name"`
	OwnerId             []*int64  `json:"owner_id"`
	ActivityId          []*int64  `json:"activity_id"`
	ComponentInstanceId []*int64  `json:"component_instance_id"`
	IssueRepositoryId   []*int64  `json:"issue_repository_id"`
	SupportGroupId      []*int64  `json:"support_group_id"`
	Search              []*string `json:"search"`
}

type ServiceIssueVariant

type ServiceIssueVariant struct {
	IssueVariant
	ServiceId int64 `json:"service_id"`
	Priority  int64 `json:"priority"`
}

type ServiceIssueVariantFilter

type ServiceIssueVariantFilter struct {
	Paginated
	ComponentInstanceId []*int64 `json:"component_instance_id"`
	IssueId             []*int64 `json:"issue_id"`
}

func NewServiceIssueVariantFilter

func NewServiceIssueVariantFilter() *ServiceIssueVariantFilter

type ServiceResult

type ServiceResult struct {
	WithCursor
	*ServiceAggregations
	*Service
}

type ServiceWithAggregations

type ServiceWithAggregations struct {
	Service
	ServiceAggregations
}

type Severity

type Severity struct {
	Value string
	Score float64
	Cvss  Cvss
}

func NewSeverity

func NewSeverity(url string) Severity

func NewSeverityFromRating

func NewSeverityFromRating(rating SeverityValues) Severity

type SeverityFilter

type SeverityFilter struct {
	IssueMatchId []*int64 `json:"issue_match_id"`
	IssueId      []*int64 `json:"issue_id"`
}

type SeverityValues

type SeverityValues string
const (
	SeverityValuesNone     SeverityValues = "None"
	SeverityValuesLow      SeverityValues = "Low"
	SeverityValuesMedium   SeverityValues = "Medium"
	SeverityValuesHigh     SeverityValues = "High"
	SeverityValuesCritical SeverityValues = "Critical"
)

type SupportGroup

type SupportGroup struct {
	Metadata
	Id   int64  `json:"id"`
	CCRN string `json:"ccrn"`
}

type SupportGroupAggregations

type SupportGroupAggregations struct {
}

type SupportGroupFilter

type SupportGroupFilter struct {
	Paginated
	Id        []*int64  `json:"id"`
	ServiceId []*int64  `json:"service_id"`
	UserId    []*int64  `json:"user_id"`
	CCRN      []*string `json:"ccrn"`
}

type SupportGroupResult

type SupportGroupResult struct {
	WithCursor
	*SupportGroupAggregations
	*SupportGroup
}

type SupportGroupService

type SupportGroupService struct {
	Metadata
	SupportGroupId int64 `json:"support_group_id"`
	ServiceId      int64 `json:"service_id"`
}

type SupportGroupUser

type SupportGroupUser struct {
	Metadata
	SupportGroupId int64 `json:"support_group_id"`
	UserId         int64 `json:"user_id"`
}

type TimeFilter

type TimeFilter struct {
	After  time.Time `json:"after"`
	Before time.Time `json:"before"`
}

type User

type User struct {
	Metadata
	Id           int64    `json:"id"`
	Name         string   `json:"name"`
	UniqueUserID string   `json:"uniqueUserId"`
	Type         UserType `json:"type"`
}

type UserAggregations

type UserAggregations struct {
}

type UserFilter

type UserFilter struct {
	Paginated
	Name           []*string  `json:"name"`
	UniqueUserID   []*string  `json:"uniqueUserId"`
	Type           []UserType `json:"type"`
	Id             []*int64   `json:"id"`
	SupportGroupId []*int64   `json:"support_group_id"`
	ServiceId      []*int64   `json:"service_id"`
}

type UserResult

type UserResult struct {
	WithCursor
	*UserAggregations
	*User
}

type UserType

type UserType int
const (
	InvalidUserType   UserType = 0
	HumanUserType     UserType = 1
	TechnicalUserType UserType = 2
)

func GetUserTypeFromString

func GetUserTypeFromString(uts string) UserType

type WithCursor

type WithCursor struct {
	Value string
}

func (WithCursor) Cursor

func (c WithCursor) Cursor() *string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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