Documentation
¶
Index ¶
- func HTTPAPI(a *AssetMon) http.Handler
- func OpenServiceDB(dburi string) (*sql.DB, error)
- func OpenStateDB(dburi string) (*sql.DB, error)
- type Artifact
- type ArtifactResult
- type AssetMon
- func (a *AssetMon) Close()
- func (a *AssetMon) FindArtifacts(ctx context.Context, req *FindArtifactsRequest) (*FindArtifactsResponse, error)
- func (a *AssetMon) FullUpdate(ctx context.Context, req *FullUpdateRequest) (*UpdateResponse, error)
- func (a *AssetMon) GetContainerDeployment(ctx context.Context, req *GetContainerDeploymentRequest) ([]*ContainerInfo, error)
- func (a *AssetMon) GetImageSBOM(ctx context.Context, digest string) (*Image, error)
- func (a *AssetMon) ScanReport(ctx context.Context, req *ScanReportRequest) error
- func (a *AssetMon) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)
- type Client
- type Container
- type ContainerInfo
- type ContainerSummary
- type FindArtifactsRequest
- type FindArtifactsResponse
- type FullUpdateRequest
- type GetContainerDeploymentRequest
- type GetContainerDeploymentResponse
- type GetImageSBOMRequest
- type GetImageSBOMResponse
- type Image
- type Match
- type ScanClient
- type ScanReportRequest
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenServiceDB ¶
OpenServiceDB opens a SQLite database and runs the database migrations.
Types ¶
type Artifact ¶
type ArtifactResult ¶
type ArtifactResult struct { Artifact ContainerInfo }
type AssetMon ¶
type AssetMon struct {
// contains filtered or unexported fields
}
AssetMon implements the asset management (tracking) service.
func (*AssetMon) FindArtifacts ¶
func (a *AssetMon) FindArtifacts(ctx context.Context, req *FindArtifactsRequest) (*FindArtifactsResponse, error)
func (*AssetMon) FullUpdate ¶
func (a *AssetMon) FullUpdate(ctx context.Context, req *FullUpdateRequest) (*UpdateResponse, error)
func (*AssetMon) GetContainerDeployment ¶
func (a *AssetMon) GetContainerDeployment(ctx context.Context, req *GetContainerDeploymentRequest) ([]*ContainerInfo, error)
func (*AssetMon) GetImageSBOM ¶
func (*AssetMon) ScanReport ¶
func (a *AssetMon) ScanReport(ctx context.Context, req *ScanReportRequest) error
func (*AssetMon) Update ¶
func (a *AssetMon) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for AssetMon, which implements the client side of the image scanning workflow. Note that the Context passed to client methods should allow for local execution of the scan of potentially multiple images, not just the network RPC, so we use a shorter timeout for the RPC part.
func NewAPIClient ¶
func NewAPIClient(be clientutil.Backend) *Client
type ContainerInfo ¶
type ContainerInfo struct { ContainerSummary Host string `json:"host"` Since time.Time `json:"running_since"` }
type ContainerSummary ¶
type ContainerSummary struct { Name string `json:"name"` ImageName string `json:"image_name"` ImageDigest string `json:"image_digest"` }
func RunningContainers ¶
func RunningContainers(ctx context.Context) ([]ContainerSummary, error)
RunningContainers returns the list of currently running (according to Podman) containers, along with their associated image IDs.
type FindArtifactsResponse ¶
type FindArtifactsResponse struct {
Results []*ArtifactResult `json:"results"`
}
type FullUpdateRequest ¶
type FullUpdateRequest struct { Host string `json:"host"` Containers []ContainerSummary `json:"containers"` }
type GetContainerDeploymentRequest ¶
type GetContainerDeploymentResponse ¶
type GetContainerDeploymentResponse struct {
Containers []*ContainerInfo `json:"containers"`
}
type Image ¶
type Match ¶
type ScanClient ¶
type ScanClient struct { *Client // contains filtered or unexported fields }
ScanClient needs more information related to scanning. It also keeps local state to avoid repeatedly attempting to scan an image and fail (for whatever reason).
func NewScanClient ¶
func NewScanClient(be clientutil.Backend, hostname, stateDBPath string) (*ScanClient, error)
func (*ScanClient) Close ¶
func (c *ScanClient) Close()
func (*ScanClient) FullUpdate ¶
func (c *ScanClient) FullUpdate(ctx context.Context, ctnrs []ContainerSummary) error
func (*ScanClient) UpdateContainer ¶
func (c *ScanClient) UpdateContainer(ctx context.Context, cont *ContainerSummary) (bool, error)
type UpdateRequest ¶
type UpdateRequest struct { Host string `json:"host"` Container ContainerSummary `json:"container"` }
Source Files
¶
- client.go
- db.go
- debug.go
- http.go
- sbom.go
- service.go