-
Notifications
You must be signed in to change notification settings - Fork 71
Add Podman and OCI container support #1096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Schamper
merged 22 commits into
fox-it:main
from
JSCU-CNI:feature/add-podman-container-support
Jul 21, 2025
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2dfb759
add Podman and OCI container support
JSCU-CNI 451f263
fix ruff for now
JSCU-CNI 100a81c
Merge branch 'main' into feature/add-podman-container-support
JSCU-CNI 4e87be6
Merge branch 'main' into feature/add-podman-container-support
JSCU-CNI 606a498
Merge branch 'main' into feature/add-podman-container-support
JSCU-CNI 6066f29
Merge branch 'main' into feature/add-podman-container-support
JSCU-CNI 219b703
Merge branch 'main' into feature/add-podman-container-support
JSCU-CNI e182358
Apply suggestions from code review
JSCU-CNI 86115a4
implement review comments
JSCU-CNI 8f855cf
fix self.layers list[Path] assignment
JSCU-CNI c5d4190
fix tests
JSCU-CNI 3348a32
Update dissect/target/loaders/containerimage.py
JSCU-CNI 59028a8
implement podman.logs
JSCU-CNI c28b331
Update dissect/target/plugins/apps/container/podman.py
JSCU-CNI 81dddf3
add test file correctly
JSCU-CNI 589fa14
Merge branch 'main' into feature/add-podman-container-support
Schamper ad8bc71
add support for podman v3 container discovery
JSCU-CNI 8269188
Apply suggestions from code review
JSCU-CNI 74a5a70
remove unused arguments and fix pylance
JSCU-CNI 7abe34d
Merge branch 'main' into feature/add-podman-container-support
JSCU-CNI 9a21f2b
fix tests
JSCU-CNI 45d11c3
fix benchmark test
JSCU-CNI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import TYPE_CHECKING | ||
|
|
||
| from dissect.target.filesystems.overlay import Overlay2Filesystem | ||
| from dissect.target.loader import Loader | ||
|
|
||
| if TYPE_CHECKING: | ||
| from dissect.target.helpers.fsutil import TargetPath | ||
| from dissect.target.target import Target | ||
|
|
||
|
|
||
| class Overlay2Loader(Loader): | ||
| """Load Docker overlay2 filesystems.""" | ||
|
|
||
| @staticmethod | ||
| def detect(path: TargetPath) -> bool: | ||
| # path should be a folder | ||
| if not path.is_dir(): | ||
| return False | ||
|
|
||
| # with the following three files | ||
| for required_file in ["init-id", "parent", "mount-id"]: | ||
| if not path.joinpath(required_file).exists(): | ||
| return False | ||
|
|
||
| # and should have the following parent folders | ||
| return "image/overlay2/layerdb/mounts/" in path.as_posix() | ||
|
|
||
| def map(self, target: Target) -> None: | ||
| target.filesystems.add(Overlay2Filesystem(self.absolute_path)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from dissect.target.plugin import NamespacePlugin | ||
|
|
||
| COMMON_IMAGE_FIELDS = [ | ||
| ("string", "name"), | ||
| ("string", "tag"), | ||
| ("string", "image_id"), | ||
| ("string", "hash"), | ||
| ("datetime", "created"), | ||
| ("path", "source"), | ||
| ] | ||
|
|
||
| COMMON_CONTAINER_FIELDS = [ | ||
| ("string", "container_id"), | ||
| ("string", "image"), | ||
| ("string", "image_id"), | ||
| ("string", "command"), | ||
| ("datetime", "created"), | ||
| ("boolean", "running"), | ||
| ("varint", "pid"), | ||
| ("datetime", "started"), | ||
| ("datetime", "finished"), | ||
| ("string[]", "ports"), | ||
| ("string", "names"), | ||
| ("string[]", "volumes"), | ||
| ("string[]", "environment"), | ||
| ("path", "mount_path"), | ||
| ("path", "config_path"), | ||
| ("path", "image_path"), | ||
| ("path", "source"), | ||
| ] | ||
|
|
||
| COMMON_LOG_FIELDS = [ | ||
| ("datetime", "ts"), | ||
| ("string", "container"), | ||
| ("string", "stream"), | ||
| ("string", "message"), | ||
| ("path", "source"), | ||
| ] | ||
|
|
||
|
|
||
| class ContainerPlugin(NamespacePlugin): | ||
| __namespace__ = "container" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.