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

Add an option to ignore invalid certificates when cloning Git repos #116

Closed
ggbce opened this issue Jan 8, 2024 · 8 comments · Fixed by #125
Closed

Add an option to ignore invalid certificates when cloning Git repos #116

ggbce opened this issue Jan 8, 2024 · 8 comments · Fixed by #125
Labels
enhancement New feature or request

Comments

@ggbce
Copy link

ggbce commented Jan 8, 2024

I would like to use NoseyParker to scan or git projects on our internal GitLab server where it is on LAN area and use also an internal enterprise certificate. When I launch a scan I got this error:

fatal: unable to get access to 'https://myserver.local'/test/project1' : Server certificate verification failed. CAfile: non CRLfile: none


If I use my web browser, it work fine. Yes, Firefox or Chrome give me a warning when I try to access it from a Linux machine where is not a Windows member of the domain, but I can accept the unknown certificate. Does it possible to improve to accept unknown certificates like --ignore-invalidcertificate ?

@ggbce ggbce added the enhancement New feature or request label Jan 8, 2024
@bradlarsen
Copy link
Collaborator

@ggbce are you running Nosey Parker using the Docker image?

@bradlarsen
Copy link
Collaborator

A workaround: clone the Git repos you want to scan separately, outside of Nosey Parker, and then scan the local clones.

@ggbce
Copy link
Author

ggbce commented Jan 9, 2024 via email

@bradlarsen
Copy link
Collaborator

If I understand right, https://myserver.local has a self-signed certificate, or something like that?

What happens if you try a regular git clone 'https://myserver.local/test/project1' from the command line? You probably need to do something like GIT_SSL_NO_VERIFY=true git clone 'https://myserver.local/test/project1' to make it successful?

@munntjlx
Copy link
Contributor

What does the full commandline invocation look like?

@ggbce
Copy link
Author

ggbce commented Jan 17, 2024

Like @bradlarsen said. It's to talk with a local server (self-signed or internal authority certification).

./noseyparker scan --datastore project1 --git-url https://myserver.mydomain.local/test/project1

If I would like to make a "git" command. I didn't do it normally from a Linux machine. All dev teams use their Windows machines where they are on the domain. But for the purpose and find how to allow NoseyParker to make the scan from a machine where the certificate is consderated not valid... If I try to clone I should use:

git -c http.sslVerify=false clone "https://myserver.mydomain.local/test/project1"

@ggbce
Copy link
Author

ggbce commented Jan 17, 2024

NOTE:
The suggestion to clone first to create a local copy, then scan locally may work... but is not very productive. Imagine a situation where you have a ton of projects to validate. Copying all this data, analyze it, then delete it.

My goal is to automate the scan on periodic base to ensure a high level of security.

@bradlarsen
Copy link
Collaborator

The suggestion to clone first to create a local copy, then scan locally may work... but is not very productive. Imagine a situation where you have a ton of projects to validate. Copying all this data, analyze it, then delete it.

Indeed! I left that comment as a workaround — the idea was to provide a path that makes what you're trying to do possible, until Nosey Parker has more suitable built-in support for your use case.

@bradlarsen bradlarsen changed the title Ignore certificate or Auto-Import Add an option to ignore invalid certificates when cloning Git repos Feb 8, 2024
bradlarsen added a commit that referenced this issue Feb 16, 2024
* Allow to ignore validation of TLS certificates

This adds a new `--ignore-certs` option to both the `scan` and `github` commands, which causes certificate validation to be skipped. This makes it possible to enumerate GitHub Enterprise Server instances and clone from https sources that are are behind invalid or self-signed certificates.

Fixes #116.

Co-authored-by: Brad Larsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants