GithubHelp home page GithubHelp logo

5l1v3r1 / toolkit-3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from docker-forensics-toolkit/toolkit

0.0 1.0 0.0 9.84 MB

A toolkit for the post-mortem examination of Docker containers from forensic HDD copies

License: Apache License 2.0

Python 99.55% Dockerfile 0.08% Awk 0.36%

toolkit-3's Introduction

A Docker forensics toolkit

This repo contains a toolkit for performing post-mortem analysis of Docker runtime environments based on forensic HDD copies of the docker host system.

Logo

Build Status

Features

  • mount-image Mounts the forensic image of the docker host
  • status Prints status information about the container runtime
  • list-images Prints images found on the computer
  • show-image-history Displays the build history of an image
  • show-image-config Pretty prints the full config file of an image
  • list-containers Prints containers found on the computer
  • show-container-log Displays the latest container logfiles
  • show-container-config Pretty prints the combined container specific config files (config.v2.json and hostconfig.json).
  • mount-container Mounts the file system of a given container at the given location (overlay2 only)
  • macrobber-container-layer Extracts file system metadata from the container layer of the given container. Use the output with the 'mactime' tool to create a timeline.
  • macrobber-volumes Extracts file system metadata from the volumes of the given container. Use the output with the 'mactime' tool to create a timeline.
  • carve-for-deleted-docker-files Carves the image for deleted Docker files, such as container configs,Dockerfiles and deleted log files. Requires 'scalpel' to be installed.

See usage.md for a tour of the features.

Development

git-lfs is required to check out this repository. Use whatever editor you like.

Testing

Testing this tool in integration with a real Docker host image is complicated because:

  • Mounting images typically requires root permissions
  • Tests need to be executed as root to be able to read files owned by root on the Docker Host file system

Therefore there are two ways to test this tool: one with a real docker Host Image and one with a temporary folder containing select files from a Docker Host image (created by running the create_zipfile_from_testimage.py script. For local development it's recommended to use the first way while CI may use the latter.

Coverage

For a code coverage report run:

pytest --cov-report term-missing --cov=src tests/

Testing with a real Docker Host Image

  1. Mount the Docker Host image by running:

    sudo python src/dof/main.py mount-image testimages/alpine-host/output-virtualbox-iso/packer-virtualbox-iso-*-disk001.vmdk.raw

Note the mountpoint of the root Partition in the output:

Mounted volume 4.3 GiB 4:Ext4 / [Linux] on /tmp/test-4-root-2.
  1. Run the pytest command as root with the image-mountpoint as parameter

    sudo pytest --image-mountpoint=/tmp/test-4-root-2

Distribution

The toolkit is distributed as a runnable 'fat' binary, bundled with a Python interpreter. The binary is created by PyInstaller. To create such a binary run:

pyinstaller dof.spec

toolkit-3's People

Contributors

johanneswseitz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.