Documentation
¶
Overview ¶
Package server provides an HTTP server for the vulnerability dashboard. All assets (templates, CSS, JavaScript) are embedded in the binary.
Index ¶
- type Config
- type DashboardData
- type DashboardStats
- type DigestInfo
- type ExposureInfo
- type ExposuresData
- type ImageDetail
- type ImageDetailData
- type ImagesData
- type PageData
- type Queries
- func (q *Queries) GetDashboardStats(ctx context.Context) (*DashboardStats, error)
- func (q *Queries) GetExposures(ctx context.Context, image, digest string) ([]*ExposureInfo, error)
- func (q *Queries) GetImageDetail(ctx context.Context, image string) (*ImageDetail, error)
- func (q *Queries) GetRecentImages(ctx context.Context, limit int) ([]*RecentImage, error)
- func (q *Queries) GetRegistryStats(ctx context.Context, limit int) ([]*RegistryStat, error)
- func (q *Queries) GetTimeSeries(ctx context.Context, image string) ([]*TimeSeriesPoint, error)
- func (q *Queries) SearchImages(ctx context.Context, pattern string, limit int) ([]*RecentImage, error)
- type RecentImage
- type RegistryStat
- type Server
- type TagDataPoint
- type TimeSeriesPoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DashboardData ¶
type DashboardData struct {
PageData
Stats *DashboardStats
Registries []*RegistryStat
Recent []*RecentImage
}
DashboardData contains data for the dashboard page.
type DashboardStats ¶
type DashboardStats struct {
TotalImages int `json:"total_images"`
TotalDigests int `json:"total_digests"`
TotalExposures int `json:"total_exposures"`
TotalPackages int `json:"total_packages"`
LastScan time.Time `json:"last_scan"`
CriticalCount int `json:"critical_count"`
HighCount int `json:"high_count"`
MediumCount int `json:"medium_count"`
LowCount int `json:"low_count"`
FixableCount int `json:"fixable_count"`
UnfixableCount int `json:"unfixable_count"`
}
DashboardStats contains overall statistics for the dashboard.
type DigestInfo ¶
type DigestInfo struct {
Digest string `json:"digest"`
LastScan time.Time `json:"last_scan"`
Exposures int `json:"exposures"`
Packages int `json:"packages"`
MaxScore float32 `json:"max_score"`
Critical int `json:"critical"`
High int `json:"high"`
Medium int `json:"medium"`
Low int `json:"low"`
Sources []string `json:"sources"`
}
DigestInfo contains information about a specific digest.
type ExposureInfo ¶
type ExposureInfo struct {
Exposure string `json:"exposure"`
Severity string `json:"severity"`
Score float32 `json:"score"`
Package string `json:"package"`
Version string `json:"version"`
Source string `json:"source"`
Fixed bool `json:"fixed"`
LastScan time.Time `json:"last_scan"`
}
ExposureInfo contains information about a vulnerability exposure.
type ExposuresData ¶
type ExposuresData struct {
PageData
Image string
Digest string
Exposures []*ExposureInfo
Total int
}
ExposuresData contains data for the exposures page.
type ImageDetail ¶
type ImageDetail struct {
Image string `json:"image"`
Digests []*DigestInfo `json:"digests"`
}
ImageDetail contains detailed information about an image.
type ImageDetailData ¶
type ImageDetailData struct {
PageData
Detail *ImageDetail
TimeSeries []*TimeSeriesPoint
}
ImageDetailData contains data for the image detail page.
type ImagesData ¶
type ImagesData struct {
PageData
Images []*RecentImage
Search string
Total int
ShowTagChart bool
BaseImage string
TagSeries []*TagDataPoint
}
ImagesData contains data for the images page.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
Queries encapsulates database queries for the dashboard.
func (*Queries) GetDashboardStats ¶
func (q *Queries) GetDashboardStats(ctx context.Context) (*DashboardStats, error)
GetDashboardStats returns overall dashboard statistics.
func (*Queries) GetExposures ¶
GetExposures returns exposures for a specific image and digest.
func (*Queries) GetImageDetail ¶
GetImageDetail returns detailed information about an image.
func (*Queries) GetRecentImages ¶
GetRecentImages returns the most recently scanned images.
func (*Queries) GetRegistryStats ¶
GetRegistryStats returns statistics grouped by registry.
func (*Queries) GetTimeSeries ¶
GetTimeSeries returns vulnerability counts over time for an image.
func (*Queries) SearchImages ¶
func (q *Queries) SearchImages(ctx context.Context, pattern string, limit int) ([]*RecentImage, error)
SearchImages searches for images matching a pattern.
type RecentImage ¶
type RecentImage struct {
Image string `json:"image"`
Digest string `json:"digest"`
LastScan time.Time `json:"last_scan"`
Exposures int `json:"exposures"`
MaxScore float32 `json:"max_score"`
Critical int `json:"critical"`
High int `json:"high"`
Medium int `json:"medium"`
Low int `json:"low"`
}
RecentImage contains information about a recently scanned image.
type RegistryStat ¶
type RegistryStat struct {
Registry string `json:"registry"`
ImageCount int `json:"image_count"`
ExposureCount int `json:"exposure_count"`
}
RegistryStat contains statistics for a single registry.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the HTTP server for the dashboard.