Documentation
¶
Overview ¶
Package utils is a compliance internal submodule implementing various utilities.
Index ¶
- func GetContainerOverlayPath(pid int32) (string, error)
- func GetFileGroup(fi os.FileInfo) string
- func GetFileUser(fi os.FileInfo) string
- func GetProcessRootPath(pid int32) (string, bool)
- func ReadProcessFileLimit(proc Process, root *os.Root, name string, maxFileSize int64) ([]byte, os.FileInfo, error)
- func RootedGlob(hostroot string, glob string) []string
- type ContainerID
- type Process
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContainerOverlayPath ¶
GetContainerOverlayPath tries to extract the directory mounted as root mountpoint of the given process. To do so it parses the mountinfo table of the process and tries to match it with the mount entry of the root namespace (mountinfo pid 1).
func GetProcessRootPath ¶
GetProcessRootPath returns the process root path of the given PID.
func ReadProcessFileLimit ¶
func ReadProcessFileLimit(proc Process, root *os.Root, name string, maxFileSize int64) ([]byte, os.FileInfo, error)
ReadProcessFileLimit reads a file from a process's file system. It will resolve it using the provided *os.Root, and check that the file is properly accessible by the process.
func RootedGlob ¶
Types ¶
type ContainerID ¶
type ContainerID string
ContainerID wraps a string representing a container identifier.
func GetProcessContainerID ¶
func GetProcessContainerID(pid int32) (ContainerID, bool)
GetProcessContainerID returns the container ID associated with the given process ID. Returns an empty string if no container found.