···1-package scanner
2-3-import (
4- "time"
5-6- "atcr.io/pkg/atproto"
7-)
8-9-// ScanJob represents a vulnerability scanning job for a container image
10-type ScanJob struct {
11- // ManifestDigest is the digest of the manifest to scan
12- ManifestDigest string
13-14- // Repository is the repository name (e.g., "alice/myapp")
15- Repository string
16-17- // Tag is the tag name (e.g., "latest")
18- Tag string
19-20- // UserDID is the DID of the user who owns this image
21- UserDID string
22-23- // UserHandle is the handle of the user (for display)
24- UserHandle string
25-26- // Config is the image config blob descriptor
27- Config atproto.BlobReference
28-29- // Layers are the image layer blob descriptors (in order)
30- Layers []atproto.BlobReference
31-32- // EnqueuedAt is when this job was enqueued
33- EnqueuedAt time.Time
34-}
35-36-// ScanResult represents the result of a vulnerability scan
37-type ScanResult struct {
38- // Job is the original scan job
39- Job *ScanJob
40-41- // VulnerabilitiesJSON is the raw Grype JSON output
42- VulnerabilitiesJSON []byte
43-44- // Summary contains vulnerability counts by severity
45- Summary VulnerabilitySummary
46-47- // SBOMDigest is the digest of the SBOM blob (if SBOM was generated)
48- SBOMDigest string
49-50- // VulnDigest is the digest of the vulnerability report blob
51- VulnDigest string
52-53- // ScannedAt is when the scan completed
54- ScannedAt time.Time
55-56- // ScannerVersion is the version of the scanner used
57- ScannerVersion string
58-}
59-60-// VulnerabilitySummary contains counts of vulnerabilities by severity
61-type VulnerabilitySummary struct {
62- Critical int `json:"critical"`
63- High int `json:"high"`
64- Medium int `json:"medium"`
65- Low int `json:"low"`
66- Total int `json:"total"`
67-}