ITADN

Add capability to flatten dependency tree into a single directory for easier dependecy hack prevention

#17380Openadalfarus 创建于 5 天前
C-feature-requestS-triage
A
adalfaruscommented
### Problem Supply chain attacks are hard to prevent when each packages depends on three others and you end up with hundreds of dependencies you need to check, and then re-check after every update permissible by the dep filter of all the crates that are in your tree. Or you need to add all dependencies of all packages to your dependencies with locked versions, which is also hard. Especially because you also need to update your deps to get fixes for known vulnerabilities. ### Proposed Solution Basically the sub command: "cargo flatten --depth x" where all packages deeper in the dependency tree than x are flattened into one directory which can then be committed to version control. When updating the dependencies, this approach could also make it easier to spot hacked packages as their source is not longer opaque and changes are tracked. ### Notes Should be relatively easy to implement, just copy the checked out repos to e.g. ./flatten and overwrite them when updating. The whole dep checking doesn't need to change, it would just need to check the depth of a package and copy it over if its over x.
0 条评论