Documentation
¶
Overview ¶
Package container scans container images for OS and language package vulnerabilities.
Index ¶
- Constants
- func FindContainerSpecs(dir string) []string
- func ImagesFromFile(rel, content string) []string
- func IsComposePath(rel string) bool
- func IsContainerSpecPath(rel string) bool
- func IsDockerfilePath(rel string) bool
- func ParseComposeImages(content string) []string
- func ParseImages(content string) []string
- func ReadDockerfile(dir, rel string) (string, bool)
- type ContainerScanner
Constants ¶
const MaxDockerfileBytes = 1 << 20
Prevents an attacker-controlled file from forcing a huge allocation.
Variables ¶
This section is empty.
Functions ¶
func FindContainerSpecs ¶ added in v1.0.16
FindContainerSpecs walks dir and returns relative paths of Dockerfiles, Containerfiles, and Compose files (skipping vendored / ignored directories).
func ImagesFromFile ¶ added in v1.0.16
ImagesFromFile dispatches to the right parser based on the file's name.
func IsComposePath ¶ added in v1.0.16
func IsContainerSpecPath ¶ added in v1.0.16
IsContainerSpecPath returns true for any file we can extract base images from.
func IsDockerfilePath ¶ added in v1.0.16
func ParseComposeImages ¶ added in v1.0.16
ParseComposeImages returns the images referenced from each service in a Docker Compose file. Skips services that use `build:` (their Dockerfile is scanned separately) and templated values containing ${…}.
func ParseImages ¶ added in v1.0.16
ParseImages returns FROM image refs, skipping local stages, scratch, and ARG-templated values that can't be resolved without build context.
func ReadDockerfile ¶ added in v1.0.16
ReadDockerfile rejects paths that escape dir and caps the read at MaxDockerfileBytes.
Types ¶
type ContainerScanner ¶
type ContainerScanner struct {
// contains filtered or unexported fields
}
func NewContainerScanner ¶
func NewContainerScanner() *ContainerScanner
func (*ContainerScanner) Close ¶
func (s *ContainerScanner) Close() error
func (*ContainerScanner) Name ¶
func (s *ContainerScanner) Name() string
func (*ContainerScanner) Type ¶
func (s *ContainerScanner) Type() core.ScanType