-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature audit #42
feature audit #42
Conversation
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
clap's command + flatten is the best 😭 Signed-off-by: Soc Virnyl Estela <[email protected]>
the lints is propagated from lib.rs anyway Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
I like the use of the serde xml defs for reading the service file :P |
Signed-off-by: Soc Virnyl Estela <[email protected]>
How it works: This binary will try to run `cargo audit --file <pathtolockfile>`. This binary will read `_service` file and searches for the service that corresponds to `cargo_vendor` and attempts to audit them. If `cargo_vendor` service exists, it will use the following params, if they exist: 1. `cargotoml` 2. `src`, `srctar`, `srcdir` `cargotoml`: The `cargotoml` path is used to check if there is also a lockfile to audit in the path where it resides. Otherwise, it will attempt to regenerate the lockfile. `src` `srctar` `srcdir`: This will be used to check the lockfile of the sources and audit it. `lockfiles`: In case additional lockfiles exist to audit from sources. Vendored tarball: Since `cargo_vendor` generates a lockfile and also includes it when generating the vendored tarball, we also check the lockfiles in those contents as well. Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
and banana sauce as well Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
since auditopts does not have `Src`, we can just use our generated `Opts` from `Services` to get the `Src`s we then implement the `Audit` trait on `Src` so we can just ``` let s: Src = ohsomesrc; s.run_audit()?; ``` `run_audit` runs all the other audit methods Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
cargo/src/audit.rs
Outdated
fn process_lockfiles(self) -> io::Result<()>; | ||
// Run audit sets the workdir before running other stuff | ||
fn run_audit(self, opts: &Opts) -> Result<(), AuditFailed>; | ||
fn audit_vendored_tar(self, opts: &Opts, workdir: &Path) -> io::Result<()>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to have opts for this future self, just extract and get the Cargo.lock. You also need to check if there are multiple vendored tarballs. So in this case, use the glob
crate and use /**vendor**.tar.**/
and check their lockfiles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh true. That's a good point.
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
Signed-off-by: Soc Virnyl Estela <[email protected]>
cleanup/improvements to-be-done in the future commits Signed-off-by: Soc Virnyl Estela <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bet
closes #38