Documentation ¶
Overview ¶
Copyright © 2023 FairwindsOps, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2023 FairwindsOps, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type BaseImageVulnerabilityReport
- type Client
- func (c *Client) GetBaseImageOutput() (string, error)
- func (c *Client) GetBaseImageReport(image string) (*BaseImageVulnerabilityReport, error)
- func (c *Client) GetImageLayerReport(imageLayers []string) (*BaseImageVulnerabilityReport, error)
- func (c *Client) MakeRequest(req *http.Request) ([]byte, error)
- func (c *Client) TableOutput(report *BaseImageVulnerabilityReport) (string, error)
- func (c *Client) ValidateOptions() error
- type ImageUpgrade
- type ReportBaseImage
- type ReportVulnerability
Constants ¶
This section is empty.
Variables ¶
var OutputFormats []string = []string{
"json",
"yaml",
"table",
}
var SortColumns []string = []string{
"id",
"severity",
"cvss",
}
var SortOrder []string = []string{
"asc",
"desc",
}
Functions ¶
This section is empty.
Types ¶
type BaseImageVulnerabilityReport ¶
type BaseImageVulnerabilityReport struct { ImageRepository string `json:"image_repository"` ImageTag string `json:"image_tag"` ImagePlatform *string `json:"image_platform,omitempty"` BaseImages []*ReportBaseImage `json:"base_images"` }
type Client ¶
type Client struct { APIURL string `json:"apiURL"` Token string `json:"token"` // Table Output Options OutputFormat string `json:"outputFormat"` ColorizeOutput bool `json:"colorizeOutput"` SortBy string `json:"sortBy"` SortOrder string `json:"sortOrder"` // Inputs Image string ImageLayers []string // Logger is an instance of the zap logger you can use to configure logging. Logger *zap.SugaredLogger }
func (*Client) GetBaseImageOutput ¶
func (*Client) GetBaseImageReport ¶
func (c *Client) GetBaseImageReport(image string) (*BaseImageVulnerabilityReport, error)
func (*Client) GetImageLayerReport ¶
func (c *Client) GetImageLayerReport(imageLayers []string) (*BaseImageVulnerabilityReport, error)
func (*Client) MakeRequest ¶
MakeRequest performs an HTTP request using the client. It adds the proper headers as well as authentication and does error handling
func (*Client) TableOutput ¶
func (c *Client) TableOutput(report *BaseImageVulnerabilityReport) (string, error)
func (*Client) ValidateOptions ¶
type ImageUpgrade ¶
type ImageUpgrade struct { Type string `json:"type"` ImageTag string `json:"image_tag"` LastScan *time.Time `json:"last_scan"` FixedVulnerabilities []*ReportVulnerability `json:"fixed_vulnerabilities"` }
ImageUpgrade is a repository:tag combo with a list of fixed vulnerabilities over the base image
type ReportBaseImage ¶
type ReportBaseImage struct { ImageRepository string `json:"image_repository"` ImageTag string `json:"image_tag"` Vulnerabilities []*ReportVulnerability `json:"vulnerabilities,omitempty"` LastScan *time.Time `json:"last_scan"` Upgrades *[]ImageUpgrade `json:"upgrades,omitempty"` }