-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This resolves #226 This change does the following: 1. Replace python's tarfile with a call to the system's tar utility. We do this to take advantage of the CVE-2013-4420 fix to libtar. Python's tarfile module has a fix in the workings but is yet to be merged as of this change. 2. We check for EOF errors and empty tarballs. This is mostly to address a few instances where we have seen Docker images that were malformed. 3. We modify some functions around loading and analyzing Docker images and layers including catching the extra errors that we raise for No. 2. - rootfs: Moved some functionality from check_tar_permissions into a new function called shell_command. This function simply runs shell commands as the current user and returns the result and error to be dealt by the calling function. - rootfs: check_tar_permissions will now use shell_command. - rootfs: Created a new function called check_tar_members which will list the elements in the tarball to see if there are any EOF or empty tarballs. - rootfs: Repurposed extract_layer_tar to be a general purpose extract_tarfile function which can be used throughout the code. - container: Use extract_tarfile to extract image metadata. - image_layer: Use extract_tarfile to extract image layer tarballs. - analyze: Set up mount points after the image is loaded. - report: In general setup, don't create directories. extract_tarfile will now do it. - report: Catch all the appropriate errors that might get thrown when trying to load an image. Signed-off-by: Nisha K <[email protected]>
- Loading branch information
Showing
5 changed files
with
49 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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