containerscan

package
v0.0.0-...-5c50890 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustReg

func CustReg(scanOut, regString string) []string

CustReg takes 2 arguments and returns a string slice.

scanOut is the string output from the container /proc/$PID/mountinfo file.

regString is the `raw string` containing the regex match pattern to use.

func CustSplit

func CustSplit(s, d string, i int) string

CustSplit takes 3 parameters and returns a string. s is the string to split. d is the delimiter by which to split s. i is the slice index of the string to return, if applicable. Usually 1 or 0. If the string was not split, the original string is returned idempotently.

func GetLayerInfo

func GetLayerInfo(mountPath string) (string, error)

GetLayerInfo reads /host/proc/<PID>/mountinfo and returns the line containing OverlayFS mount directories.

func GetRootFS

func GetRootFS(containerID string) (string, error)

GetRootFS returns the root file system path for a container returned by "runc state <containerID>"

func MountOverlayFS

func MountOverlayFS(layers []string, cID string) (string, error)

MountOverlayFS takes a slice of strings containing OverlayFS layer paths and mounts them to a read-only /mnt dir named after their container ID.

func PrepCrioScan

func PrepCrioScan(cCon models.Status)

PrepCrioScan gets a slice of container filesystem layers from getCrioLayers and then initiates a scan for each of the returned layers.

func PrepDockerScan

func PrepDockerScan(dCon docker.DockerContainer)

PrepDockerScan gets a slice of container filesystem layers from getDockerLayers and then initiates a scan for each of the returned layers.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL