In my postForensicating Docker, Part 1back in March (yes, I promise a Part 2 in the next couple of months, the $dayjob has slowed that down a bit), I talked a little about the AUFS layered filesystem that was used by the docker install on the system I was investigating. While I was forensicating the case I talked about in that diary, I wanted to see what the container filesystem looked like from my SIFT VM so I wrote a script to do the mounting the same way docker does (except for forensic purposes the mount is read-only). The script can be foundhere. Unfortunately, docker can use multiple storage drivers. So far, Ive adapted the script to handle two/threeof them, AUFS and Overlay/Overlay2. AUFS is the default on (older?) versions of Ubuntu, but AUFS isnt included by default in RedHat (or derivates), you would have to compile your own kernel. Overlay2 is included in newer kernels (pretty much anything after 3.18), so I suspect it may become the default at some point in the future.These are the storage drivers that handle so called Union filesystems to handle the layering. The btrfs, zfs, and devicemapper storage drivers are all block-level rather than file-level storage drivers. In effect, they require separate devices/partitions/loop-mounted files taking advantage of filesystem features such as snapshots in the underlying filesystem drivers to handle the layering. While I think I can get btrfs into the script, I havent looked at zfs and Ive had difficutly with devicemapper, so Imay not be able to get all of these. See [3] and [4]" />
Having gone through all of that, for the purpose of forensication, it is important to remember that changes made within a container will all be captured in the top layer of these layered or union filesystems. To find that top layer (for docker " />
References:
[1]https://isc.sans.edu/forums/diary/Forensicating+Docker+Part+1/20835/
[2]https://github.com/clausing/docker-scripts
[3]https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/
[4]https://integratedcode.us/2016/08/30/storage-drivers-in-docker-a-deep-dive/
---------------
Jim Clausing, GIAC GSE #26
jclausing --at-- isc [dot] sans (dot) edu