Documentation
¶
Overview ¶
Copyright (C) 2025 l3montree GmbH
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2026 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2025 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2026 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2025 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2025 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Copyright (C) 2026 l3montree GmbH ¶
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func BeautifyFinalLicenseDecision(licenseDecision *string) *string
- func ToCVSS[T ~string](v T) string
- func ValidateConfigFile(content []byte) error
- type AcceptInvitationRequest
- type AdminsInOrg
- type Advisory
- type AdvisoryCreateRequest
- type AdvisoryEventType
- type AdvisoryUpdateRequest
- type Affected
- type AffectedComponent
- type AffectedPackage
- type Artifact
- type ArtifactVulnDistribution
- type Asset
- type AssetChangeRoleRequest
- type AssetCreateRequest
- type AssetDetails
- type AssetDetailsWithSecrets
- type AssetEntry
- type AssetInviteToAssetRequest
- type AssetMetrics
- type AssetPatchRequest
- type AssetVersion
- type AssetVersionEntry
- type AssetVulnDistribution
- type AssetWithSecrets
- type AverageRemediationTimes
- type AverageVulnEventsPerWeek
- type BatchDependencyVulnStatusRequest
- type BatchFirstPartyVulnStatusRequest
- type BuildInfo
- type CVE
- type CVEOccurrence
- type CVERelationship
- type CVEWithRelations
- type CandidatesResponse
- type ComplianceComponent
- type ComplianceComponentDetails
- type ComplianceComponentImplementsControl
- type ComplianceComponentImplementsControlStatement
- type CompliancePosture
- type CompliancePostureStats
- type CompliancePostureWithControl
- type CompliancePostureWithDetails
- type Component
- type ComponentDependency
- type ComponentOccurrence
- type ComponentOccurrenceAcrossInstance
- type ComponentOccurrenceAcrossOrg
- type ComponentProject
- type ComponentType
- type ContentTreeElement
- type CreateEventRequest
- type CreateExternalReferenceRequest
- type CreateInTotoLinkRequest
- type CreateVEXRuleRequest
- type DBStats
- type DatabaseInfo
- type DatabaseSpecifics
- type DeadSimpleSigningEnvelope
- type DependencyProxyConfig
- type DependencyVuln
- type DependencyVulnAggregationState
- type DependencyVulnAggregationStateAndChange
- type DependencyVulnHints
- type DetailedDependencyVuln
- type DetailedDependencyVulnWithRelations
- type DetailedFirstPartyVuln
- type DetailedLicenseRisk
- type DetailsCompliancePosture
- type Distribution
- type EPSS
- type EcosystemSpecific
- type EcosystemUsage
- type Environmental
- type Exploit
- type ExternalReference
- type ExternalReferenceError
- type ExternalReferenceType
- type ExternalSubprojectRequest
- type FirstPartyScanResponse
- type FirstPartyVuln
- type FirstPartyVulnStatusRequest
- type GitRepository
- type GithubAppInstallation
- type GitlabIntegration
- type GitlabOauth2Config
- type History
- type InfoResponse
- type InformationSource
- type InstanceOverview
- type InstanceSettings
- type InstanceUsageStatistics
- type InvitationStatus
- type InviteRequest
- type InvitedUser
- type JiraIntegration
- type LicenseRisk
- type LicenseRiskArtifact
- type Log
- type LogLevel
- type LookupResponse
- type MakeFinalLicenseDecisionRequest
- type MaliciousPackage
- type MaliciousPackageInOrg
- type MappedControl
- type MechanicalJustificationType
- type MemStats
- type ModifiedAttackComplexity
- type ModifiedAttackVector
- type ModifiedPrivilegesRequired
- type ModifiedRequirementLevel
- type ModifiedScope
- type ModifiedUserInteraction
- type OSV
- type OpenSourceInsightsProjectResponse
- type OpenSourceInsightsVersionResponse
- type Org
- type OrgChangeRoleRequest
- type OrgCreateRequest
- type OrgDetails
- type OrgInformation
- type OrgOverview
- type OrgPatchRequest
- type OrgRiskHistory
- type OrgSettings
- type OrgStructureDistribution
- type OrgVulnAverage
- type PAT
- type PATCreateResponse
- type Package
- type PackagistAuthor
- type PackagistDist
- type PackagistPackageResponse
- type PackagistPackageVersion
- type PackagistSecurityAdvisory
- type PackagistSource
- type PackagistSupport
- type PatCreateRequest
- type PermalinkResponse
- type Policy
- type PoolInfo
- type ProcessInfo
- type Project
- type ProjectAsset
- type ProjectChangeRoleRequest
- type ProjectCreateRequest
- type ProjectDetails
- type ProjectExternalEntityTree
- type ProjectInviteRequest
- type ProjectPatchRequest
- type ProjectVulnCountAverageBySeverity
- type ProjectVulnDistribution
- type Range
- type Recommendation
- type Relationship
- type RelationshipType
- type Release
- type ReleaseCreateRequest
- type ReleaseItem
- type ReleasePatchRequest
- type RemediationTimeAverages
- type RemediationTypeDistribution
- type RemediationTypeDistributionRow
- type RequirementLevel
- type RevokeByPrivateKeyRequest
- type RiskCalculationReport
- type RiskHistory
- type RiskHistoryWithVersion
- type RiskMetrics
- type RuntimeInfo
- type ScanResponse
- type Scorecard
- type SemverEvent
- type Severity
- type SnippetContent
- type SnippetContents
- type StringMapField
- type SubProjectEntry
- type TestVEXRulesRequest
- type TokenOwner
- type UpdateAssetRequest
- type UpdateInstanceSettingsRequest
- type User
- type VEXRule
- type VexRuleRecommendation
- type VexRuleRecommendationType
- type VulnEvent
- type VulnEventAverage
- type VulnEventType
- type VulnInPackage
- type VulnSeverityDistribution
- type VulnState
- type VulnType
- type VulnerabilityInReport
- type VulnerabilityReport
- type WebhookCreateRequest
- type WebhookIntegration
- type WebhookTestRequest
- type WebhookUpdateRequest
- type YamlMetadata
- type YamlVars
Constants ¶
const ( LogLevelInfo = "info" LogLevelWarn = "warn" LogLevelError = "error" )
const CannotCalculateRisk float64 = 0
const DependencyProxyConfigFileID = "dependency-proxy-configs"
dependencyProxyConfigFileID is the key under which dependency-proxy settings are stored in an org/project/asset ConfigFiles map.
const SLSACIWorkflowBuildType = "https://devguard.org/slsa/build-types/ci-workflow/v1"
const SLSAProvenanceV1PredicateType = "https://slsa.dev/provenance/v1"
const SLSASelfSignedBuilderID = "https://devguard.org/slsa/builders/self-signed/v1"
SLSASelfSignedBuilderID marks provenance signed with a devguard token instead of by DevGuard - no build platform verified it (SLSA Build L1)
const ScoringMethodDevGuard = "DevGuard"
Variables ¶
var ( ErrCouldNotFindUserWithMail = errors.New("could not find user with the provided mail") ErrCouldNotFindDefinitiveUserWithMail = errors.New("could not find a definitive user with the provided mail") ErrInvalidOrMissingOrgID = errors.New("invalid or missing organization id in path parameters") ErrInvalidOrMissingUserID = errors.New("invalid or missing user id in path parameters") )
var AllowedScopes = []string{"manage", "scan"}
var V = func() *validator.Validate { v := validator.New() v.RegisterValidation("future_max_1y", func(fl validator.FieldLevel) bool { ts := fl.Field().Int() now := time.Now().Unix() return ts > now && ts <= now+31536000 }) return v }()
Functions ¶
func ValidateConfigFile ¶ added in v1.9.1
validateConfigFile validates a config-file payload before it is persisted. Only config files with known schemas are checked; unknown ones pass through.
Types ¶
type AcceptInvitationRequest ¶
type AcceptInvitationRequest struct {
Code string `json:"code" validate:"required,max=256"`
}
type AdminsInOrg ¶ added in v1.6.1
type Advisory ¶ added in v1.17.0
type Advisory struct {
ID uuid.UUID `json:"id"`
Title string `json:"title" validate:"required"`
Description string `json:"description" validate:"required"`
AffectedPackages []AffectedPackage `json:"affectedPackages"`
Severity string `json:"severity"`
VectorString string `json:"vectorString"`
AssetID uuid.UUID `json:"assetID"`
State VulnState `json:"state"`
}
type AdvisoryCreateRequest ¶ added in v1.17.0
type AdvisoryCreateRequest struct {
Title string `json:"title" validate:"required,max=256"`
Description string `json:"description" validate:"required,max=4000"`
AffectedPackages []AffectedPackage `json:"affectedPackages"`
Severity string `json:"severity" validate:"max=256"`
VectorString string `json:"vectorString" validate:"max=256"`
AssetID uuid.UUID `json:"assetID"`
}
type AdvisoryEventType ¶ added in v1.10.0
type AdvisoryEventType string
const ( AdvisoryEventTypeCreated AdvisoryEventType = "created" AdvisoryEventTypeUpdated AdvisoryEventType = "updated" AdvisoryEventTypePublished AdvisoryEventType = "published" AdvisoryEventTypeWithdrawn AdvisoryEventType = "withdrawn" )
type AdvisoryUpdateRequest ¶ added in v1.17.0
type AdvisoryUpdateRequest struct {
Title *string `json:"title" validate:"omitempty,max=256"`
Description *string `json:"description" validate:"omitempty,max=4000"`
AffectedPackages []AffectedPackage `json:"affectedPackages"`
Severity *string `json:"severity" validate:"omitempty,max=256"`
VectorString *string `json:"vectorString" validate:"omitempty,max=256"`
AssetID *uuid.UUID `json:"assetID"`
}
type Affected ¶
type Affected struct {
Package Package `json:"package"`
Ranges []Range `json:"ranges"`
Versions []string `json:"versions"`
EcosystemSpecific *EcosystemSpecific `json:"ecosystem_specific"`
}
type AffectedComponent ¶ added in v1.17.0
type AffectedComponent struct {
ID int64 `json:"id"`
PurlWithoutVersion string `json:"purl"`
Ecosystem string `json:"ecosystem"`
Version *string `json:"version"`
SemverIntroduced *string `json:"semverStart"`
SemverFixed *string `json:"semverEnd"`
VersionIntroduced *string `json:"versionIntroduced"`
VersionFixed *string `json:"versionFixed"`
CVEs []CVE `json:"cves"`
}
type AffectedPackage ¶ added in v1.10.0
type Artifact ¶ added in v1.17.0
type Artifact struct {
ArtifactName string `json:"artifactName"`
AssetVersionName string `json:"assetVersionName"`
AssetID uuid.UUID `json:"assetId"`
}
Artifact is a trimmed artifact view returned to clients. It includes the asset's name.
type ArtifactVulnDistribution ¶ added in v1.6.1
type ArtifactVulnDistribution struct {
Name string `json:"name" gorm:"column:name"`
ProjectSlug string `json:"projectSlug" gorm:"column:project_slug"`
AssetSlug string `json:"assetSlug" gorm:"column:asset_slug"`
AssetVersionName string `json:"assetVersionName" gorm:"column:asset_version_name"`
VulnSeverityDistribution
}
type Asset ¶ added in v1.17.0
type Asset struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Avatar *string `json:"avatar,omitempty"`
Slug string `json:"slug"`
Description string `json:"description"`
ProjectID uuid.UUID `json:"projectId"`
Environmental
RepositoryID *string `json:"repositoryId"`
RepositoryName *string `json:"repositoryName"`
SigningPubKey *string `json:"signingPubKey"`
EnableTicketRange bool `json:"enableTicketRange"`
CVSSAutomaticTicketThreshold *float64 `json:"cvssAutomaticTicketThreshold"`
RiskAutomaticTicketThreshold *float64 `json:"riskAutomaticTicketThreshold"`
AssetVersions []AssetVersion `json:"refs"`
ExternalEntityProviderID *string `json:"externalEntityProviderId,omitempty"`
ExternalEntityID *string `json:"externalEntityId,omitempty"`
ExternalBotUserLink *string `json:"externalBotUserLink,omitempty"`
RepositoryProvider *string `json:"repositoryProvider,omitempty"`
IsPublic bool `json:"isPublic"`
ParanoidMode bool `json:"paranoidMode"`
CentralDependencyVulnManagement bool `json:"centralDependencyVulnManagement"`
State string `json:"state"`
}
type AssetChangeRoleRequest ¶
type AssetChangeRoleRequest struct {
Role string `json:"role" validate:"required,oneof=member admin"`
}
type AssetCreateRequest ¶
type AssetCreateRequest struct {
Name string `json:"name" validate:"required,max=256"`
Description string `json:"description" validate:"max=4000"`
CVSSAutomaticTicketThreshold *float64 `json:"cvssAutomaticTicketThreshold"`
RiskAutomaticTicketThreshold *float64 `json:"riskAutomaticTicketThreshold"`
EnableTicketRange bool `json:"enableTicketRange"`
CentralDependencyVulnManagement bool `json:"centralDependencyVulnManagement"`
Importance int `json:"importance"`
ConfidentialityRequirement RequirementLevel `json:"confidentialityRequirement" validate:"required,oneof=low medium high"`
IntegrityRequirement RequirementLevel `json:"integrityRequirement" validate:"required,oneof=low medium high"`
AvailabilityRequirement RequirementLevel `json:"availabilityRequirement" validate:"required,oneof=low medium high"`
ModifiedAttackVector ModifiedAttackVector `json:"modifiedAttackVector" validate:"omitempty,oneof=X network adjacent local physical"`
ModifiedAttackComplexity ModifiedAttackComplexity `json:"modifiedAttackComplexity" validate:"omitempty,oneof=X low high"`
ModifiedPrivilegesRequired ModifiedPrivilegesRequired `json:"modifiedPrivilegesRequired" validate:"omitempty,oneof=X none low high"`
ModifiedScope ModifiedScope `json:"modifiedScope" validate:"omitempty,oneof=X unchanged changed"`
ModifiedUserInteraction ModifiedUserInteraction `json:"modifiedUserInteraction" validate:"omitempty,oneof=X none required"`
ModifiedConfidentiality ModifiedRequirementLevel `json:"modifiedConfidentiality" validate:"omitempty,oneof=X none low high"`
ModifiedIntegrity ModifiedRequirementLevel `json:"modifiedIntegrity" validate:"omitempty,oneof=X none low high"`
ModifiedAvailability ModifiedRequirementLevel `json:"modifiedAvailability" validate:"omitempty,oneof=X none low high"`
RepositoryProvider *string `json:"repositoryProvider" validate:"omitempty,oneof=github gitlab"` // either null or github or gitlab, etc.
}
type AssetDetails ¶ added in v1.17.0
type AssetDetailsWithSecrets ¶ added in v1.17.0
type AssetDetailsWithSecrets struct {
AssetWithSecrets
Members []User `json:"members"`
}
type AssetEntry ¶ added in v1.17.0
type AssetEntry struct {
AssetExternalEntityID string `json:"assetExternalEntityId"`
AssetName string `json:"assetName"`
AssetVersions []AssetVersionEntry `json:"assetVersions"`
}
type AssetInviteToAssetRequest ¶
type AssetInviteToAssetRequest struct {
Ids []string `json:"ids" validate:"required,max=100,dive,max=256"`
}
type AssetMetrics ¶
type AssetPatchRequest ¶
type AssetPatchRequest struct {
Name *string `json:"name" validate:"omitempty,max=256"`
Description *string `json:"description" validate:"omitempty,max=4000"`
CVSSAutomaticTicketThreshold *float64 `json:"cvssAutomaticTicketThreshold"`
RiskAutomaticTicketThreshold *float64 `json:"riskAutomaticTicketThreshold"`
EnableTicketRange *bool `json:"enableTicketRange"`
CentralDependencyVulnManagement *bool `json:"centralDependencyVulnManagement"`
ConfidentialityRequirement *RequirementLevel `json:"confidentialityRequirement" validate:"omitempty,oneof=low medium high"`
IntegrityRequirement *RequirementLevel `json:"integrityRequirement" validate:"omitempty,oneof=low medium high"`
AvailabilityRequirement *RequirementLevel `json:"availabilityRequirement" validate:"omitempty,oneof=low medium high"`
ModifiedAttackVector *ModifiedAttackVector `json:"modifiedAttackVector" validate:"omitempty,oneof=X network adjacent local physical"`
ModifiedAttackComplexity *ModifiedAttackComplexity `json:"modifiedAttackComplexity" validate:"omitempty,oneof=X low high"`
ModifiedPrivilegesRequired *ModifiedPrivilegesRequired `json:"modifiedPrivilegesRequired" validate:"omitempty,oneof=X none low high"`
ModifiedScope *ModifiedScope `json:"modifiedScope" validate:"omitempty,oneof=X unchanged changed"`
ModifiedUserInteraction *ModifiedUserInteraction `json:"modifiedUserInteraction" validate:"omitempty,oneof=X none required"`
ModifiedConfidentiality *ModifiedRequirementLevel `json:"modifiedConfidentiality" validate:"omitempty,oneof=X none low high"`
ModifiedIntegrity *ModifiedRequirementLevel `json:"modifiedIntegrity" validate:"omitempty,oneof=X none low high"`
ModifiedAvailability *ModifiedRequirementLevel `json:"modifiedAvailability" validate:"omitempty,oneof=X none low high"`
RepositoryID *string `json:"repositoryId" validate:"omitempty,max=256"`
RepositoryName *string `json:"repositoryName" validate:"omitempty,max=256"`
ConfigFiles *map[string]any `json:"configFiles"`
WebhookSecret *string `json:"webhookSecret" validate:"omitempty,max=1024"`
RepositoryProvider *string `json:"repositoryProvider" validate:"omitempty,oneof=github gitlab"` // either null or github or gitlab, etc.
IsPublic *bool `json:"isPublic"`
ParanoidMode *bool `json:"paranoidMode"`
}
type AssetVersion ¶ added in v1.17.0
type AssetVersion struct {
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
Name string `json:"name"`
AssetID string `json:"assetId"`
DefaultBranch bool `json:"defaultBranch"`
Slug string `json:"slug"`
Type string `json:"type"`
SigningPubKey *string `json:"signingPubKey,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
LastAccessedAt string `json:"lastAccessedAt,omitempty"`
}
type AssetVersionEntry ¶ added in v1.17.0
type AssetVulnDistribution ¶ added in v1.6.1
type AssetVulnDistribution struct {
Name string `json:"name" gorm:"column:asset_name"`
ProjectSlug string `json:"projectSlug" gorm:"column:project_slug"`
Slug string `json:"slug" gorm:"column:asset_slug"`
VulnSeverityDistribution
}
type AssetWithSecrets ¶ added in v1.17.0
type AverageRemediationTimes ¶ added in v1.1.0
type AverageRemediationTimes struct {
// average time until vulns are remediated
LowRiskRemediated float64 `json:"lowRiskRemediated" gorm:"column:low_risk_remediated"`
MediumRiskRemediated float64 `json:"mediumRiskRemediated" gorm:"column:medium_risk_remediated"`
HighRiskRemediated float64 `json:"highRiskRemediated" gorm:"column:high_risk_remediated"`
CriticalRiskRemediated float64 `json:"criticalRiskRemediated" gorm:"column:critical_risk_remediated"`
LowCVSSRemediated float64 `json:"lowCVSSRemediated" gorm:"column:low_cvss_remediated"`
MediumCVSSRemediated float64 `json:"mediumCVSSRemediated" gorm:"column:medium_cvss_remediated"`
HighCVSSRemediated float64 `json:"highCVSSRemediated" gorm:"column:high_cvss_remediated"`
CriticalCVSSRemediated float64 `json:"criticalCVSSRemediated" gorm:"column:critical_cvss_remediated"`
// average age of non remediated (open) vulns
LowRiskOpen float64 `json:"lowRiskOpen" gorm:"column:low_risk_open"`
MediumRiskOpen float64 `json:"mediumRiskOpen" gorm:"column:medium_risk_open"`
HighRiskOpen float64 `json:"highRiskOpen" gorm:"column:high_risk_open"`
CriticalRiskOpen float64 `json:"criticalRiskOpen" gorm:"column:critical_risk_open"`
LowCVSSOpen float64 `json:"lowCVSSOpen" gorm:"column:low_cvss_open"`
MediumCVSSOpen float64 `json:"mediumCVSSOpen" gorm:"column:medium_cvss_open"`
HighCVSSOpen float64 `json:"highCVSSOpen" gorm:"column:high_cvss_open"`
CriticalCVSSOpen float64 `json:"criticalCVSSOpen" gorm:"column:critical_cvss_open"`
}
average remediation times for remediated vulns in org as well as the average age of all non remediated ('open') vulns
type AverageVulnEventsPerWeek ¶ added in v1.1.0
type AverageVulnEventsPerWeek struct {
AverageDetectedEvents float32 `json:"averageDetectedEvents"`
AverageReopenedEvents float32 `json:"averageReopenedEvents"`
AverageFalsePositiveEvents float32 `json:"averageFalsePositiveEvents"`
AverageAcceptedEvents float32 `json:"averageAcceptedEvents"`
AverageFixedEvents float32 `json:"averageFixedEvents"`
}
type BatchDependencyVulnStatusRequest ¶ added in v1.17.0
type BatchDependencyVulnStatusRequest struct {
VulnIDs []uuid.UUID `json:"vulnIds"`
StatusType string `json:"status" validate:"max=256"`
Justification string `json:"justification" validate:"max=4000"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
}
type BatchFirstPartyVulnStatusRequest ¶ added in v1.17.0
type BatchFirstPartyVulnStatusRequest struct {
VulnIDs []uuid.UUID `json:"vulnIds"`
StatusType string `json:"status" validate:"max=256"`
Justification string `json:"justification" validate:"max=4000"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
}
type CVE ¶ added in v1.17.0
type CVE struct {
CVE string `json:"cve"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DatePublished time.Time `json:"datePublished"`
DateLastModified time.Time `json:"dateLastModified"`
Description string `json:"description"`
CVSS float32 `json:"cvss"`
References string `json:"references"`
CISAExploitAdd *datatypes.Date `json:"cisaExploitAdd" swaggertype:"string" format:"date"`
CISAActionDue *datatypes.Date `json:"cisaActionDue" swaggertype:"string" format:"date"`
CISARequiredAction *string `json:"cisaRequiredAction"`
CISAVulnerabilityName *string `json:"cisaVulnerabilityName"`
EPSS *float64 `json:"epss"`
Percentile *float32 `json:"percentile"`
Vector string `json:"vector"`
Risk RiskMetrics `json:"risk"`
Exploits []Exploit `json:"exploits"`
Relationships []Relationship `json:"relationships"`
EUVDExploitAdd *datatypes.Date `json:"euvdExploitAdd" format:"date"`
AffectedComponents []AffectedComponent `json:"affectedComponents"`
Withdrawn *datatypes.Date `json:"withdrawn"`
CWEs []string `json:"cwes"`
}
type CVEOccurrence ¶ added in v1.6.1
type CVERelationship ¶ added in v1.17.0
type CVERelationship struct {
SourceCVE string `json:"source_cve"`
TargetCVEID string `json:"target_cve"`
RelationshipType RelationshipType `json:"relationship_type"`
TargetCVE *CVE `json:"target_cve_data,omitempty"`
}
CVERelationship is the API response shape. TargetCVE is the resolved CVE when the target exists in our database, nil otherwise.
type CVEWithRelations ¶ added in v1.17.0
type CVEWithRelations struct {
CVE
Related map[RelationshipType][]CVE `json:"related"`
}
type CandidatesResponse ¶ added in v1.17.0
type ComplianceComponent ¶ added in v1.17.0
type ComplianceComponentDetails ¶ added in v1.17.0
type ComplianceComponentDetails struct {
ComplianceComponent
ImplementedControls []ComplianceComponentImplementsControl `json:"implementedControls"`
}
type ComplianceComponentImplementsControl ¶ added in v1.17.0
type ComplianceComponentImplementsControl struct {
FrameworkControlID string `json:"frameworkControlId"`
ComplianceComponentID string `json:"complianceComponentId"`
ComplianceComponentTitle string `json:"complianceComponentTitle"`
Description string `json:"description"`
}
ComplianceComponentImplementsControl is a component's catalog-level claim that it implements a given control (models.ComplianceComponentImplementsControl).
type ComplianceComponentImplementsControlStatement ¶ added in v1.17.0
type ComplianceComponentImplementsControlStatement struct {
ID string `json:"id"`
CompliancePostureID string `json:"compliancePostureId"`
ComplianceComponentID string `json:"complianceComponentId"`
ComplianceComponentTitle string `json:"complianceComponentTitle"`
ComplianceComponentDescription string `json:"complianceComponentDescription"`
FrameworkControlID string `json:"frameworkControlId"`
ImplementationStatus string `json:"implementationStatus"`
Description string `json:"description"`
}
type CompliancePosture ¶ added in v1.17.0
type CompliancePosture struct {
ControlID string `json:"controlId"`
ControlTitle string `json:"controlTitle"`
ControlDescription string `json:"controlDescription"`
TicketID *string `json:"ticketId"`
TicketURL *string `json:"ticketUrl"`
ManualTicketCreation bool `json:"manualTicketCreation"`
AssetID string `json:"assetId"`
ProjectID string `json:"projectId"`
OrgID string `json:"orgId"`
State string `json:"state"`
}
type CompliancePostureStats ¶ added in v1.17.0
type CompliancePostureWithControl ¶ added in v1.17.0
type CompliancePostureWithControl struct {
FrameworkControlID string `json:"frameworkControlId"`
Framework string `json:"framework"`
ControlID string `json:"controlId"`
Title string `json:"title"`
Description string `json:"description"`
Importance string `json:"importance"`
SecurityLevel string `json:"securityLevel"`
Class string `json:"class"`
Additional datatypes.JSON `json:"additional" swaggertype:"object"`
ParentFrameworkControlID *string `json:"parentFrameworkControlId"`
CompliancePostureID string `json:"compliancePostureId"`
State VulnState `json:"state"`
OrgID *uuid.UUID `json:"orgId"`
ProjectID *uuid.UUID `json:"projectId"`
AssetID *uuid.UUID `json:"assetId"`
AssetVersionName *string `json:"assetVersionName"`
TicketID *string `json:"ticketId"`
TicketURL *string `json:"ticketUrl"`
MappedControls []MappedControl `json:"mappedControls"`
}
type CompliancePostureWithDetails ¶ added in v1.17.0
type CompliancePostureWithDetails struct {
CompliancePostureWithControl
Events []VulnEvent `json:"events"`
ByComponents []ComplianceComponentImplementsControlStatement `json:"byComponents"`
}
type Component ¶ added in v1.17.0
type Component struct {
Purl string `json:"purl" gorm:"primaryKey;column:purl"` // without qualifiers!
Dependencies []ComponentDependency `json:"dependsOn" gorm:"hasMany;"`
ComponentType ComponentType `json:"componentType"`
Version string `json:"version"`
License *string `json:"license"`
Published *time.Time `json:"published"`
ComponentProject *ComponentProject `json:"project" gorm:"foreignKey:ComponentProjectKey;references:ProjectKey;constraint:OnDelete:CASCADE;"`
ComponentProjectKey *string `json:"projectId" gorm:"column:project_key"`
IsLicenseOverwritten bool `json:"isLicenseOverwritten" gorm:"-"`
}
type ComponentDependency ¶ added in v1.17.0
type ComponentDependency struct {
ID uuid.UUID `json:"id"`
ComponentPurl string `json:"componentPurl"`
// the provided sbom from cyclondx only contains the transitive dependencies, which do really get used
// this means, that the dependency graph between people using the same library might differ, since they use it differently
// we use edges, which provide the information, that a component is used by another component in one asset
DependencyPurl string `json:"dependencyPurl"` // will be nil, for direct dependencies
Artifacts []Artifact `json:"artifacts"`
Component Component `json:"component"`
Dependency Component `json:"dependency"`
}
type ComponentOccurrence ¶ added in v1.17.0
type ComponentOccurrence struct {
ComponentDependencyID string `json:"componentDependencyId"`
DependencyPurl *string `json:"dependencyPurl"`
OrganizationID string `json:"organizationId"`
OrganizationName string `json:"organizationName"`
ProjectID string `json:"projectId"`
ProjectName string `json:"projectName"`
ProjectSlug string `json:"projectSlug"`
AssetID string `json:"assetId"`
AssetName string `json:"assetName"`
AssetSlug string `json:"assetSlug"`
AssetVersionName string `json:"assetVersionName"`
ComponentPurl *string `json:"componentPurl"`
ComponentVersion *string `json:"componentVersion"`
ArtifactName *string `json:"artifactName"`
ArtifactAssetVersion *string `json:"artifactAssetVersion"`
AssetVersionSlug string `json:"assetVersionSlug"`
}
type ComponentOccurrenceAcrossInstance ¶ added in v1.6.1
type ComponentOccurrenceAcrossOrg ¶ added in v1.6.1
type ComponentProject ¶ added in v1.17.0
type ComponentProject struct {
// project name like "github.com/facebook/react"
ProjectKey string `json:"projectKey" gorm:"primaryKey;column:project_key"`
StarsCount int `json:"starsCount" gorm:"column:stars_count"`
ForksCount int `json:"forksCount" gorm:"column:forks_count"`
OpenIssuesCount int `json:"openIssuesCount" gorm:"column:open_issues_count"`
Homepage string `json:"homepage"`
License string `json:"license"`
Description string `json:"description"`
ScoreCard map[string]any `json:"scoreCard"`
ScoreCardScore *float64 `json:"scoreCardScore" gorm:"column:score_card_score"`
UpdatedAt time.Time `json:"updatedAt" gorm:"column:updated_at"`
}
type ComponentType ¶
type ComponentType string
const ( ComponentTypeApplication ComponentType = "application" ComponentTypeContainer ComponentType = "container" ComponentTypeData ComponentType = "data" ComponentTypeDevice ComponentType = "device" ComponentTypeDeviceDriver ComponentType = "device-driver" ComponentTypeFile ComponentType = "file" ComponentTypeFirmware ComponentType = "firmware" ComponentTypeFramework ComponentType = "framework" ComponentTypeLibrary ComponentType = "library" ComponentTypeMachineLearningModel ComponentType = "machine-learning-model" ComponentTypeOS ComponentType = "operating-system" ComponentTypePlatform ComponentType = "platform" )
type ContentTreeElement ¶
type CreateEventRequest ¶ added in v1.12.5
type CreateEventRequest struct {
StatusType string `json:"status" validate:"max=256"`
Justification string `json:"justification" validate:"max=4000"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
}
type CreateExternalReferenceRequest ¶ added in v1.9.0
type CreateExternalReferenceRequest struct {
URL string `json:"url" validate:"required,url,max=2048"`
Type ExternalReferenceType `json:"type" validate:"required,oneof=cyclonedx csaf openvex"`
CSAFPackageScope string `json:"csafPackageScope" validate:"max=2048"` // only relevant for csaf references - NEEDS TO BE A VALID PURL
}
type CreateInTotoLinkRequest ¶
type CreateInTotoLinkRequest struct {
SupplyChainID string `json:"supplyChainId" validate:"required,max=256"`
Step string `json:"step" validate:"required,max=256"`
Payload string `json:"payload" validate:"required,max=1048576"`
Filename string `json:"filename" validate:"required,max=256"`
SupplyChainOutputDigest string `json:"supplyChainOutputDigest" validate:"max=256"`
}
type CreateVEXRuleRequest ¶ added in v1.12.0
type CreateVEXRuleRequest struct {
Title string `json:"title" validate:"max=256"`
Justification string `json:"justification" validate:"required,max=4000"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
CELExpression string `json:"celExpression" validate:"required,max=4000"`
EventType VulnEventType `json:"eventType" validate:"required,oneof=accepted falsePositive reopened"`
WasRecommended bool `json:"wasRecommended"`
}
type DBStats ¶ added in v1.12.5
type DBStats struct {
MaxOpenConnections int `json:"maxOpenConnections,omitempty"`
OpenConnections int `json:"openConnections,omitempty"`
InUse int `json:"inUse,omitempty"`
Idle int `json:"idle,omitempty"`
WaitCount int64 `json:"waitCount,omitempty"`
WaitDuration time.Duration `json:"waitDuration,omitempty"`
MaxIdleClosed int64 `json:"maxIdleClosed,omitempty"`
MaxIdleTimeClosed int64 `json:"maxIdleTimeClosed,omitempty"`
MaxLifetimeClosed int64 `json:"maxLifetimeClosed,omitempty"`
}
type DatabaseInfo ¶ added in v1.12.5
type DatabaseInfo struct {
DBStats
Status string `json:"status"`
Error *string `json:"error,omitempty"`
MigrationVersion *uint `json:"migrationVersion,omitempty"`
MigrationDirty *bool `json:"migrationDirty,omitempty"`
MigrationError *string `json:"migrationError,omitempty"`
VulnDBVersion *string `json:"vulndbVersion,omitempty"`
Pool *PoolInfo `json:"pool,omitempty"`
}
type DatabaseSpecifics ¶ added in v1.13.1
type DatabaseSpecifics struct {
CWEs []string `json:"cwe_ids"` // array of cwe ids associated with this vulnerability
}
can include a lot of custom attributes but we are only interested in the cwes field
type DependencyProxyConfig ¶ added in v1.9.1
type DependencyProxyConfig struct {
Rules string `json:"rules"`
MinReleaseAge int `json:"minReleaseAge" validate:"gte=0,lte=87600"` // in hours, capped at 10 years
Registries map[string]string `json:"registries" validate:"omitempty,dive,keys,oneof=npm go pypi maven composer deb,endkeys,required,url"`
}
DependencyProxyConfig is the config-file payload persisted for the dependency proxy.
type DependencyVuln ¶ added in v1.17.0
type DependencyVuln struct {
ID uuid.UUID `json:"id"`
AssetVersionName string `json:"assetVersionId"`
AssetID string `json:"assetId"`
State VulnState `json:"state"`
CVE *CVE `json:"cve"`
CVEID string `json:"cveID"`
ComponentPurl string `json:"componentPurl"`
ComponentFixedVersion *string `json:"componentFixedVersion"`
VulnerabilityPath []string `json:"vulnerabilityPath"`
DirectDependencyFixedVersion *string `json:"directDependencyFixedVersion"`
RiskAssessment *float64 `json:"riskAssessment"`
LastStateChange time.Time `json:"lastStateChange"`
CreatedAt time.Time `json:"createdAt"`
TicketID *string `json:"ticketId"`
TicketURL *string `json:"ticketUrl"`
ManualTicketCreation bool `json:"manualTicketCreation"`
Artifacts []Artifact `json:"artifacts"`
Exploits []Exploit `json:"exploits"`
RiskRecalculatedAt time.Time `json:"riskRecalculatedAt"`
Signature int64 `json:"signature,string"`
AssetSignature int64 `json:"assetSignature,string"`
}
func (DependencyVuln) GetCVE ¶ added in v1.17.0
func (d DependencyVuln) GetCVE() CVE
type DependencyVulnAggregationStateAndChange ¶
type DependencyVulnAggregationStateAndChange struct {
Now DependencyVulnAggregationState `json:"now"`
Was DependencyVulnAggregationState `json:"was"`
}
type DependencyVulnHints ¶
type DependencyVulnHints struct {
AmountOpen int `json:"amountOpen"`
AmountFixed int `json:"amountFixed"`
AmountAccepted int `json:"amountAccepted"`
AmountFalsePositive int `json:"amountFalsePositive"`
AmountMarkedForTransfer int `json:"amountMarkedForTransfer"`
}
used to return information about other instances of a dependency vuln in other parts of an organization
type DetailedDependencyVuln ¶ added in v1.17.0
type DetailedDependencyVuln struct {
DependencyVuln
Events []VulnEvent `json:"events"`
}
type DetailedDependencyVulnWithRelations ¶ added in v1.17.0
type DetailedDependencyVulnWithRelations struct {
DetailedDependencyVuln
Related map[RelationshipType][]CVE `json:"related"`
}
type DetailedFirstPartyVuln ¶ added in v1.17.0
type DetailedFirstPartyVuln struct {
FirstPartyVuln
Events []VulnEvent `json:"events"`
}
type DetailedLicenseRisk ¶ added in v1.17.0
type DetailedLicenseRisk struct {
LicenseRisk
Events []VulnEvent `json:"events"`
}
type DetailsCompliancePosture ¶ added in v1.17.0
type DetailsCompliancePosture struct {
CompliancePosture
Events []VulnEvent `json:"events"`
}
type Distribution ¶
type Distribution struct {
Low int `json:"low"`
High int `json:"high"`
Medium int `json:"medium"`
Critical int `json:"critical"`
FixableLow int `json:"fixableLow"`
FixableMedium int `json:"fixableMedium"`
FixableHigh int `json:"fixableHigh"`
FixableCritical int `json:"fixableCritical"`
LowCVSS int `json:"lowCvss"`
MediumCVSS int `json:"mediumCvss"`
HighCVSS int `json:"highCvss"`
CriticalCVSS int `json:"criticalCvss"`
FixableLowCVSS int `json:"fixableLowCvss"`
FixableMediumCVSS int `json:"fixableMediumCvss"`
FixableHighCVSS int `json:"fixableHighCvss"`
FixableCriticalCVSS int `json:"fixableCriticalCvss"`
CVEPurlLow int `json:"cvePurlLow"`
CVEPurlMedium int `json:"cvePurlMedium"`
CVEPurlHigh int `json:"cvePurlHigh"`
CVEPurlCritical int `json:"cvePurlCritical"`
CVEPurlFixableLow int `json:"cvePurlFixableLow"`
CVEPurlFixableMedium int `json:"cvePurlFixableMedium"`
CVEPurlFixableHigh int `json:"cvePurlFixableHigh"`
CVEPurlFixableCritical int `json:"cvePurlFixableCritical"`
CVEPurlLowCVSS int `json:"cvePurlLowCvss"`
CVEPurlMediumCVSS int `json:"cvePurlMediumCvss"`
CVEPurlHighCVSS int `json:"cvePurlHighCvss"`
CVEPurlCriticalCVSS int `json:"cvePurlCriticalCvss"`
CVEPurlFixableLowCVSS int `json:"cvePurlFixableLowCvss"`
CVEPurlFixableMediumCVSS int `json:"cvePurlFixableMediumCvss"`
CVEPurlFixableHighCVSS int `json:"cvePurlFixableHighCvss"`
CVEPurlFixableCriticalCVSS int `json:"cvePurlFixableCriticalCvss"`
}
type EcosystemSpecific ¶
type EcosystemSpecific struct {
Urgency string `json:"urgency,omitempty"`
}
type EcosystemUsage ¶ added in v1.1.0
type Environmental ¶ added in v1.13.0
type Environmental struct {
ConfidentialityRequirement RequirementLevel `json:"confidentialityRequirement" gorm:"default:'high';not null;type:text;"`
IntegrityRequirement RequirementLevel `json:"integrityRequirement" gorm:"default:'high';not null;type:text;"`
AvailabilityRequirement RequirementLevel `json:"availabilityRequirement" gorm:"default:'high';not null;type:text;"`
ModifiedAttackVector ModifiedAttackVector `json:"modifiedAttackVector" gorm:"default:'X';type:text;"`
ModifiedAttackComplexity ModifiedAttackComplexity `json:"modifiedAttackComplexity" gorm:"default:'X';type:text;"`
ModifiedPrivilegesRequired ModifiedPrivilegesRequired `json:"modifiedPrivilegesRequired" gorm:"default:'X';type:text;"`
ModifiedScope ModifiedScope `json:"modifiedScope" gorm:"default:'X';type:text;"`
ModifiedUserInteraction ModifiedUserInteraction `json:"modifiedUserInteraction" gorm:"default:'X';type:text;"`
ModifiedConfidentiality ModifiedRequirementLevel `json:"modifiedConfidentiality" gorm:"default:'X';type:text;"`
ModifiedIntegrity ModifiedRequirementLevel `json:"modifiedIntegrity" gorm:"default:'X';type:text;"`
ModifiedAvailability ModifiedRequirementLevel `json:"modifiedAvailability" gorm:"default:'X';type:text;"`
}
type Exploit ¶ added in v1.17.0
type Exploit struct {
ID string `json:"id"`
Published *time.Time `json:"pushed_at"`
Updated *time.Time `json:"updated_at"`
Author string `json:"author"`
Type string `json:"type"`
Verified bool `json:"verified"`
SourceURL string `json:"sourceURL"`
Description string `json:"description"`
CVEID string `json:"cveID"`
Tags string `json:"tags"`
Forks int `json:"forks"`
Watchers int `json:"watchers"`
Subscribers int `json:"subscribers_count"`
Stars int `json:"stargazers_count"`
}
type ExternalReference ¶ added in v1.17.0
type ExternalReference struct {
AssetID string `json:"assetId"`
URL string `json:"url"`
VexRuleCount int `json:"vexRuleCount"`
Type ExternalReferenceType `json:"type"`
Error *string `json:"error,omitempty"` // optional error message if the reference could not be processed
}
type ExternalReferenceError ¶
type ExternalReferenceType ¶ added in v1.9.0
type ExternalReferenceType string
const ( ExternalReferenceTypeCycloneDX ExternalReferenceType = "cyclonedx" ExternalReferenceTypeCSAF ExternalReferenceType = "csaf" ExternalReferenceTypeOpenVEX ExternalReferenceType = "openvex" ExternalReferenceTypeUnknown ExternalReferenceType = "unknown" )
type ExternalSubprojectRequest ¶ added in v1.17.0
type ExternalSubprojectRequest struct {
Verb string `json:"verb" validate:"required,oneof=update delete"`
ProjectExternalEntityID string `json:"projectExternalEntityId" validate:"required,max=256"`
ProjectName string `json:"projectName" validate:"max=256"`
ProjectDescription string `json:"projectDescription" validate:"max=4000"`
SubProjectExternalEntityID string `json:"subProjectExternalEntityId,omitempty" validate:"max=256"`
SubProjectName string `json:"subProjectName,omitempty" validate:"max=256"`
SubProjectDescription string `json:"subProjectDescription,omitempty" validate:"max=4000"`
AssetExternalEntityID string `json:"assetExternalEntityId" validate:"required,max=256"`
AssetName string `json:"assetName" validate:"max=256"`
AssetDescription string `json:"assetDescription" validate:"max=4000"`
AssetVersionName string `json:"assetVersionName" validate:"max=256"`
Artifact string `json:"artifact" validate:"max=256"`
Sbom json.RawMessage `json:"sbom,omitempty"`
}
type FirstPartyScanResponse ¶
type FirstPartyScanResponse struct {
AmountOpened int `json:"amountOpened"`
AmountClosed int `json:"amountClosed"`
FirstPartyVulns []FirstPartyVuln `json:"firstPartyVulns"`
}
type FirstPartyVuln ¶ added in v1.17.0
type FirstPartyVuln struct {
ID uuid.UUID `json:"id"`
ScannerIDs string `json:"scannerIds"`
Message *string `json:"message"`
AssetVersionName string `json:"assetVersionName"`
AssetID string `json:"assetId"`
State VulnState `json:"state"`
RuleID string `json:"ruleId"`
URI string `json:"uri"`
SnippetContents []SnippetContent `json:"snippetContents"`
CreatedAt time.Time `json:"createdAt"`
TicketID *string `json:"ticketId"`
TicketURL *string `json:"ticketUrl"`
ManualTicketCreation bool `json:"manualTicketCreation"`
Commit string `json:"commit"`
Email string `json:"email"`
Author string `json:"author"`
Date string `json:"date"`
RuleName string `json:"ruleName"`
RuleHelp string `json:"ruleHelp"`
RuleHelpURI string `json:"ruleHelpURI"`
RuleDescription string `json:"ruleDescription"`
RuleProperties map[string]any `json:"ruleProperties"`
}
type FirstPartyVulnStatusRequest ¶ added in v1.17.0
type FirstPartyVulnStatusRequest struct {
StatusType string `json:"status" validate:"max=256"`
Justification string `json:"justification" validate:"max=4000"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
}
type GitRepository ¶
type GithubAppInstallation ¶ added in v1.17.0
type GithubAppInstallation struct {
InstallationID int `json:"installationId"`
OrgID uuid.UUID
InstallationCreatedWebhookReceivedTime time.Time `json:"installationCreatedWebhookReceivedTime"`
SettingsURL string `json:"settingsUrl"`
TargetType string `json:"targetType"`
TargetLogin string `json:"targetLogin"`
TargetAvatarURL string `json:"targetAvatarUrl"`
}
type GitlabIntegration ¶ added in v1.17.0
type GitlabOauth2Config ¶ added in v1.17.0
type History ¶
type History struct {
Distribution
// on the day 2024-08-12 the asset had a sumRisk of 25.
Day time.Time `json:"day" gorm:"primaryKey;type:date"`
SumOpenRisk float64 `json:"sumOpenRisk"`
AvgOpenRisk float64 `json:"averageOpenRisk"`
MaxOpenRisk float64 `json:"maxOpenRisk"`
MinOpenRisk float64 `json:"minOpenRisk"`
SumClosedRisk float64 `json:"sumClosedRisk"`
AvgClosedRisk float64 `json:"averageClosedRisk"`
MaxClosedRisk float64 `json:"maxClosedRisk"`
MinClosedRisk float64 `json:"minClosedRisk"`
OpenDependencyVulns int `json:"openDependencyVulns"`
FixedDependencyVulns int `json:"fixedDependencyVulns"`
}
type InfoResponse ¶ added in v1.12.5
type InfoResponse struct {
Build BuildInfo `json:"build"`
Process ProcessInfo `json:"process"`
Runtime RuntimeInfo `json:"runtime"`
Database DatabaseInfo `json:"database"`
}
type InformationSource ¶ added in v1.17.0
type InstanceOverview ¶ added in v1.6.1
type InstanceOverview struct {
TopCVEs []CVEOccurrence `json:"topCVEs"`
TopComponents []ComponentOccurrenceAcrossInstance `json:"topComponents"`
MaliciousPackages []MaliciousPackage `json:"maliciousPackages"`
AverageOpenCodeRisks float32 `json:"averageOpenCodeRisks"`
TopVulnerableProjects []ProjectVulnDistribution `json:"topVulnerableProjects"`
AverageOpenVulnsPerOrg OrgVulnAverage `json:"averageOpenVulnsPerOrg"`
}
type InstanceSettings ¶ added in v1.17.0
type InstanceSettings struct {
SingleOrganizationMode bool `json:"singleOrganizationMode"`
BearerTokenAuthDisabled bool `json:"bearerTokenAuthDisabled"`
GitlabOAuth2Config []GitlabOauth2Config `json:"gitlabOAuth2Config"`
}
type InstanceUsageStatistics ¶ added in v1.6.1
type InstanceUsageStatistics struct {
NumberOfUsers int `gorm:"column:number_of_users"`
NumberOfOrganizations int `gorm:"column:number_of_organizations"`
NumberOfProjects int `gorm:"column:number_of_projects"`
NumberOfAssetVersions int `gorm:"column:number_of_asset_versions"`
NumberOfTicketSyncedProjects int `gorm:"column:number_of_ticket_synced_projects"`
NumberOfProjectsWithGitlabIntegration int `gorm:"column:number_of_projects_with_gitlab_integration"`
NumberOfAssetsWithSBOM int `gorm:"column:number_of_assets_with_sbom"`
}
type InvitationStatus ¶ added in v1.9.0
type InvitationStatus = string
const ( InvitationStatusPending InvitationStatus = "pending" InvitationStatusExpired InvitationStatus = "expired" )
type InviteRequest ¶
type InviteRequest struct {
Email string `json:"email" validate:"required,email,max=320"`
}
type InvitedUser ¶ added in v1.17.0
type InvitedUser struct {
ID string `json:"id"`
Email string `json:"email"`
ExpiryDate time.Time `json:"expiryDate"`
InvitationStatus InvitationStatus `json:"invitationStatus"`
}
type JiraIntegration ¶ added in v1.17.0
type LicenseRisk ¶ added in v1.17.0
type LicenseRisk struct {
ID uuid.UUID `json:"id"`
AssetVersionName string `json:"assetVersionName"`
AssetID string `json:"assetId"`
State VulnState `json:"state"`
CreatedAt time.Time `json:"createdAt"`
TicketID *string `json:"ticketId"`
TicketURL *string `json:"ticketUrl"`
ManualTicketCreation bool `json:"manualTicketCreation"`
FinalLicenseDecision *string `json:"finalLicenseDecision"`
ComponentPurl string `json:"componentPurl"`
Component Component `json:"component"`
Artifacts []LicenseRiskArtifact `json:"artifacts"`
}
type LicenseRiskArtifact ¶ added in v1.17.0
type Log ¶ added in v1.17.0
type Log struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
OrgID *uuid.UUID `json:"orgID"`
ProjectID *uuid.UUID `json:"projectID"`
AssetID *uuid.UUID `json:"assetID"`
LogLevel LogLevel `json:"logLevel"`
Message string `json:"message"`
ProjectName *string `json:"projectName,omitempty"`
AssetName *string `json:"assetName,omitempty"`
OrgName *string `json:"orgName,omitempty"`
}
type LookupResponse ¶
type MakeFinalLicenseDecisionRequest ¶ added in v1.9.1
type MaliciousPackage ¶ added in v1.6.1
type MaliciousPackage struct {
OrgSlug string `json:"orgSlug" gorm:"column:org_slug"`
ProjectSlug string `json:"projectSlug" gorm:"column:project_slug"`
AssetSlug string `json:"assetSlug" gorm:"column:asset_slug"`
AssetName string `json:"assetName" gorm:"column:asset_name"`
AssetVersionName string `json:"assetVersionName" gorm:"column:asset_version_name"`
Component string `json:"component" gorm:"column:component"`
MaliciousPackageID string `json:"maliciousPackageID" gorm:"malicious_package_id"`
}
a malicious package inside an org (with the slugs to determine the path of the malicious package)
type MaliciousPackageInOrg ¶ added in v1.1.0
type MappedControl ¶ added in v1.17.0
type MechanicalJustificationType ¶
type MechanicalJustificationType string
const ( ComponentNotPresent MechanicalJustificationType = "component_not_present" VulnerableCodeNotPresent MechanicalJustificationType = "vulnerable_code_not_present" VulnerableCodeNotInExecutePath MechanicalJustificationType = "vulnerable_code_not_in_execute_path" VulnerableCodeCannotBeControlledByAdversary MechanicalJustificationType = "vulnerable_code_cannot_be_controlled_by_adversary" InlineMitigationsAlreadyExist MechanicalJustificationType = "inline_mitigations_already_exist" )
type ModifiedAttackComplexity ¶ added in v1.13.0
type ModifiedAttackComplexity string
const ( MACLow ModifiedAttackComplexity = "low" MACHigh ModifiedAttackComplexity = "high" MACNotDefined ModifiedAttackComplexity = "X" )
type ModifiedAttackVector ¶ added in v1.13.0
type ModifiedAttackVector string
const ( MAVNetwork ModifiedAttackVector = "network" MAVAdjacentNetwork ModifiedAttackVector = "adjacent" MAVLocal ModifiedAttackVector = "local" MAVPhysical ModifiedAttackVector = "physical" MAVNotDefined ModifiedAttackVector = "X" )
type ModifiedPrivilegesRequired ¶ added in v1.13.0
type ModifiedPrivilegesRequired string
const ( MPRNone ModifiedPrivilegesRequired = "none" MPRLow ModifiedPrivilegesRequired = "low" MPRHigh ModifiedPrivilegesRequired = "high" MPRNotDefined ModifiedPrivilegesRequired = "X" )
type ModifiedRequirementLevel ¶ added in v1.13.0
type ModifiedRequirementLevel string
const ( MRLNotDefined ModifiedRequirementLevel = "X" MRLNone ModifiedRequirementLevel = "none" MRLLow ModifiedRequirementLevel = "low" MRLHigh ModifiedRequirementLevel = "high" )
type ModifiedScope ¶ added in v1.13.0
type ModifiedScope string
const ( MSUnchanged ModifiedScope = "unchanged" MSChanged ModifiedScope = "changed" MSNotDefined ModifiedScope = "X" )
type ModifiedUserInteraction ¶ added in v1.13.0
type ModifiedUserInteraction string
const ( MUINotDefined ModifiedUserInteraction = "X" MUINone ModifiedUserInteraction = "none" MUIRequired ModifiedUserInteraction = "required" )
type OSV ¶
type OSV struct {
ID string `json:"id"`
Summary string `json:"summary"`
Modified time.Time `json:"modified"`
Published time.Time `json:"published"`
Withdrawn *time.Time `json:"withdrawn"`
Details string `json:"details"`
Related []string `json:"related"`
Aliases []string `json:"aliases"`
Upstream []string `json:"upstream"`
Affected []Affected `json:"affected"`
Severity []struct {
Type string `json:"type"`
Score string `json:"score"`
} `json:"severity"`
DatabaseSpecific DatabaseSpecifics `json:"database_specific"` // specific additional information, not standardized
}
type OpenSourceInsightsProjectResponse ¶
type OpenSourceInsightsProjectResponse struct {
ProjectKey struct {
ID string `json:"id"`
} `json:"projectKey"`
OpenIssuesCount int `json:"openIssuesCount"`
StarsCount int `json:"starsCount"`
ForksCount int `json:"forksCount"`
License string `json:"license"`
Description string `json:"description"`
Homepage string `json:"homepage"`
Scorecard *Scorecard `json:"scorecard"`
}
type OpenSourceInsightsVersionResponse ¶
type OpenSourceInsightsVersionResponse struct {
VersionKey struct {
System string `json:"system"`
Name string `json:"name"`
Version string `json:"version"`
} `json:"versionKey"`
PublishedAt time.Time `json:"publishedAt"`
IsDefault bool `json:"isDefault"`
Licenses []string `json:"licenses"`
AdvisoryKeys []any `json:"advisoryKeys"`
Links []struct {
Label string `json:"label"`
URL string `json:"url"`
} `json:"links"`
SlsaProvenances []any `json:"slsaProvenances"`
Attestations []any `json:"attestations"`
Registries []string `json:"registries"`
RelatedProjects []struct {
ProjectKey struct {
ID string `json:"id"`
} `json:"projectKey"`
RelationProvenance string `json:"relationProvenance"`
RelationType string `json:"relationType"`
} `json:"relatedProjects"`
}
type Org ¶ added in v1.17.0
type Org struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Name string `json:"name" gorm:"type:text"`
ContactPhoneNumber *string `json:"contactPhoneNumber" gorm:"type:text"`
NumberOfEmployees *int `json:"numberOfEmployees"`
Country *string `json:"country" gorm:"type:text"`
Industry *string `json:"industry" gorm:"type:text"`
CriticalInfrastructure bool `json:"criticalInfrastructure"`
ISO27001 bool `json:"iso27001"`
NIST bool `json:"nist"`
Grundschutz bool `json:"grundschutz"`
Projects []Project `json:"projects" gorm:"foreignKey:OrganizationID;"`
Slug string `json:"slug" gorm:"type:text;unique;not null;index"`
Description string `json:"description" gorm:"type:text"`
GithubAppInstallations []GithubAppInstallation `json:"githubAppInstallations" gorm:"foreignKey:OrgID;"`
GitLabIntegrations []GitlabIntegration `json:"gitLabIntegrations" gorm:"foreignKey:OrgID;"`
JiraIntegrations []JiraIntegration `json:"jiraIntegrations" gorm:"foreignKey:OrgID;"`
IsPublic bool `json:"isPublic" gorm:"default:false;"`
ConfigFiles map[string]any `json:"configFiles"`
Language string `json:"language"`
ExternalEntityProviderID *string `json:"externalEntityProviderId" gorm:"type:text"`
}
type OrgChangeRoleRequest ¶
type OrgChangeRoleRequest struct {
Role string `json:"role" validate:"required,oneof=member admin"`
}
type OrgCreateRequest ¶
type OrgCreateRequest struct {
Name string `json:"name" validate:"required,max=256"`
ContactPhoneNumber *string `json:"contactPhoneNumber" validate:"omitempty,max=256"`
NumberOfEmployees *int `json:"numberOfEmployees"`
Country *string `json:"country" validate:"omitempty,max=256"`
Industry *string `json:"industry" validate:"omitempty,max=256"`
CriticalInfrastructure bool `json:"criticalInfrastructure"`
ISO27001 bool `json:"iso27001"`
NIST bool `json:"nist"`
Grundschutz bool `json:"grundschutz"`
Description string `json:"description" validate:"max=4000"`
Language string `json:"language" validate:"max=256"`
}
type OrgDetails ¶ added in v1.17.0
type OrgDetails struct {
Org
Members []User `json:"members"`
InvitedMembers []InvitedUser `json:"invitedMembers"`
}
type OrgInformation ¶ added in v1.6.1
type OrgInformation struct {
OwnerEmail string `json:"owner_mail"`
}
type OrgOverview ¶ added in v1.1.0
type OrgOverview struct {
VulnDistribution VulnSeverityDistribution `json:"vulnDistribution"`
OrgStructure OrgStructureDistribution `json:"structure"`
TopProjects []ProjectVulnDistribution `json:"topProjects"`
TopAssets []AssetVulnDistribution `json:"topAssets"`
TopArtifacts []ArtifactVulnDistribution `json:"topArtifacts"`
TopComponents []ComponentOccurrenceAcrossOrg `json:"topComponents"`
TopCVEs []CVEOccurrence `json:"topCVEs"`
VulnEventAverage AverageVulnEventsPerWeek `json:"vulnEventAverage"`
OrgRiskHistory []OrgRiskHistory `json:"orgRiskHistory"`
AverageOpenCodeRisksPerProject float32 `json:"averageOpenCodeRisksPerProject"`
TopEcosystems []EcosystemUsage `json:"topEcosystems"`
MaliciousPackages []MaliciousPackageInOrg `json:"maliciousPackages"`
AverageAgeOfDependencies float64 `json:"averageAgeOfDependencies"`
AverageRemediationTimes AverageRemediationTimes `json:"averageRemediationTimes"`
RemediationTypeDistribution RemediationTypeDistribution `json:"remediationTypeDistribution"`
}
type OrgPatchRequest ¶
type OrgPatchRequest struct {
Name *string `json:"name" validate:"omitempty,max=256"`
ContactPhoneNumber *string `json:"contactPhoneNumber" validate:"omitempty,max=256"`
NumberOfEmployees *int `json:"numberOfEmployees"`
Country *string `json:"country" validate:"omitempty,max=256"`
Industry *string `json:"industry" validate:"omitempty,max=256"`
CriticalInfrastructure *bool `json:"criticalInfrastructure"`
ISO27001 *bool `json:"iso27001"`
NIST *bool `json:"nist"`
Grundschutz *bool `json:"grundschutz"`
Description *string `json:"description" validate:"omitempty,max=4000"`
IsPublic *bool `json:"isPublic"`
ConfigFiles *map[string]any `json:"configFiles"`
Language *string `json:"language" validate:"omitempty,max=256"`
}
type OrgRiskHistory ¶ added in v1.1.0
type OrgRiskHistory struct {
Day time.Time `json:"day" gorm:"column:day"`
Distribution
}
type OrgSettings ¶ added in v1.17.0
type OrgSettings struct {
OrgDetails
Webhooks []WebhookIntegration `json:"webhooks"`
}
type OrgStructureDistribution ¶ added in v1.1.0
type OrgVulnAverage ¶ added in v1.6.1
type OrgVulnAverage = RemediationTimeAverages
type PATCreateResponse ¶ added in v1.17.0
PATCreateResponse is returned once on PAT creation. BearerToken is only populated for symmetric PATs and is never retrievable again.
type PackagistAuthor ¶ added in v1.5.0
type PackagistDist ¶ added in v1.5.0
type PackagistPackageResponse ¶ added in v1.5.0
type PackagistPackageResponse struct {
Packages map[string][]PackagistPackageVersion `json:"packages,omitempty"`
SecurityAdvisories []PackagistSecurityAdvisory `json:"security-advisories,omitempty"`
}
type PackagistPackageVersion ¶ added in v1.5.0
type PackagistPackageVersion struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Homepage string `json:"homepage,omitempty"`
Version string `json:"version"`
VersionNormalized string `json:"version_normalized,omitempty"`
License []string `json:"license,omitempty"`
Authors []PackagistAuthor `json:"authors,omitempty"`
Source *PackagistSource `json:"source,omitempty"`
Dist *PackagistDist `json:"dist,omitempty"`
Type string `json:"type,omitempty"`
Support *PackagistSupport `json:"support,omitempty"`
Require StringMapField `json:"require"`
RequireDev StringMapField `json:"require-dev"`
Suggest StringMapField `json:"suggest"`
Provide StringMapField `json:"provide"`
Replace StringMapField `json:"replace"`
Conflict StringMapField `json:"conflict"`
Time string `json:"time,omitempty"`
Autoload StringMapField `json:"autoload"`
Extra StringMapField `json:"extra"`
}
type PackagistSecurityAdvisory ¶ added in v1.5.0
type PackagistSource ¶ added in v1.5.0
type PackagistSupport ¶ added in v1.5.0
type PackagistSupport struct {
Email string `json:"email,omitempty"`
Issues string `json:"issues,omitempty"`
Forum string `json:"forum,omitempty"`
Wiki string `json:"wiki,omitempty"`
IRC string `json:"irc,omitempty"`
Source string `json:"source,omitempty"`
Docs string `json:"docs,omitempty"`
RSS string `json:"rss,omitempty"`
Chat string `json:"chat,omitempty"`
Security string `json:"security,omitempty"`
}
type PatCreateRequest ¶
type PatCreateRequest struct {
Description string `json:"description" validate:"max=4000"`
PubKey *string `json:"pubKey" validate:"omitempty,max=8192"`
Scopes string `json:"scopes" validate:"max=256"`
ExpiryDateUnix int64 `json:"expiryDateUnix" validate:"required,future_max_1y"`
}
PatCreateRequest creates either an asymmetric PAT (set PubKey) or a symmetric Bearer token PAT (leave PubKey empty — the server generates the token). Exactly one mode must be used.
func (PatCreateRequest) IsAsymmetric ¶ added in v1.6.0
func (r PatCreateRequest) IsAsymmetric() bool
func (PatCreateRequest) IsSymmetric ¶ added in v1.6.0
func (r PatCreateRequest) IsSymmetric() bool
type PermalinkResponse ¶ added in v1.15.0
type PermalinkResponse struct {
OrganizationSlug string `json:"organizationSlug"`
ProjectSlug string `json:"projectSlug,omitempty"`
AssetSlug string `json:"assetSlug,omitempty"`
}
PermalinkResponse answers "which slugs does this UUID belong to?". The frontend turns it into the slug based URL a permalink redirects to, so the project and asset fields stay empty for the levels that do not apply.
type PoolInfo ¶ added in v1.12.5
type PoolInfo struct {
DBName string `json:"dbName,omitempty"`
MaxOpenConns int32 `json:"maxOpenConns,omitempty"`
ConnMaxLifetime string `json:"connMaxLifetime,omitempty"`
ConnMaxIdleTime string `json:"connMaxIdleTime,omitempty"`
TotalConns int `json:"totalConns,omitempty"`
IdleConns int `json:"idleConns,omitempty"`
AcquiredConns int `json:"acquiredConns,omitempty"`
MaxConns int `json:"maxConns,omitempty"`
}
PoolInfo intentionally omits sensitive fields (e.g. passwords).
type ProcessInfo ¶ added in v1.12.5
type Project ¶ added in v1.17.0
type Project struct {
Avatar *string `json:"avatar,omitempty"` // URL to the project's avatar
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
IsPublic bool `json:"isPublic"`
Type string `json:"type"`
ParentID *uuid.UUID `json:"parentId"`
Parent *Project `json:"parent,omitempty"` // recursive structure
RepositoryID *string `json:"repositoryId"`
RepositoryName *string `json:"repositoryName"`
Assets []Asset `json:"assets"`
ConfigFiles map[string]any `json:"configFiles"`
ExternalEntityProviderID *string `json:"externalEntityProviderId,omitempty"`
ExternalEntityID *string `json:"externalEntityId,omitempty"` // only set if this is an external entity
SubGroupsAndAssets []ProjectAsset `json:"subGroupsAndAsset"`
}
type ProjectAsset ¶ added in v1.17.0
type ProjectAsset struct {
ResourceType string `json:"resourceType"` // "project" or "asset"
ID uuid.UUID `json:"id"`
Avatar *string `json:"avatar,omitempty"` // URL to the asset's avatar
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
ProjectID uuid.UUID `json:"projectId"`
ParentID *uuid.UUID `json:"parentId,omitempty"` // only set for projects, not for assets
IsPublic bool `json:"isPublic"`
State string `json:"state"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
SubGroupsAndAssets []ProjectAsset `json:"subGroupsAndAsset" gorm:"-"`
}
type ProjectChangeRoleRequest ¶
type ProjectChangeRoleRequest struct {
Role string `json:"role" validate:"required,oneof=member admin"`
}
type ProjectCreateRequest ¶
type ProjectDetails ¶ added in v1.17.0
type ProjectDetails struct {
Project
Members []User `json:"members"`
Webhooks []WebhookIntegration `json:"webhooks"`
}
type ProjectExternalEntityTree ¶ added in v1.8.0
type ProjectExternalEntityTree struct {
ProjectExternalEntityID string `json:"projectExternalEntityId"`
ProjectName string `json:"projectName"`
SubProjects []SubProjectEntry `json:"subProjects,omitempty"`
Assets []AssetEntry `json:"assets"`
}
type ProjectInviteRequest ¶
type ProjectInviteRequest struct {
Ids []string `json:"ids" validate:"required,max=100,dive,max=256"`
}
type ProjectPatchRequest ¶
type ProjectPatchRequest struct {
Name *string `json:"name" validate:"omitempty,max=256"`
Description *string `json:"description" validate:"omitempty,max=4000"`
IsPublic *bool `json:"isPublic"`
Type *string `json:"type" validate:"omitempty,max=256"`
RepositoryID *string `json:"repositoryId" validate:"omitempty,max=256"`
RepositoryName *string `json:"repositoryName" validate:"omitempty,max=256"`
ConfigFiles *map[string]any `json:"configFiles"`
}
type ProjectVulnCountAverageBySeverity ¶ added in v1.1.0
type ProjectVulnCountAverageBySeverity struct {
RiskLowAverage float32 `json:"riskLowAverage" gorm:"column:risk_low_average"`
RiskMediumAverage float32 `json:"riskMediumAverage" gorm:"column:risk_medium_average"`
RiskHighAverage float32 `json:"riskHighAverage" gorm:"column:risk_high_average"`
RiskCriticalAverage float32 `json:"riskCriticalAverage" gorm:"column:risk_critical_average"`
CVSSLowAverage float32 `json:"cvssLowAverage" gorm:"column:cvss_low_average"`
CVSSMediumAverage float32 `json:"cvssMediumAverage" gorm:"column:cvss_medium_average"`
CVSSHighAverage float32 `json:"cvssHighAverage" gorm:"column:cvss_high_average"`
CVSSCriticalAverage float32 `json:"cvssCriticalAverage" gorm:"column:cvss_critical_average"`
}
type ProjectVulnDistribution ¶ added in v1.6.1
type ProjectVulnDistribution struct {
Name string `json:"name" gorm:"column:pname"`
Slug string `json:"slug" gorm:"column:pslug"`
VulnSeverityDistribution
}
type Range ¶
type Range struct {
Type string `json:"type"`
Repo string `json:"repo"`
Events []SemverEvent `json:"events"`
}
type Recommendation ¶ added in v1.3.0
type Recommendation struct {
RecommendedVersion string `json:"recommendedVersion"`
}
Recommendation represents a recommended fixed version for a package This is used for external integrations like Renovate
type Relationship ¶ added in v1.17.0
type RelationshipType ¶
type RelationshipType = string
const ( RelationshipTypeAlias RelationshipType = "alias" RelationshipTypeUpstream RelationshipType = "upstream" RelationshipTypeRelated RelationshipType = "related" RelationshipTypeEUVD RelationshipType = "euvd" // flag relationships only imported through euvd explicitly RelationshipTypeAdvisory RelationshipType = "advisory" // flag relationships which stem from ingested security advisories )
type ReleaseCreateRequest ¶
type ReleaseCreateRequest struct {
Name string `json:"name" validate:"required,max=256"`
Items []ReleaseItem `json:"items,omitempty" validate:"omitempty,dive"`
}
requests
type ReleaseItem ¶ added in v1.17.0
type ReleaseItem struct {
ID uuid.UUID `json:"id,omitempty"`
ReleaseID uuid.UUID `json:"releaseId,omitempty"`
ChildReleaseName *string `json:"childReleaseName,omitempty"`
ChildReleaseID *uuid.UUID `json:"childReleaseId,omitempty" validate:"required_without=AssetID"`
ArtifactName *string `json:"artifactName,omitempty"`
AssetVersionName *string `json:"assetVersionName,omitempty"`
AssetID *uuid.UUID `json:"assetId,omitempty" validate:"required_without=ChildReleaseID"`
}
type ReleasePatchRequest ¶
type ReleasePatchRequest struct {
Items []ReleaseItem `json:"items,omitempty" validate:"omitempty,dive"`
}
type RemediationTimeAverages ¶ added in v1.1.0
type RemediationTimeAverages struct {
RiskAvgLow float64 `json:"riskAvgLow"`
RiskAvgMedium float64 `json:"riskAvgMedium"`
RiskAvgHigh float64 `json:"riskAvgHigh"`
RiskAvgCritical float64 `json:"riskAvgCritical"`
CVSSAvgLow float64 `json:"cvssAvgLow"`
CVSSAvgMedium float64 `json:"cvssAvgMedium"`
CVSSAvgHigh float64 `json:"cvssAvgHigh"`
CVSSAvgCritical float64 `json:"cvssAvgCritical"`
}
type RemediationTypeDistribution ¶ added in v1.1.0
type RemediationTypeDistributionRow ¶ added in v1.1.0
type RequirementLevel ¶
type RequirementLevel string
const ( RequirementLevelLow RequirementLevel = "low" RequirementLevelMedium RequirementLevel = "medium" RequirementLevelHigh RequirementLevel = "high" )
type RevokeByPrivateKeyRequest ¶
type RevokeByPrivateKeyRequest struct {
PrivateKey string `json:"privkey" validate:"required,max=8192"`
}
type RiskCalculationReport ¶
type RiskCalculationReport struct {
EPSS float64 `json:"epss"`
BaseScore float64 `json:"baseScore"`
ExploitExists bool `json:"exploitExists"`
VerifiedExploitExists bool `json:"verifiedExploitExists"`
UnderAttack bool `json:"underAttack"`
// environment information
ConfidentialityRequirement string `json:"confidentialityRequirement"`
IntegrityRequirement string `json:"integrityRequirement"`
AvailabilityRequirement string `json:"availabilityRequirement"`
Risk float64 `json:"risk"`
Vector string `json:"vector"`
}
func (RiskCalculationReport) Map ¶
func (r RiskCalculationReport) Map() map[string]any
func (RiskCalculationReport) String ¶
func (r RiskCalculationReport) String() string
type RiskHistory ¶ added in v1.17.0
type RiskHistoryWithVersion ¶ added in v1.17.0
type RiskHistoryWithVersion struct {
RiskHistory
Slug string `json:"slug"`
DefaultBranch bool `json:"defaultBranch"`
AssetVersionType string `json:"type"`
}
type RiskMetrics ¶
type RuntimeInfo ¶ added in v1.12.5
type ScanResponse ¶
type ScanResponse struct {
AmountOpened int `json:"amountOpened"`
AmountClosed int `json:"amountClosed"`
DependencyVulns []DependencyVuln `json:"dependencyVulns"`
}
type Scorecard ¶
type Scorecard struct {
Date time.Time `json:"date"`
Repository struct {
Name string `json:"name"`
Commit string `json:"commit"`
} `json:"repository"`
Scorecard struct {
Version string `json:"version"`
Commit string `json:"commit"`
} `json:"scorecard"`
Checks []struct {
Name string `json:"name"`
Documentation struct {
ShortDescription string `json:"shortDescription"`
URL string `json:"url"`
} `json:"documentation"`
Score int `json:"score"`
Reason string `json:"reason"`
Details []any `json:"details"`
} `json:"checks"`
OverallScore float64 `json:"overallScore"`
Metadata []any `json:"metadata"`
}
type SemverEvent ¶
type SnippetContent ¶
type SnippetContents ¶
type SnippetContents struct {
Snippets []SnippetContent `json:"snippets"`
}
type StringMapField ¶ added in v1.5.0
func (*StringMapField) UnmarshalJSON ¶ added in v1.5.0
func (s *StringMapField) UnmarshalJSON(b []byte) error
type SubProjectEntry ¶ added in v1.17.0
type SubProjectEntry struct {
SubProjectExternalEntityID string `json:"subProjectExternalEntityId,omitempty"`
SubProjectName string `json:"subProjectName,omitempty"`
SubProjectDescription string `json:"subProjectDescription,omitempty"`
Assets []AssetEntry `json:"assets"`
}
type TestVEXRulesRequest ¶ added in v1.12.0
type TestVEXRulesRequest struct {
CelExpression []string `json:"celExpression" validate:"required,max=100,dive,max=4000"`
EventType VulnEventType `json:"eventType" validate:"required,oneof=accepted falsePositive reopened"`
}
type TokenOwner ¶ added in v1.11.0
type UpdateAssetRequest ¶ added in v1.6.1
type UpdateAssetRequest struct {
NewSlug string `json:"new_slug" validate:"required,max=256"`
}
type UpdateInstanceSettingsRequest ¶ added in v1.6.1
type UpdateInstanceSettingsRequest struct {
DisableOrgCreation *bool `json:"disable_org_creation"` // pointer makes it nil-able so we can distinguish a missing/ incorrectly parsed value (rather than the default value = false)
}
type VEXRule ¶ added in v1.17.0
type VEXRule struct {
// Primary key
ID string `json:"id"`
// Composite key components
AssetID uuid.UUID `json:"assetId"`
CVEID string `json:"cveId"`
VexSource string `json:"vexSource"`
// Rule data
Title string `json:"title"`
Justification string `json:"justification"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
EventType VulnEventType `json:"eventType"`
PathPattern []string `json:"pathPattern"`
CELExpression string `json:"celExpression"`
CreatedByID string `json:"createdById"`
CreatedAt string `json:"createdAt"`
// Metrics
AppliesToAmountOfDependencyVulns int `json:"appliesToAmountOfDependencyVulns"`
}
type VexRuleRecommendation ¶ added in v1.4.0
type VexRuleRecommendation struct {
Title string `json:"title"`
CELExpression string `json:"celExpression"`
Justification string `json:"justification"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
EventType VulnEventType `json:"eventType"`
Type VexRuleRecommendationType `json:"type"`
Source string `json:"source,omitempty"`
Confidence float64 `json:"confidence"`
VerifiedVotes int `json:"verifiedVotes"`
TotalVotes int `json:"totalVotes"`
// ProjectSlug/OriginAssetSlug are set when this recommendation was
// taken directly from a rule on an asset the requesting user already has
// access to, rather than from the crowd-voted recommendation across
// every matching rule. Lets the frontend link to that project/asset.
ProjectSlug *string `json:"projectSlug,omitempty"`
AssetSlug *string `json:"assetSlug,omitempty"`
AssetSignature int64 `json:"assetSignature,omitempty,string"`
DependencyVulnSignature int64 `json:"dependencyVulnSignature,omitempty,string"`
}
type VexRuleRecommendationType ¶ added in v1.12.0
type VexRuleRecommendationType string
VexRuleRecommendationType identifies how a recommendation was derived, since that determines which of its fields (Confidence/votes) are meaningful.
const ( // VexRuleRecommendationTypeSession: taken directly from a matching rule on // an asset the requesting user already has access to. VexRuleRecommendationTypeSession VexRuleRecommendationType = "session" // VexRuleRecommendationTypeCrowdsourced: derived from voting across every // matching asset-owned VEX rule. VexRuleRecommendationTypeCrowdsourced VexRuleRecommendationType = "crowdsourced" // VexRuleRecommendationTypeUpstream: matched a trusted upstream VEX rule; // always fully confident and has no votes. VexRuleRecommendationTypeUpstream VexRuleRecommendationType = "upstream" )
type VulnEvent ¶ added in v1.17.0
type VulnEvent struct {
ID uuid.UUID `json:"id"`
Type VulnEventType `json:"type"`
VulnID uuid.UUID `json:"vulnId"`
VulnType VulnType `json:"vulnType"`
UserID string `json:"userId"`
Justification *string `json:"justification"`
MechanicalJustification MechanicalJustificationType `json:"mechanicalJustification"`
CreatedAt time.Time `json:"createdAt"`
OriginalAssetVersionName *string `json:"originalAssetVersionName"`
ResourceIdentifier string `json:"resourceIdentifier"`
PackageName string `json:"packageName"`
URI string `json:"uri"`
CreatedByVexRule bool `json:"createdByVexRule"`
UserAgent string `json:"userAgent"`
VexRuleID *string `json:"vexRuleId"`
VexRule *VEXRule `json:"vexRule,omitempty"`
}
type VulnEventAverage ¶ added in v1.1.0
type VulnEventAverage struct {
VulnEventType VulnEventType `gorm:"column:type"`
Average float32 `gorm:"column:average"`
}
type VulnEventType ¶
type VulnEventType string
const ( // Manual Events (Events that required User Interaction) (see asset_version_service.go @ getDatesForVulnerabilityEvent) EventTypeFixed VulnEventType = "fixed" EventTypeLicenseDecision VulnEventType = "licenseDecision" EventTypeReopened VulnEventType = "reopened" EventTypeAccepted VulnEventType = "accepted" EventTypeMitigate VulnEventType = "mitigate" EventTypeFalsePositive VulnEventType = "falsePositive" EventTypeMarkedForTransfer VulnEventType = "markedForTransfer" EventTypeComment VulnEventType = "comment" EventTypePublish VulnEventType = "published" EventTypeWithdraw VulnEventType = "withdrawn" EventTypeCreated VulnEventType = "created" EventTypeImplemented VulnEventType = "implemented" EventTypeNotApplicable VulnEventType = "notApplicable" EventTypeAttachedComplianceComponent VulnEventType = "attachedComplianceComponent" EventTypeRemovedComplianceComponent VulnEventType = "removedComplianceComponent" // Automated Events (Events that are triggered by automation's on the server) EventTypeDetected VulnEventType = "detected" // EventTypeRiskAssessmentUpdated VulnEventType = "riskAssessmentUpdated" EventTypeRawRiskAssessmentUpdated VulnEventType = "rawRiskAssessmentUpdated" )
type VulnInPackage ¶ added in v1.17.0
type VulnSeverityDistribution ¶ added in v1.6.1
type VulnSeverityDistribution struct {
Low int `json:"low" gorm:"column:low_risk"`
Medium int `json:"medium" gorm:"column:medium_risk"`
High int `json:"high" gorm:"column:high_risk"`
Critical int `json:"critical" gorm:"column:critical_risk"`
LowCVSS int `json:"lowCvss" gorm:"column:low_cvss"`
MediumCVSS int `json:"mediumCvss" gorm:"column:medium_cvss"`
HighCVSS int `json:"highCvss" gorm:"column:high_cvss"`
CriticalCVSS int `json:"criticalCvss" gorm:"column:critical_cvss"`
}
type VulnState ¶
type VulnState string
const ( VulnStateOpen VulnState = "open" VulnStateFixed VulnState = "fixed" // we did not find the dependencyVuln anymore in the last scan! VulnStateAccepted VulnState = "accepted" // like ignore VulnStateFalsePositive VulnState = "falsePositive" // we can use that for crowdsource vulnerability management. 27 People marked this as false positive and they have the same dependency tree - propably you are not either VulnStateMarkedForTransfer VulnState = "markedForTransfer" VulnStateImplemented VulnState = "implemented" // for compliance posture VulnStateNotApplicable VulnState = "notApplicable" // for compliance posture VulnStateDraft VulnState = "draft" // for advisory VulnStatePublished VulnState = "public" // for advisory VulnStateWithdrawn VulnState = "withdrawn" // for advisory )
type VulnerabilityInReport ¶
type VulnerabilityInReport struct {
CVEID string
SourceName string
SourceURL string
AffectedComponent string
CveDescription string
AnalysisState string
AnalysisResponse string
AnalysisDetail string
AnalysisFirstIssued string
AnalysisLastUpdated string
CVSS float64
Severity string
CVSSMethod string
Vector string
DevguardScore float64
DevguardSeverity string
DevguardVector string
Depth int
}
VulnerabilityInReport represents a single CVE entry in the template.
type VulnerabilityReport ¶
type VulnerabilityReport struct {
AppTitle string
AppVersion string
ReportCreationDate string
AmountCritical int
AmountHigh int
AmountMedium int
AmountLow int
AvgFixTimeCritical string
AvgFixTimeHigh string
AvgFixTimeMedium string
AvgFixTimeLow string
CriticalVulns []VulnerabilityInReport
HighVulns []VulnerabilityInReport
MediumVulns []VulnerabilityInReport
LowVulns []VulnerabilityInReport
}
VulnerabilityReport is the top-level model matching the markdown.gotmpl context.
type WebhookCreateRequest ¶ added in v1.17.0
type WebhookCreateRequest struct {
Name string `json:"name" validate:"max=256"`
Description string `json:"description" validate:"max=4000"`
URL string `json:"url" validate:"required,max=2048"`
Secret string `json:"secret" validate:"max=1024"`
SbomEnabled bool `json:"sbomEnabled"`
VulnEnabled bool `json:"vulnEnabled"`
}
type WebhookIntegration ¶ added in v1.17.0
type WebhookTestRequest ¶ added in v1.17.0
type WebhookUpdateRequest ¶ added in v1.17.0
type WebhookUpdateRequest struct {
ID string `json:"id" validate:"max=256"`
Name string `json:"name" validate:"max=256"`
Description string `json:"description" validate:"max=4000"`
URL string `json:"url" validate:"required,max=2048"`
Secret string `json:"secret" validate:"max=1024"`
SbomEnabled bool `json:"sbomEnabled"`
VulnEnabled bool `json:"vulnEnabled"`
}
type YamlMetadata ¶
type YamlMetadata struct {
Vars YamlVars `yaml:"metadata_vars"`
}
type YamlVars ¶
type YamlVars struct {
DocumentTitle string `yaml:"document_title"`
PrimaryColor string `yaml:"primary_color"`
Version string `yaml:"version"`
TimeOfGeneration string `yaml:"generation_date"`
ProjectTitle1 string `yaml:"app_title_part_one"`
ProjectTitle2 string `yaml:"app_title_part_two"`
OrganizationName string `yaml:"organization_name"`
Integrity string `yaml:"integrity"`
}
Source Files
¶
- admin_dto.go
- advisory_dto.go
- advisory_event_dto.go
- asset_dto.go
- asset_version_dto.go
- comilance_posture_dto.go
- compliance_posture_dto.go.go
- component_dto.go
- contenttree.go
- cve_obj.go
- cve_relationship_dto.go
- dead_simple_signing_envelope.go
- dependency_proxy_dto.go
- dependency_vuln_dto.go
- deps_dev_dto.go
- errors_dto.go
- external_reference_dto.go
- first_party_vuln_dto.go
- git_repository_dto.go
- gitlab_oauth2_config_dto.go
- info_dto.go
- instance_setting_dto.go
- integrations_obj.go
- intoto_dto.go
- invited_user_dto.go
- license_risk_dto.go
- log_dto.go
- org_dto.go
- osv_obj.go
- packagist_dto.go
- pat_dto.go
- permalink_dto.go
- policy_dto.go
- project_dto.go
- purl_inspect_dto.go
- recommendation_dto.go
- release_dto.go
- report_dto.go
- scan_dto.go
- slsa_dto.go
- statistics_dto.go
- user_dto.go
- validator.go
- vex_rule_dto.go
- vuln_report.go
- vulnevent_dto.go
- webhook_dto.go