I'm looking into fetching all image assessment related vulnerabilities using the Go SDK, version v0.6.0.
I noticed that there is no After argument in CombinedImageVulnerabilitySummaryParams, which means there is no way to pass a pagination token. *queryResult.GetPayload().Meta.Pagination.LastPage() also does not exist, so i'm curious how one is supposed to do pagination (akin to Spotlight)l with this? Thanks!
Example code:
func (cs *CrowdStrike) GetImageVulnerabilities(ctx context.Context) ([]ImageVulnerability, error) {
round := 0
paginationToken := ""
for {
// Query vulnerabilities from Falcon
cs.logger.WithField("round", round).Debug("fetching image vulnerabilities")
queryResult, err := cs.client.ContainerImages.CombinedImageVulnerabilitySummary(
&container_images.CombinedImageVulnerabilitySummaryParams{
Cid: "",
Registry: "",
Repository: "",
Tag: "",
Context: ctx,
// ??
},
)
if err != nil {
return nil, fmt.Errorf("could not query image vulnerabilities: %v\n", err)
}
cs.logger.WithField("total", len(queryResult.GetPayload().Resources)).Debug("vulns returned")
// Process each vulnerability
for _, vuln := range queryResult.GetPayload().Resources {
// TODO
}
// Stop pagination if we reached the end
paginationToken = *queryResult.GetPayload().Meta.Pagination.LastPage() // ??
if paginationToken == "" {
break
}
}
}
Hi,
I'm looking into fetching all image assessment related vulnerabilities using the Go SDK, version v0.6.0.
I noticed that there is no
After
argument inCombinedImageVulnerabilitySummaryParams
, which means there is no way to pass a pagination token.*queryResult.GetPayload().Meta.Pagination.LastPage()
also does not exist, so i'm curious how one is supposed to do pagination (akin to Spotlight)l with this? Thanks!Example code: