Skip to content

Commit 56be312

Browse files
authored
Adding docs (#138)
* Add docs for similar tools. * update readme * Explicitly mention docker-compatible socket requirement. * update doc
1 parent 6b6c9a8 commit 56be312

2 files changed

Lines changed: 62 additions & 111 deletions

File tree

README.md

Lines changed: 19 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -5,137 +5,45 @@
55
[![PyPI version](https://badge.fury.io/py/it-depends.svg)](https://badge.fury.io/py/it-depends)
66
[![Slack Status](https://slack.empirehacking.nyc/badge.svg)](https://slack.empirehacking.nyc)
77

8-
It-Depends is a tool to automatically build a dependency graph and Software Bill of Materials (SBOM) for packages and arbitrary source code repositories. You can use it to enumerate all third party dependencies for a software package, map those dependencies to known security vulnerabilities, as well as compare the similarity between two packages based on their dependencies.
8+
It-Depends is a tool to automatically build a dependency graph and Software Bill of Materials (SBOM) for packages and arbitrary source code repositories. It supports Go, JavaScript, Rust, Python, C/C++ (cmake and autotools), and Ubuntu packages.
99

10-
To the best of our knowledge, It-Depends is the only such tool with the following features:
10+
What makes it different from [similar tools](SIMILAR.md):
1111

12-
* Support for C/C++ projects (both autootools and cmake)
13-
* Automated resolution of native library dependencies partially based on dynamic analysis (_e.g._, the Python package `pytz` depends on the native library `libtinfo.so.6`)
14-
* Enumeration of _all possible_ dependency resolutions, not just a _single feasible_ resolution
15-
* A comparison metric for the similarity between two packages based on their dependency graph
12+
* Resolves _all possible_ dependency versions, not just a single feasible resolution
13+
* C/C++ support via cmake and autotools without building the project
14+
* Automated native library dependency mapping via dynamic analysis (_e.g._, `pytz` depends on `libtinfo.so.6`)
15+
* Vulnerability scanning against the [OSV database](https://osv.dev/)
16+
* Dependency similarity comparison between packages
1617

17-
## Features
18-
19-
* Supports Go, JavaScript, Rust, Python, and C/C++ projects.
20-
* Accepts source code repositories or package specifications like `pip:it-depends`
21-
* Extracts dependencies of cmake/autotool repostories without building it
22-
* Finds native dependencies for high level languages like Python or JavaScript
23-
* Provides visualization based on vis.js or dot
24-
* Matches dependencies and CVEs
25-
* Export Software Bills of Materials (SBOMs)
26-
* Machine-intelligible JSON output
27-
* Support for the SPDX standard is [in active development](https://github.com/trailofbits/it-depends/tree/dev/spdx)
28-
29-
### Can It-Depends Do It? It Depends.
30-
31-
* It-Depends does not detect vendored or copy/pasted dependencies
32-
* Results from build systems like autotools and cmake that entail arbitrary computation at install time are
33-
best-effort
34-
* Resolution of native dependencies is best-effort
35-
* Some native dependencies are resolved through dynamic analysis
36-
* Native dependencies are inferred by cross-referencing file requirements against paths provided by the Ubuntu
37-
package repository; dependencies may be different across other Linux distributions or Ubuntu versions
38-
* It-Depends attempts to resolve _all_ possible package versions that satisfy a dependency
39-
* It-Depends _does not_ find a single satisfying package resolution
40-
* The list of resolved packages is intended to be a superset of the packages required by the installation of
41-
a package on any system
42-
* The `--audit` feature may discover vulnerabilities in upstream dependencies that are either not exploitable in the
43-
target package or are in a package version that cannot exist in any valid dependency resolution of the target
44-
package
45-
* It-Depends caches data that it expects to be immutable in a local database
46-
* If a package is ever deleted or yanked from a package repository after it was already cached, It-Depends will
47-
continue to use the cached data unless the cache is cleared with `--clear-cache`
48-
49-
## Quickstart
18+
## Installation
5019

5120
```shell
5221
pip3 install it-depends
53-
python -c "import it_depends as it; print(it.__version__)"
54-
```
55-
56-
### Running it
57-
58-
Run `it-depends` in the root of the source repository you would like to analyze:
59-
60-
```shell
61-
cd /path/to/project
62-
it-depends .
63-
```
64-
65-
or alternatively point it to the path directly:
66-
67-
```shell
68-
it-depends /path/to/project
69-
```
70-
71-
or alternatively specify a package from a public package repository:
72-
73-
```shell
74-
it-depends "pip:numpy"
75-
it-depends "ubuntu:libc6@2.31"
76-
it-depends "npm:lodash@>=4.17.0"
7722
```
7823

79-
To list resolvers compatible for the specified target, use the `--list` option:
24+
Ecosystem-specific tools must be installed separately: `npm` for JavaScript, `cargo` for Rust, `pip` for Python, `autotools`/`cmake` for C/C++. Native dependency resolution and Ubuntu package analysis require a Docker-compatible container runtime with an accessible socket (_e.g._, Docker Desktop, Podman, or Colima).
8025

81-
```shell
82-
it-depends . --list
83-
```
84-
85-
It-Depends will output the full dependency hierarchy in JSON format. Additional output formats such
86-
as Graphviz/Dot are available via the `--output-format` option.
87-
88-
It-Depends can automatically try to match packages against the [OSV vulnerability database](https://osv.dev/) with the
89-
`--audit` option. This is a best-effort matching as it is based on package names, which might not always consistent.
90-
Any discovered vulnerabilities are added to the JSON output.
91-
92-
It-Depends attempts to parallelize as much of its effort as possible. To limit the maximum number of parallel tasks, use
93-
the `--max-workers` option.
94-
95-
By default, It-Depends recursively resolves all packages' dependencies to construct a complete dependency graph. The
96-
depth of the recursion can be limited using the `--depth-limit` option. For example,
26+
## Usage
9727

9828
```shell
99-
it-depends pip:graphtage --depth-limit 1
29+
it-depends . # Analyze current directory
30+
it-depends /path/to/project # Analyze a source repository
31+
it-depends "pip:numpy" # Analyze a pip package
32+
it-depends "ubuntu:libc6@2.31" # Analyze an Ubuntu package
33+
it-depends "npm:lodash@>=4.17.0" # Specify a version constraint
34+
it-depends --audit pip:numpy # Include vulnerability audit
35+
it-depends . --list # List compatible resolvers
36+
it-depends --output-format dot . # Output as Graphviz/Dot
37+
it-depends --depth-limit 1 pip:numpy # Only direct dependencies
10038
```
10139

102-
will only enumerate the direct dependencies of Graphtage.
103-
104-
### Examples
105-
106-
Here is an example of running It-Depends on its own source repository:
107-
![](https://gist.githubusercontent.com/feliam/e906ce723333b2b55237a71c4028559e/raw/e60f46c35b215a73a37a1d1ce3bb43eaead76af4/it-depends-demo.svg?sanitize=1)
108-
109-
This is the resulting [json](https://gist.github.com/feliam/2bdec76f7aa50602869059bfa14df156)
110-
with all the discovered dependencies.
111-
This is the resulting [Graphviz dot file](https://gist.github.com/feliam/275951f5788c23a477bc7cf758a32cc2)
112-
producing this
113-
![dependency graph](https://user-images.githubusercontent.com/1017522/116887041-33903b80-ac00-11eb-9288-f3d286231e47.png)
114-
115-
This is the resulting dependency graph:
116-
![dependency graph](https://user-images.githubusercontent.com/1017522/126380710-0bf4fd66-0d2f-4cb1-a0ff-96fe715c4981.png)
117-
118-
### It-Depends' Dependencies
119-
120-
* JavaScript requires `npm`
121-
* Rust requires `cargo`
122-
* Python requires `pip`
123-
* C/C++ requires `autotools` and/or `cmake`
124-
* Several native dependencies are resolved using Ubuntu’s file to path database `apt-file`, but this is seamlessly handled through an Ubuntu `docker` container on other distributions and operating systems
125-
* Currently `docker` is used to resolve native dependencies
126-
12740
## Development
12841

12942
```shell
13043
git clone https://github.com/trailofbits/it-depends
13144
cd it-depends
13245
make dev
13346
uv run it-depends --help
134-
```
135-
136-
Format and lint code before contributing
137-
138-
```shell
13947
make format lint
14048
```
14149

SIMILAR.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Similar Tools
2+
3+
It-Depends is a dependency analyzer that builds complete dependency graphs and SBOMs. Unlike most tools in this space, it resolves *all possible* dependency versions (not just a single feasible resolution), supports C/C++ projects via cmake/autotools, and maps native library dependencies through dynamic analysis.
4+
5+
This document compares it to related tools across several categories.
6+
7+
## Comparison
8+
9+
| Tool | Type | All-version resolution | C/C++ support | Native lib mapping | SBOM | Vuln scanning | Open source |
10+
|------|------|:---:|:---:|:---:|:---:|:---:|:---:|
11+
| **It-Depends** | Dependency analyzer | Yes | Yes | Yes | Yes | Yes | Yes |
12+
| [Syft](https://github.com/anchore/syft) | SBOM generator | No | No | No | Yes | No | Yes |
13+
| [Trivy](https://github.com/aquasecurity/trivy) | SBOM / scanner | No | No | No | Yes | Yes | Yes |
14+
| [Grype](https://github.com/anchore/grype) | Vuln scanner | No | No | No | No | Yes | Yes |
15+
| [OSV-Scanner](https://github.com/google/osv-scanner) | Vuln scanner | No | No | No | Yes | Yes | Yes |
16+
| [ORT](https://github.com/oss-review-toolkit/ort) | SCA / compliance | No | Partial | No | Yes | Yes | Yes |
17+
| [Snyk](https://snyk.io/) | SCA platform | No | Partial | No | Yes | Yes | No |
18+
| [OWASP Dep-Check](https://github.com/jeremylong/DependencyCheck) | SCA / vuln scanner | No | No | No | Yes | Yes | Yes |
19+
| [Dependabot](https://github.com/dependabot) | Dependency updater | No | No | No | No | No | Yes |
20+
| [Renovate](https://github.com/renovatebot/renovate) | Dependency updater | No | No | No | No | No | Yes |
21+
22+
## Categories
23+
24+
### SBOM Generators
25+
26+
- **[Syft](https://github.com/anchore/syft)** -- Generates SBOMs from container images and filesystems. Supports CycloneDX and SPDX formats. Focused on cataloging what's installed rather than resolving dependency trees.
27+
- **[Trivy](https://github.com/aquasecurity/trivy)** -- All-in-one security scanner for containers, filesystems, and git repositories. Generates SBOMs and scans for vulnerabilities, misconfigurations, and secrets.
28+
29+
### Dependency Analysis / SCA
30+
31+
- **[ORT](https://github.com/oss-review-toolkit/ort)** (OSS Review Toolkit) -- Comprehensive open-source compliance toolchain. Analyzes dependencies, scans for licenses, and generates reports. Broad ecosystem support but resolves a single dependency tree.
32+
- **[Snyk](https://snyk.io/)** -- Commercial SCA platform that monitors dependencies for vulnerabilities. Integrates with CI/CD pipelines and provides fix suggestions. Closed-source core.
33+
- **[OWASP Dependency-Check](https://github.com/jeremylong/DependencyCheck)** -- Identifies known vulnerabilities in project dependencies by cross-referencing against the NVD. Primarily Java-focused but supports other ecosystems.
34+
35+
### Vulnerability Scanners
36+
37+
- **[Grype](https://github.com/anchore/grype)** -- Vulnerability scanner for container images and filesystems. Pairs with Syft for SBOM-based scanning. Fast and focused on matching packages to CVEs.
38+
- **[OSV-Scanner](https://github.com/google/osv-scanner)** -- Google's scanner that matches dependencies against the OSV vulnerability database. Supports lockfile and SBOM input. It-Depends uses the same OSV database for its `--audit` feature.
39+
40+
### Dependency Update Bots
41+
42+
- **[Dependabot](https://github.com/dependabot)** -- GitHub-native bot that opens PRs to update outdated or vulnerable dependencies. Operates as a CI integration, not a standalone analysis tool.
43+
- **[Renovate](https://github.com/renovatebot/renovate)** -- Automated dependency update tool supporting many platforms and ecosystems. Highly configurable. Like Dependabot, it updates dependencies rather than analyzing them.

0 commit comments

Comments
 (0)