:py:mod:`dissect.target.plugins.apps.container.podman` ====================================================== .. py:module:: dissect.target.plugins.apps.container.podman Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.plugins.apps.container.podman.ContainerState dissect.target.plugins.apps.container.podman.PodmanPlugin Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.target.plugins.apps.container.podman.convert_ports Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.target.plugins.apps.container.podman.PodmanImageRecord dissect.target.plugins.apps.container.podman.PodmanContainerRecord dissect.target.plugins.apps.container.podman.PodmanLogRecord dissect.target.plugins.apps.container.podman.RE_CTR_LOG .. py:data:: PodmanImageRecord .. py:data:: PodmanContainerRecord .. py:data:: PodmanLogRecord .. py:class:: ContainerState Bases: :py:obj:`enum.Enum` Enum of possible Container states. .. rubric:: References - https://github.com/containers/podman/blob/v4.9/libpod/define/containerstate.go .. py:attribute:: NONE :value: None .. py:attribute:: UNKNOWN :value: 0 .. py:attribute:: CONFIGURED :value: 1 .. py:attribute:: CREATED :value: 2 .. py:attribute:: RUNNING :value: 3 .. py:attribute:: STOPPED :value: 4 .. py:attribute:: PAUSED :value: 5 .. py:attribute:: EXITED :value: 6 .. py:attribute:: REMOVING :value: 7 .. py:attribute:: STOPPING :value: 8 .. py:data:: RE_CTR_LOG .. py:class:: PodmanPlugin(target: dissect.target.target.Target) Bases: :py:obj:`dissect.target.plugins.apps.container.container.ContainerPlugin` Parse Podman artefacts. .. rubric:: References - https://docs.podman.io/en/latest/_static/api.html .. py:attribute:: __namespace__ :value: 'podman' Defines the plugin namespace. .. py:attribute:: SYSTEM_PATHS :value: ('/var/lib/containers', 'sysvol/ProgramData/containers', 'sysvol/Program Files/RedHat/Podman/containers') .. py:attribute:: USER_PATHS :value: ('.local/share/containers',) .. py:attribute:: installs .. py:method:: find_installs() -> collections.abc.Iterator[tuple[pathlib.Path, dissect.target.plugins.general.users.UserDetails | None]] .. py:method:: 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 :class:`UnsupportedPluginError`. :raises UnsupportedPluginError: If the plugin could not be loaded. .. py:method:: images() -> collections.abc.Iterator[PodmanImageRecord] Yield any pulled Podman images on the target system. .. py:method:: 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. .. py:method:: 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. .. rubric:: References - https://docs.podman.io/en/latest/markdown/podman-create.1.html#log-driver-driver .. py:function:: convert_ports(ports: dict[str, list | dict]) -> collections.abc.Iterator[str]