• Stars
    star
    313
  • Rank 129,347 (Top 3 %)
  • Language
    Python
  • License
    GNU Lesser Genera...
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool to automatically build a dependency graph and Software Bill of Materials (SBOM) for packages and arbitrary source code repositories.

It-Depends

PyPI version Tests Slack Status

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.

To the best of our knowledge, It-Depends is the only such tool with the following features:

  • Support for C/C++ projects (both autootools and cmake)
  • 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)
  • Enumeration of all possible dependency resolutions, not just a single feasible resolution
  • A comparison metric for the similarity between two packages based on their dependency graph

Features ⭐

  • Supports Go, JavaScript, Rust, Python, and C/C++ projects.
  • Accepts source code repositories or package specifications like pip:it-depends
  • Extracts dependencies of cmake/autotool repostories without building it
  • Finds native dependencies for high level languages like Python or JavaScript
  • Provides visualization based on vis.js or dot
  • Matches dependencies and CVEs
  • Export Software Bills of Materials (SBOMs)

Can It-Depends Do It? It Depends. πŸ‹

  • It-Depends does not detect vendored or copy/pasted dependencies
  • Results from build systems like autotools and cmake that entail arbitrary computation at install time are best-effort
  • Resolution of native dependencies is best-effort
    • Some native dependencies are resolved through dynamic analysis
    • Native dependencies are inferred by cross-referencing file requirements against paths provided by the Ubuntu package repository; dependencies may be different across other Linux distributions or Ubuntu versions
  • It-Depends attempts to resolve all possible package versions that satisfy a dependency
    • It-Depends does not find a single satisfying package resolution
    • The list of resolved packages is intended to be a superset of the packages required by the installation of a package on any system
    • The --audit feature may discover vulnerabilities in upstream dependencies that are either not exploitable in the target package or are in a package version that cannot exist in any valid dependency resolution of the target package
  • It-Depends caches data that it expects to be immutable in a local database
    • If a package is ever deleted or yanked from a package repository after it was already cached, It-Depends will continue to use the cached data unless the cache is cleared with --clear-cache

Quickstart πŸš€

$ pip3 install it-depends

Running it πŸƒ

Run it-depends in the root of the source repository you would like to analyze:

$ cd /path/to/project
$ it-depends

or alternatively point it to the path directly:

$ it-depends /path/to/project

or alternatively specify a package from a public package repository:

$ it-depends pip:numpy
$ it-depends apt:[email protected]
$ it-depends npm:lodash@>=4.17.0

It-Depends will output the full dependency hierarchy in JSON format. Additional output formats such as Graphviz/Dot are available via the --output-format option.

It-Depends can automatically try to match packages against the OSV vulnerability database with the --audit option. This is a best-effort matching as it is based on package names, which might not always consistent. Any discovered vulnerabilities are added to the JSON output.

It-Depends attempts to parallelize as much of its effort as possible. To limit the maximum number of parallel tasks, use the --max-workers option.

By default, It-Depends recursively resolves all packages' dependencies to construct a complete dependency graph. The depth of the recursion can be limited using the --depth-limit option. For example,

$ it-depends pip:graphtage --depth-limit 1

will only enumerate the direct dependencies of Graphtage.

Examples πŸ§‘β€πŸ«

Here is an example of running It-Depends on its own source repository:

This is the resulting json with all the discovered dependencies. This is the resulting Graphviz dot file producing this dependency graph

This is the resulting dependency graph: dependency graph

It-Depends’ Dependencies 🎭

JavaScript requires npm
Rust requires cargo
Python requires pip
C/C++ requires autotools and/or cmake
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
Currently docker is used to resolve native dependencies

Development πŸ‘·

$ git clone https://github.com/trailofbits/it-depends
$ cd it-depends
$ python3 -m venv venv  # Optional virtualenv
$ ./venv/bin/activate   # Optional virtualenv
$ pip3 install -e '.[dev]'
$ git config core.hooksPath ./hooks  # Optionally enable git commit hooks for linting

License and Acknowledgements πŸ“ƒοΈ

This research was developed by Trail of Bits based upon work supported by DARPA under Contract No. HR001120C0084 (Distribution Statement A, Approved for Public Release: Distribution Unlimited). Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Government or DARPA.

Felipe Manzano and Evan Sultanik are the active maintainers, but Alessandro Gario, Eric Kilmer, Alexander Remie, and Henrik Brodin all made significant contributions to the tool’s inception and development.

It-Depends is licensed under the GNU Lesser General Public License v3.0. Contact us if you’re looking for an exception to the terms.

Β© 2021, Trail of Bits.

More Repositories

1

algo

Set up a personal VPN in the cloud
Jinja
27,779
star
2

manticore

Symbolic execution tool
Python
3,536
star
3

graphtage

A semantic diff utility and library for tree-like files such as JSON, JSON5, XML, HTML, YAML, and CSV.
Python
2,300
star
4

ctf

CTF Field Guide
C
1,273
star
5

publications

Publications from Trail of Bits
Python
1,232
star
6

deepstate

A unit test-like interface for fuzzing and symbolic execution
Python
806
star
7

pe-parse

Principled, lightweight C/C++ PE parser
C++
691
star
8

eth-security-toolbox

A Docker container preconfigured with all of the Trail of Bits Ethereum security tools.
Dockerfile
648
star
9

maat

Open-source symbolic execution framework: https://maat.re
C++
606
star
10

twa

A tiny web auditor with strong opinions.
Shell
579
star
11

winchecksec

Checksec, but for Windows: static detection of security mitigations in executables
C++
523
star
12

cb-multios

DARPA Challenges Sets for Linux, Windows, and macOS
C
498
star
13

polytracker

An LLVM-based instrumentation tool for universal taint tracking, dataflow analysis, and tracing.
C++
487
star
14

onesixtyone

Fast SNMP Scanner
C
411
star
15

tubertc

Peer-to-Peer Video Chat for Corporate LANs
JavaScript
361
star
16

krf

A kernelspace syscall interceptor and randomized faulter
C
346
star
17

vast

VAST is an experimental compiler pipeline designed for program analysis of C and C++. It provides a tower of IRs as MLIR dialects to choose the best fit representations for a program analysis or further program abstraction.
C++
340
star
18

fickling

A Python pickling decompiler and static analyzer
Python
330
star
19

polyfile

A pure Python cleanroom implementation of libmagic, with instrumented parsing from Kaitai struct and an interactive hex viewer
Python
322
star
20

sinter

A user-mode application authorization system for MacOS written in Swift
Swift
302
star
21

SecureEnclaveCrypto

Demonstration library for using the Secure Enclave on iOS
Swift
276
star
22

protofuzz

Google Protocol Buffers message generator
Python
262
star
23

dylint

A tool for running Rust lints from dynamic libraries
Rust
259
star
24

osquery-extensions

osquery extensions by Trail of Bits
C
256
star
25

constexpr-everything

Rewrite C++ code to automatically apply `constexpr` where possible
C++
245
star
26

binjascripts

Scripts for Binary Ninja
Python
241
star
27

RpcInvestigator

Exploring RPC interfaces on Windows
C#
236
star
28

audit-kubernetes

k8s audit repo
Go
226
star
29

mishegos

A differential fuzzer for x86 decoders
C++
219
star
30

semgrep-rules

Semgrep queries developed by Trail of Bits.
Go
197
star
31

circomspect

A static analyzer and linter for the Circom zero-knowledge DSL
Rust
186
star
32

PrivacyRaven

Privacy Testing for Deep Learning
Python
178
star
33

llvm-sanitizer-tutorial

An LLVM sanitizer tutorial
C++
177
star
34

siderophile

Find the ideal fuzz targets in a Rust codebase
Rust
171
star
35

flying-sandbox-monster

Sandboxed, Rust-based, Windows Defender Client
Rust
170
star
36

not-going-anywhere

A set of vulnerable Golang programs
Go
163
star
37

AppJailLauncher

CTF Challenge Framework for Windows 8 and above
C++
141
star
38

zkdocs

Interactive documentation on zero-knowledge proof systems and related primitives.
HTML
133
star
39

sienna-locomotive

A user-friendly fuzzing and crash triage tool for Windows
C++
132
star
40

uthenticode

A cross-platform library for verifying Authenticode signatures
C++
131
star
41

ObjCGraphView

A graph view plugin for Binary Ninja to visualize Objective-C
Python
127
star
42

Honeybee

An experimental high performance, fuzzing oriented Intel Processor Trace capture and analysis suite
C
124
star
43

sqlite_wrapper

An easy-to-use, extensible and lightweight C++17 wrapper for SQLite
C++
117
star
44

ctf-challenges

CTF Challenges
Python
112
star
45

ebpfpub

ebpfpub is a generic function tracing library for Linux that supports tracepoints, kprobes and uprobes.
C++
110
star
46

pasta

Peter's Amazing Syntax Tree Analyzer
C++
109
star
47

appjaillauncher-rs

AppJailLauncher in Rust
Rust
103
star
48

vscode-weaudit

Create code bookmarks and code highlights with a click.
TypeScript
103
star
49

test-fuzz

To make fuzzing Rust easy
Rust
100
star
50

on-edge

A library for detecting certain improper uses of the "Defer, Panic, and Recover" pattern in Go programs
Go
97
star
51

ios-integrity-validator

Integrity validator for iOS devices
Shell
97
star
52

BTIGhidra

Binary Type Inference Ghidra Plugin
Java
95
star
53

abi3audit

Scans Python packages for abi3 violations and inconsistencies
Python
94
star
54

ebpfault

A BPF-based syscall fault injector
C++
93
star
55

binrec-tob

BinRec: Dynamic Binary Lifting and Recompilation
C++
92
star
56

clang-cfi-showcase

Sample programs that illustrate how to use control flow integrity with the clang compiler
C++
92
star
57

blight

A framework for instrumenting build tools
Python
83
star
58

ManticoreUI

The Manticore User Interface with plugins for Binary Ninja and Ghidra
Python
71
star
59

bisc

Borrowed Instructions Synthetic Computation
Ruby
70
star
60

manticore-examples

Example Manticore scripts
Python
69
star
61

algo-ng

Experimental version of Algo built on Terraform
HCL
68
star
62

differ

Detecting Inconsistencies in Feature or Function Evaluations of Requirements
Python
64
star
63

deceptiveidn

Use computer vision to determine if an IDN can be interpreted as something it's not
Python
63
star
64

ruzzy

A coverage-guided fuzzer for pure Ruby code and Ruby C extensions
Ruby
61
star
65

necessist

A tool for finding bugs in tests
Rust
59
star
66

reverie

An efficient and generalized implementation of the IKOS-style KKW proof system (https://eprint.iacr.org/2018/475) for arbitrary rings.
Rust
57
star
67

magnifier

C++
56
star
68

awesome-ml-security

52
star
69

sixtyfour

How fast can we brute force a 64-bit comparison?
C
52
star
70

LeftoverLocalsRelease

The public release of LeftoverLocals code
C++
51
star
71

Codex-Decompiler

Python
50
star
72

DomTreSat

Dominator Tree LLVM Pass to Test Satisfiability
C++
47
star
73

nyc-infosec

Mapping the NYC Infosec Community
CSS
43
star
74

cfg-showcase

Sample programs that illustrate how to use Control Flow Guard, VS2015's control flow integrity implementation
C++
40
star
75

tsc_freq_khz

Linux kernel driver to export the TSC frequency via sysfs
C
40
star
76

HVCI-loldrivers-check

PowerShell
40
star
77

rubysec

RubySec Field Guide
Ruby
40
star
78

indurative

Easily create authenticated data structures
Haskell
37
star
79

http-security

Parse HTTP Security Headers
Ruby
36
star
80

trailofphish

Phishing e-mail repository
Ruby
36
star
81

KRFAnalysis

Collection of LLVM passes and triage tools for use with the KRF fuzzer
LLVM
34
star
82

spf-query

Ruby SPF Parser
Ruby
30
star
83

ebpf-verifier

Harness for the Linux kernel eBPF verifier
C
30
star
84

umberto

poststructural fuzzing
Haskell
30
star
85

ebpf-common

Various utilities useful for developers writing BPF tools
C++
28
star
86

clang-tidy-audit

Rewrite C/C++/Obj-C to Annotate Points of Interest
C++
27
star
87

macroni

C and C++ compiler frontend using PASTA to parse code, and VAST to represent the code as MLIR.
C
27
star
88

eatmynetwork

A small script for running programs with (minimal) network sandboxing
Shell
26
star
89

anselm

Detect patterns of bad behavior in function calls
C++
25
star
90

dmarc

Ruby DMARC Parser
Ruby
25
star
91

testing-handbook

Trail of Bits Testing Handbook
C++
25
star
92

btfparse

A C++ library that parses debug information encoded in BTF format
C++
22
star
93

linuxevents

A sample PoC for container-aware exec events for osquery
C++
22
star
94

ml-file-formats

List of ML file formats
22
star
95

mpc-learning

Perform multi-party computation on machine learning applications
Python
21
star
96

go-mutexasserts

A small library that allows to check if Go mutexes are locked
Go
21
star
97

screen

Measure branching along code paths
C
20
star
98

tacklebox

Phishing Toolkit
Ruby
20
star
99

itergator

CodeQL library and queries for iterator invalidation
CodeQL
19
star
100

WinDbg-JS

JavaScript
19
star