{"id":20148290,"url":"https://github.com/chainguard-dev/darkfiles","last_synced_at":"2025-05-06T22:30:46.660Z","repository":{"id":61687042,"uuid":"530471961","full_name":"chainguard-dev/darkfiles","owner":"chainguard-dev","description":"Darkfiles finds orphaned files in container images and makes them to bad deeds","archived":true,"fork":false,"pushed_at":"2023-05-11T20:46:15.000Z","size":201,"stargazers_count":41,"open_issues_count":6,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-17T15:58:30.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chainguard-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-30T02:42:22.000Z","updated_at":"2024-06-17T20:07:47.000Z","dependencies_parsed_at":"2023-01-22T06:19:44.755Z","dependency_job_id":null,"html_url":"https://github.com/chainguard-dev/darkfiles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fdarkfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fdarkfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fdarkfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chainguard-dev%2Fdarkfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chainguard-dev","download_url":"https://codeload.github.com/chainguard-dev/darkfiles/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252778858,"owners_count":21802839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T22:36:47.327Z","updated_at":"2025-05-06T22:30:46.201Z","avatar_url":"https://github.com/chainguard-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# darkfiles: Measure container image dark matter\n\n\u003cimg src=\"https://user-images.githubusercontent.com/3935899/187793479-eb09b826-2e8a-486d-a9d5-fbdfdfa80691.png\" /\u003e\n\nContainer images are often assembled by copying files straight\nto their layers: examples include (but are not limited to) copying applications from\nbuild images or copying entrypoint scripts. These files are\nnot tracked by the underlying operating system (OS) package managers like apt or apk,\nwhich makes them invisible to security scanners since they are\nnot reflected in the package database.\n\nTo gain insight into this \"dark matter,\" `darkfiles` inspects\ncontainer images to detect files not tracked by the OS package manager.\n\n## Usage \n\nJust run `darkfiles stats imageref` to get some statistics about\nfiles not installed via the OS package manager. Here is an example\nscanning both the \n[official](https://github.com/docker-library/golang) and \n[distroless golang](https://github.com/distroless/go) images: \n\n```\ndarkfiles stats --distro=debian golang:latest\nINFO flattening image index.docker.io/library/golang \nINFO flattened image to /tmp/image-dump-582865974.tar (962 MB) \nTotal files in image:       21033\nFiles in packages:          8807\nFiles not in packages:      12226\nTracked by package manager: 41.872295%\n\ndarkfiles stats --distro=alpine distroless.dev/go\nINFO flattening image distroless.dev/go           \nINFO flattened image to /tmp/image-dump-7982759.tar (540 MB) \nTotal files in image:       5734\nFiles in packages:          5734\nFiles not in packages:      0\nTracked by package manager: 100.000000%\n```\n\nThere is also `darkfiles list --set=all imageref` which returns all files included in an image (`--set=all`), files tracked\nby the package manager (`--set=tracked`) and all files found in\nthe image which were added through other means (`--set=untracked`):\n\n```\ndarkfiles --distro=debian --set=untracked golang\nINFO[0000] flattening image index.docker.io/library/golang \nINFO[0021] flattenned image to /tmp/image-dump-2645404725.tar (962 MB) \n\n/usr/local/go/CONTRIBUTING.md\n/usr/local/go/LICENSE\n/usr/local/go/PATENTS\n/usr/local/go/README.md\n/usr/local/go/SECURITY.md\n/usr/local/go/VERSION\n/usr/local/go/api/README\n/usr/local/go/api/except.txt\n/usr/local/go/api/go1.1.txt\n/usr/local/go/api/go1.10.txt\n/usr/local/go/api/go1.11.txt\n/usr/local/go/api/go1.12.txt\n/usr/local/go/api/go1.13.txt\n/usr/local/go/api/go1.14.txt\n/usr/local/go/api/go1.15.txt\n/usr/local/go/api/go1.16.txt\n/usr/local/go/api/go1.17.txt\n/usr/local/go/api/go1.18.txt\n/usr/local/go/api/go1.19.txt\n/usr/local/go/api/go1.2.txt\n/usr/local/go/api/go1.3.txt\n/usr/local/go/api/go1.4.txt\n/usr/local/go/api/go1.5.txt\n... \n```\n\n## TODO\n\n### Automatic distro detection\n\nRight now, specifying --distro is mandatory, it would be nice to \nhave logic to automatically detect what kind of OS the image is\nbased on.\n\n### Filter disable flag\n\nThere should be a flag to disable file filtering to get absolutel\nall files.\n\n### Expand stats output with:\n\n* Number of files before and after filtering\n* Image size\n\n### Enable `--format=json` in stats subcommand\n\n### ~apk support~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainguard-dev%2Fdarkfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchainguard-dev%2Fdarkfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchainguard-dev%2Fdarkfiles/lists"}