drpaneas / goguard

Protect Go repos from CVE threats
GNU General Public License v3.0
59 stars 3 forks source link

GoGuard - Protect Go repos from CVE threats

GBGraphics

GoGuard is a tool that helps you protect your Go projects from known CVE threats. It allows you to check if a given GitHub repository is vulnerable against a specific CVE.

How it works

How to fix a vulnerability

go mod edit -replace gopkg.in/yaml.v2=gopkg.in/yaml.v2@v2.4.0
go mod tidy

Installation

  1. To install GoGuard, you need to have Go installed on your machine. Once you have Go, you can install GoGuard by running the following command:
go install github.com/drpaneas/GoGuard
  1. You also need docker installed, up and running.

Usage

To use GoGuard, supports 3 scan modes

  1. Scan using CVE ID
  2. Scan using GO Vulnerability ID
  3. Scan using a specific Go package and its version

you can run the following command:

Usage: ./goguard <mode> <GitHub-Repo-URL> <CVE ID>
 -- Modes: cve, go, pkg --
  Example: goguard cve <GitHub-Repo-URL> <CVE ID>)
  Example: goguard go <GitHub-Repo-URL> <GOVULN ID>)
  Example: goguard pkg <GitHub-Repo-URL> <VULNPKG> <VULNVER>)

For example:

goguard cve https://github.com/user/repo CVE-2021-4238
goguard go https://github.com/user/repo GO-2022-0411
goguard pkg https://github.com/user/repo 'goutils' '1.0'

This command will check if the GitHub repository https://github.com/user/repo is vulnerable against the CVE CVE-2021-4238.

You can also use the --debug parameter to see more detailed information about the vulnerability check process.

Note

Disclaimer

GoGuard is provided "as is" without warranty of any kind. Use it at your own risk and always verify the information provided with the original sources.