Skip to content
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

Cannot use SSH to fetch advisory DB #412

Closed
jbg opened this issue Mar 30, 2022 · 4 comments · Fixed by #426
Closed

Cannot use SSH to fetch advisory DB #412

jbg opened this issue Mar 30, 2022 · 4 comments · Fixed by #426
Labels
bug Something isn't working

Comments

@jbg
Copy link
Contributor

jbg commented Mar 30, 2022

Describe the bug
If an SSH Git URL is provided for the advisory DB, cargo-deny exits with "error: advisory database url is not https".

To Reproduce
Steps to reproduce the behavior:

  1. Set something like db-urls = ["ssh://git@git.yourcompany.com/yourcompany/rustsec-advisory-db.git"] in deny.toml
  2. Run cargo deny
  3. See error

Expected behavior
The advisory DB was cloned over SSH.

Additional context
The check is here: https://github.com/EmbarkStudios/cargo-deny/blob/main/src/advisories/cfg.rs#L131

This crate seems to delegate cloning Git repositories to the git2 crate (update: or, since #420, optionally the Git executable) so I see no reason why the SSH clone would not work if this check was removed.

@jbg jbg added the bug Something isn't working label Mar 30, 2022
@Jake-Shadle
Copy link
Member

That code was added specifically because rustsec doesn't support non-https urls. Please file an issue on rustsec if you want this supported in cargo-deny.

@jbg
Copy link
Contributor Author

jbg commented May 19, 2022

I don't really understand this, because cargo-deny seems to do the cloning itself and pass the git repository as a local filesystem path to rustsec, so rustsec only sees a local path, never the actual URL (whether SSH or HTTPS).

A quick search of this repo doesn't seem to turn up any place where the rustsec method you linked (Repository::fetch()) is called — Repository::open() is used instead, with the local path.

Can you clarify why rustsec's limitation is relevant here?

@jbg
Copy link
Contributor Author

jbg commented May 19, 2022

With the check removed, I'm able to clone an advisory DB over SSH without any problem. I opened #426 to remove the check.

@Jake-Shadle
Copy link
Member

Sorry, had closed this issue before I did #422 but had vaguely remembered it since I included ssh https://github.com/EmbarkStudios/cargo-deny/pull/422/files#diff-ec77dabc8549946f0798d5f19ef476febb6891063bda87f22a42223d10543937R219 as a valid scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants