dissect.target.plugins.apps.container.podman

Module Contents

Classes

ContainerState

Enum of possible Container states.

PodmanPlugin

Parse Podman artefacts.

Functions

Attributes

dissect.target.plugins.apps.container.podman.PodmanImageRecord
dissect.target.plugins.apps.container.podman.PodmanContainerRecord
dissect.target.plugins.apps.container.podman.PodmanLogRecord
class dissect.target.plugins.apps.container.podman.ContainerState

Bases: enum.Enum

Enum of possible Container states.

References

NONE = None
UNKNOWN = 0
CONFIGURED = 1
CREATED = 2
RUNNING = 3
STOPPED = 4
PAUSED = 5
EXITED = 6
REMOVING = 7
STOPPING = 8
dissect.target.plugins.apps.container.podman.RE_CTR_LOG
class dissect.target.plugins.apps.container.podman.PodmanPlugin(target: dissect.target.target.Target)

Bases: dissect.target.plugins.apps.container.container.ContainerPlugin

Parse Podman artefacts.

References

__namespace__ = 'podman'

Defines the plugin namespace.

SYSTEM_PATHS = ('/var/lib/containers', 'sysvol/ProgramData/containers', 'sysvol/Program Files/RedHat/Podman/containers')
USER_PATHS = ('.local/share/containers',)
installs
find_installs() collections.abc.Iterator[tuple[pathlib.Path, dissect.target.plugins.general.users.UserDetails | None]]
check_compatible() None

Perform a compatibility check with the target.

This function should return None if the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise an UnsupportedPluginError.

Raises:

UnsupportedPluginError – If the plugin could not be loaded.

images() collections.abc.Iterator[PodmanImageRecord]

Yield any pulled Podman images on the target system.

containers() collections.abc.Iterator[PodmanContainerRecord]

Yield any Podman containers on the target system.

Uses the $PODMAN/storage/db.sql SQLite3 database and $PODMAN/storage/overlay-containers folder. Does not support legacy (v3 and older) BoltDB Podman databases.

logs() collections.abc.Iterator[PodmanLogRecord]

Returns log files (stdout/stderr) from Podman containers.

Podman is configured by default to log towards syslog or journald. This function parses non-default k8s-file and json-file log driver settings.

Note that json-file is an alias of k8s-file and does not actually produce JSON output.

Currently does not parse custom configuration in containers.conf for log_opt path values.

References

dissect.target.plugins.apps.container.podman.convert_ports(ports: dict[str, list | dict]) collections.abc.Iterator[str]