Skip to main content

Crate cargo_frisk

Crate cargo_frisk 

Source
Expand description

cargo frisk — see what you are actually shipping to crates.io.

Secret scanners check what git tracks. cargo frisk checks what cargo ships, and those are not the same set of files. The product is the diff between the packaged .crate tarball and git ls-files; content inspection is an annotation on that diff, not the headline.

use cargo_frisk::{run, Options};

let outcome = run(&Options::default())?;
println!("{} findings", outcome.findings().count());

Modules§

archive
Stream the gzipped tar in memory.
cli
Command-line surface, including the cargo subcommand shim.
config
[package.metadata.frisk] — configuration lives in Cargo.toml.
diff
The three buckets. This is the whole product.
gitset
The git-tracked file set, via git ls-files.
package
Invoke cargo package and locate the .crate it produced.
report
Human, JSON and SARIF output.
rules
Rule loading and compilation.
scan
Content and path inspection — an annotation on the diff, not the headline.

Structs§

Finding
One reportable thing about one packaged file.
Options
What to frisk and how.
Outcome
Everything a single cargo frisk invocation produced.
PackageReport
The result of frisking one package.
Unscanned
A packaged file we deliberately did not scan, and why.

Enums§

FindingKind
Which half of the tool produced a finding.
GitState
Whether we had a git file set to diff against.
Severity
How bad a finding is.
Threshold
The severity at or above which the run fails with exit code 1.
UnscannedReason

Constants§

DEFAULT_MAX_FILE_SIZE
Default per-file scan cap: 5 MB.

Functions§

run
Frisk everything options selects.