supply-chain/README.md
Our main goal with supply chain security is to mitigate the impact of attackers introducing malicious code into third-party dependencies that SurrealDB relies on. At this stage, our aim is to introduce a basic mechanism by which dependency source and access is at least considered as part of the CI process, to reduce the attack surface of SurrealDB by limiting the number of dependencies completely exposed to supply chain attacks and to raise the bar for the effort needed to perform a successful supply chain attack against many of the current SurrealDB dependencies.
Currently, supply chain security is implemented through a basic configuration of cargo-vet for the main SurrealDB repository. This tool is executed as part of the CI process. Ownership of the configuration files for this tool is assigned to @surrealdb/security group in the .github/CODEOWNERS file.
At this stage, the following compromises are made due to lack of dedicated resources to audit dependencies:
In this implementation, it is important to note that cargo-vet is only used as an informational tool and that no significant security review will be performed by SurrealDB for third-party dependencies. The cargo-vet tool will be used to collect information from third-party audits as well as inventory which dependencies are published by trusted developers.
The following is a simplified lightweight process to support contributors in passing dependency checking.
Using the dependency tools locally requires installing the following software:
cargo install --locked cargo-deny
cargo install --locked cargo-vet
The following process can be followed whenever the dependency checking action fails:
cargo-deny:
cargo update <PACKAGE>.
deny.toml file.cargo-deny.cargo-vet:
safe-to-deploy.
cargo vet trust <PACKAGE>cargo vet add-exemption <PACKAGE>cargo vet pruneAll workspace crates (e.g. surrealdb, surrealdb-core, surrealdb-server, surrealism, surrealml-core, etc.) are part of this repo; some are also published to crates.io. We set audit-as-crates-io = false for every workspace crate so they are treated as trusted first-party code regardless of version. That avoids maintaining per-version exemptions or audits when bumping. Downstream consumers of published crates use their own cargo-vet configuration.